The Manual Installation and Configuration of WordPress and all accompanying components on Windows Server 2012 R2
WordPress “Requirements”
- PHP 5.6 or greater
- MySQL 5.5 or greater
- The mod_rewrite Apache module
– You can find the requirements more depth directly from the WordpPress page: WordPress Requirements
We are going to use:
- WordPress Version 4.3.1
- PHP 5.4
- MySQL 5.5
- IIS URL Rewrite
NOTE: This tutorial assumes you have turned off IE Enhanced Security and Enabled downloads in IE
And that you have set up DNS correctly or modified your hosts file with your domain name
Prep
Windows Roles and Services
First we need to install the proper Windows Roles and Services, some IIS add-ons and MySQL
Roles:
- Web Server (IIS) – Add features that are required and Include management tools (if applicable)
Features:
- .NET Framework 3.5 Features – Add features that are required and Include management tools (if applicable) – Note: this includes .net 2.0 for PHP Manager that we will install later
- SMTP Server – Add features that are required and Include management tools (if applicable) *This will not be covered
- Telnet Client (you dont need it for wordpress, but you should always have this installed for testing)
Role Services for IIS: (leave the default and add the following)
- Health and Diagnostics:
- Logging Tools
- Request Monitor
- Application Development:
- ASP.NET 4.5 – Add features that are required and Include management tools (if applicable)
- CGI
IIS add-ons (PHP, URL Rewrite,
Open IIS, click on your server, and a pop-up box will ask you if “…you want to get started with Microsoft Web Platform…” Click Yes, then proceed to download and install the Web Platform Installer.
Close IIS and the re-open it, now you will see the Web Platform Installer
Open the Web Platform Installer and Install the following:
- PHP 5.4.24, this will install:
- Microsoft Drivers 3.2 for PHP v5.4 for SQL Server in IIS
- IIS Manager
- URL Rewrite
Click Finish and close IIS as we are done with that for now.
MySQL
Now we are going to Download & Install MySQL 5.5.45 and MySQL Workbench.
NOTE: If you know how to run mysql from the command line, the more power to you, this is for Windows. We are going to use a feature of my sql that incorporates a windowed GUI, hence the name
Links to Downloads: MySQL Server & MySQL Workbench
First install MySQL 5.5.45 and at the end of the installation, leave the box checked and you will enter the Instance Configuration.
Choose the Standard Configuration option, click Next
Choose the Install As Windows Service option, name it, and then click Next
Set your root password and click Next
Last click Execute
Now to install MySQL Workbench. I will let you figure this one out. Hint: Download the prerequisites.
At the end of the install, make sure you launch MySQL Workbench before you click Finish
WordPress
Download WordPress and unzip it to C:\inetpub\wwwroot, so you should see the following:
That concludes the prep for a WordPress site to be built, now we need to start the actual configurations.
Configuration
IIS Configuration
Create a new website in IIS, and fill out the fields appropriately:
- Site Name: MyDomain WP Site (arbitrary, just make it identifiable)
- Physical path: C:\inetpub\wwwroot\wordpress (the folder we extracted earlier)
- IP address: Depends on the IP’s on your server, I have one so all unassigned is fine.
- Host name: www.mydomain.com
Add in an additional binding for non-www: http, All Unassigned, Port 80, and mydomain.com
Move the Default Document for index.php to the to of the list:
Create a URL Rewrite rule as follows:
- Rule Name: WordPress (or whatever you want, this is arbitrary)
- Match URL:
- Requested URL: Matches the Pattern
- Using: Wildcards
- Pattern: *
- Conditions:
- Is Not a File
- Is Not a Directory
- Action:
- Action type: Rewrite
- Rewrite URL: index.php
- Append Query String: Check
Create another URL Rewrite rule as follows:
- Type: Canonical domain name
- Select the primary host name: www.mydomain.com
After both rules have been entered, your URL Rewrites should look similar to the following:
Additional, recommended configutations:
- Stop your site, there is no reason to have it running.
- Set up Recycling for App Pool:
- Time: 4:00 AM (or whenever your site is least active, and remove the check for Regular Time Intervals)
- Edit PHP.ini file (C:\Program Files (x86)\PHP\v5.4\php.ini):
- Old Line: post_max_size = 8M
- New Line: post_max_size = 1024M
- Old Line: ;upload_tmp_dir =
- New Line: upload_tmp_dir = C:\inetpub\temp
- Old Line: upload_max_filesize = 2M
- New Line: upload_max_filesize = 1000M
- Old Line: max_file_uploads = 20
- New Line: max_file_uploads = 200
- Add Modify Permission the C:\inetpub\temp
- Old Line: post_max_size = 8M
MySQL Configuration
Open MySQL and log into the instance we created previously.
First thing you will want to do is change the default character-set-server variable to UTF8 as UTF-8 supports any language.
Restart MySQL for the settings to take, or just make sure you manually set the collation of you DB to UTF8 in the next step. (Powershell command: Restart-Service MySQL)
Next we are going to create your WordPress Database.
Right-click on the blank space under the test DB and choose Create Schema…
Give your Schema/DB an appropriate name, I will use mydomainwpdatabase
Next, create a user for that database. I will use mydomainwpdbuser, and give that user full permissions to the Schema/DB that you just created. It will look similar to the following:
And that concludes the database configuration, we are almost done, just a couple more steps.
WordPress Connection Configuration
Navigate to C:\inetpub\wwwroot\wordpress and copy your wp-config-sample.php in the same folder, then rename it wp-config.php
Then you will need to make the following changes to that file to allow your WP site to connect to the database.
========================================
// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘mydomainwpdatabase‘);
/** MySQL database username */
define(‘DB_USER’, ‘mydomainwpdatabaseuser‘);
/** MySQL database password */
define(‘DB_PASSWORD’, ‘mydomainwpdatabaseuerpsswd‘);
/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);
/** Database Charset to use in creating database tables. */
define(‘DB_CHARSET’, ‘utf8’);
/** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ”);
========================================
Additional Setup for WP
Suggested WP Plugins
Suggested WP Settings Changes
Settings > General Settings
- Site Title
- Tagline
- Membership
- Timezone
Settings > Discussion
- Deselect –
Settings > Permalinks
- Common Settings > Post name (or whatever makes the most sense for your site)
1 Comment