Setup a WordPress site on Windows using IIS

 

Install WordPress on windows

Create Folder in wwwroot and IIS website for new website

Install PHP/MySQL/WordPress
This will also install and configure MySQL & PHP if not installed

Go to https://www.microsoft.com/web/downloads/platform.aspx and click install now.
If program does not run, run the download.

In upper right type WordPress and click enter
Click the Add button next to the one titled WordPress
Click Install

Follow the install steps
The next page will be all the Items the installer is going to do.
Click I Accept

If PHP is not installed, it will install and configure for you.
Click Continue

If MySQL is not installed, it will ask you to define a root password.
Click Continue

The system will now do a small download and install.

The next step will be setting the folder for WP and settings.
Choose your new website
Leave Application name as WordPress
Click Continue.

The installer will now Install and configure WordPress.

When finished it will give you all your database information
Document this for safe keeping.

Click Finish
WordPress is now installed accessible via (domain.com/wordpress)

Go to url and finish install.
Your site is now ready to use as (domain.com/wordpress)

Configure WordPress to be (domain.com)

I have provided the simplified steps below, however full instructions can be viewed here https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

Login and go to settings
Change the settings to reflect:
WordPress address (URL): https://domain.com/wordpress
Site address (URL): https://domain.com

Copy (NOT MOVE!) the index.php to the root directory from the WordPress folder.

Edit index.php in root directory
Change the following and save the file.
Change the line that says:
require(‘./wp-blog-header.php’);
to the following, using your directory name for the WordPress core files:
require(‘./wordpress/wp-blog-header.php’);

Redirects
Create web.config in root directory and add the following to the file:

TROUBLE SHOOTING

Permalinks
If you have set up Permalinks, go to the Permalinks panel and update your Permalink structure.

To make site run faster if database is on same server
Open wp-config.php
Change define(‘DB_HOST’, ‘localhost’); to define(‘DB_HOST’, ‘127.0.0.1‘);

If you have Issues with File uploads

For the whole WP folder have Read & Execute, List Folder Contents, and Read permissions assigned to:
IUSR, IIS_IUSRS, NETWORK SERVICE



<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress Rule 1" stopProcessing="true">
<match url="^index.php$" ignoreCase="false" />
<action type="None" />
</rule>
<rule name="WordPress Rule 2" stopProcessing="true">
<match url="^([_0-9a-zA-Z-]+/)?files/(.+)" ignoreCase="false" />
<action type="Rewrite" url="wp-includes/ms-files.php?file={R:2}" appendQueryString="false" />
</rule>
<rule name="WordPress Rule 3" stopProcessing="true">
<match url="^([_0-9a-zA-Z-]+/)?wp-admin$" ignoreCase="false" />
<action type="Redirect" url="{R:1}wp-admin/" redirectType="Permanent" />
</rule>
<rule name="WordPress Rule 4" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions logicalGrouping="MatchAny">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
</conditions>
<action type="None" />
</rule>
<rule name="WordPress Rule 5" stopProcessing="true">,/span>
<match url="^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)" ignoreCase="false" />
<action type="Rewrite" url="{R:2}" />
</rule>,/span>
<rule name="WordPress Rule 6" stopProcessing="true">
<match url="^([_0-9a-zA-Z-]+/)?(.*.php)$" ignoreCase="false" />
<action type="Rewrite" url="{R:2}" />
</rule>
<rule name="WordPress Rule 7" stopProcessing="true">
<match url="." ignoreCase="false" />
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

Change PHP
Create folder phptemp in C:inetpubphptemp
Giving IIS_IUSRS – Read & Execute, List Folder Contents, Read permissions

In the php.ini file (usually located at C:Program Files (x86)PHPv5.4)
Set the following property value – upload_tmp_dir = c:wordpress_upload_temp

If you have Issues Upgrading
For the whole WP folder give IUSR – modify permission

Facebook
Twitter
LinkedIn
Archives
Struggling with unpredictable and costly IT? Grab a FREE copy of The Ultimate Guide to Managed Services and learn how managed IT services can optimize your IT infrastructure and ensure predictable IT costs.DOWNLOAD IT TODAY FOR FREE
+