Installing WordPress on IIS 7 – Part 1
Pluralsight blog Where devs, IT admins & creative pros go for news, tips, videos and more.
3,500+ tech & creative courses authored by experts - unlimited & online Get it now →
October 6, 2008

Installing WordPress on IIS 7 – Part 1

By

In the past few weeks I have been writing a lot about using open source software such as PHP and MySQL on IIS7 to get you ready for today. This article will take the knowledge and experience of those articles and apply them to install one of the most popular open source blogging and CMS software products: WordPress.

WordPress is always being updated but for this article we will be using the 2.6 version. A word about the versions, this article should stay applicable through the usual feature updates, if there is a major code overhaul there might be issues, but as long as you are in 2.x fork you should be good following this article.

WordPress Requirements

As I said, my earlier articles were in preparation for this article so if you have not already done so please go back and follow these earlier articles to make sure your IIS7 server is ready for WordPress.

Now with those applications and module installed we are ready to move forward!

Download WordPress

Now that we are going to install WordPress let’s download the files and get them on the server. You can either FTP these up to your server or as I am going to do, just download them directly from the server.

You can get the latest files here: http://www.wordpress.org/download. You should see a big download button on the top of the right column, go ahead and start the download.

WordPress is famous for the 5-minute install, which normally is quite correct for Apache servers. Our install might take a little longer, but shouldn’t be too bad.

Now that you have downloaded the files, go ahead and unzip/FTP them to the site directory on the server.

I am going to be installing this under a local domain called wordpresstestinstall.com that is setup to resolve locally for my server. The physical path of the directory is under the directory structure specified in the php.ini.

NOTE: This is a biggie, back in the Install PHP article there was a section that had you modify the php.ini with the top most level of the directory structure that PHP would function within. You MUST have this WordPress install under that directory structure for it to function.

Configure MySQL for WordPress

Now, we have to setup a MySQL database for WordPress to use. There are several ways to do this, especially if you used my Install phpMyAdmin article, you can use that or you can use the MySQL command line interface.

I will actually walk you through both, we will start with phpMyAdmin, but if you want to use the command line sequence instead skip this next section.

Setup MySQL Database with phpMyAdmin

If you read my earlier articles then you know that phpMyAdmin can be used to create and manage MySQL databases in a somewhat easy to use GUI. If you have installed phpMyAdmin let’s go ahead and use that first, by opening it in your web browser.

1. First login with your MySQL username and password.

Unless you have setup other high level users this will almost certainly have the username of root and whatever password you used to install MySQL then hit Go.

Installing WordPress on IIS 7 - 1

2. On this page you can type the name of the database into the field under Create new database.

For this demo I am just going to use wordpress, but you may want to use something a little less generic. After typing in the name, click on Create.

Installing WordPress on IIS 7 - 2

3. Now we are going to create a user for the wordpress database, go ahead and click Privileges

Installing WordPress on IIS 7 - 3

4. Now click on Add a new User

Installing WordPress on IIS 7 - 4

5. Now fill in the details for your new user. For my demo I am using the following information:

User name: wpuser
Host: Any host
Password: password
re-type: password

The rest of the settings I am going to leave at the default and then click Go at the bottom of the screen.

Installing WordPress on IIS 7 - 5

6. After creation scroll down to the section Database-specific privileges and in the dropdown choose the database you created earlier. In this instance it is wordpress.

Once you scroll down you will see the page load up all the possible privileges for that database. Since I want this user to have full rights on this database I am going to select Check All and then click Go.

Installing WordPress on IIS 7 - 6

7. Ok that’s it, you should now have the following information available for your WordPress install:

Database Name: wordpress
Database User: wpuser
DB User Password: password

Use MySQL Command Line Interface

This section is only if you didn’t use the phpMyAdmin interface to setup your MySQL database. We are going to setup the exact same database as before — just without phpMyAdmin.

1. Go to the start menu and open up the MySQL program folder and click on MySQL Command Line Client

Installing WordPress on IIS 7 - 7

2. You will need to enter the root password and hit Enter

Installing WordPress on IIS 7 - 8

3. At the prompt type in: CREATE DATABASE wordpress; then hit Enter.

Installing WordPress on IIS 7 - 9

4. Now we will create and assign the user:

GRANT ALL PRIVILEGES ON databasename.* TO "wpuser"@"localhost"
IDENTIFIED BY "password";

then hit Enter

Note: To go to a second line just hit Enter without a ";" at the end of a line. The ";" signals the end of the command.

Installing WordPress on IIS 7 - 10

5. Now type the following:

FLUSH PRIVILEGES;
then hit Enter

6. Type Exit

7. Ok that’s it, you should now have the following information available for your WordPress install:

Database Name: wordpress
Database User: wpuser
DB User Password: password

Run the WordPress Install Script

Ok the moment of truth is upon us. First we are going to modify the wp-config-sample.php file with some information.

1. Navigate to the directory you placed your files and find the file named wp-config-sample.php and open it with Notepad.

Installing WordPress on IIS 7 - 11

2. You need to modify the following fields in the file. Please note I am using my values in the screenshot, replace them with your specific information.

DB_NAME: wordpress
DB_USER: wpuser
DB_PASSWORD: password

In the next section replace ‘put your unique phrase here’ with a different random phase for each, you don’t have to remember them so just make it up.

Installing WordPress on IIS 7 - 12

3. Save the file as wp-config.php

4. Type in the following to start the script replacing wordpresstestinstall.com with your domain.

http://wordpresstestinstall.com/wp-admin/install.php

You will find that the WordPress welcome screen is now shown. You can now configure the following — use your own info:

Blog Title: WordPress Test Install
Your E-mail: email
Click Install WordPress after you are done.

Installing WordPress on IIS 7 - 13

5. You should now see a screen that says Success! with your username (always admin) and a random password you can change later.

Make sure you write down or copy the password. There is also a small button at the bottom that says Log In, go ahead and click that button.

Installing WordPress on IIS 7 - 14

6. You will now be asked for your username and password that was given on the last page (I told you to write it down). So fill those in and click Log In

Installing WordPress on IIS 7 - 15

7. Now if you login and see a 403 error screen, more than likely it means your default document isn’t setup for index.php in IIS Manager.

If you are seeing the WordPress dashboard, then skip to the next step. For those that need to, do the following:

  1. Open IIS Manager
  2. Click on the site you are working with
  3. In the center content area click on Default Documents
  4. Once in Default Documents click on Add… in the right pane
  5. In the Add Default Document Box type Index.php
  6. Click OK
  7. Close IIS Manager
  8. Refresh your browser or login again to http://domainname.com/wp-admin/

8. Congratulations, you should now be in the WordPress Dashboard! You can also click the little button that says Visit Site and you will see the default post and theme loaded on your site.

Installing WordPress on IIS 7 - 16

Installing WordPress on IIS 7 - 17

Installing WordPress on IIS 7 – Part 2

Ok, now we have a WordPress blog setup and running on IIS7, with the core basic functionality. In my next article we’ll go a little further and enhance it a bit. In Installing WordPress on IIS 7 – Part 2 I’ll show you how to:

  • Set up search engine friendly URLs for WordPress on IIS7 to increase your SEO
  • Take advantage of the many WordPress plugins
  • Set up IIS Authentication for WordPress

About the Author

(MCTS, MCP, A+) has been working in the IT field since leaving the U.S. Army in 1996.  Working his way up from printer hardware repair to running a corporate datacenter for a multinational corporation, Dave has seen many environments throughout the years. Focusing on web sites and search engine optimization the last few years, with the release of Server 2008 it has renewed his passion for the Wintel platform and server technologies. David also runs Windows-Server-Training.com where he posts free videos and walk-throughs for a variety of server technologies. David currently works as a freelance technical consultant and writer for a variety of companies in the Chicago area.

Author's Website: http://www.DaveLawlor.com


Discussion