Monday, September 01, 2008

[log] How to install Wordpress on IIS 6 Windows Home Server

The following is very specific to IIS 6.0 Windows Home Server. It is a continuation of this post.

Critical assumptions:

- You have set up a domain with homeserver.com (like, http://yourdomain.homeserver.com), when you set up your home server machine
- You have done ALL the steps to install PHP and MySQL

And now, for Wordpress:

1. Download and unpack
- Download from: http://wordpress.org/download/ (wordpress-x.x.x.zip)
- Create the directory c:\inetpub\wwwroot\blog (This would allow your blog to be accessed at http://yourdomain.homeserver.com/blog)
- Copy wordpress-x.x.x.zip\wordpress\* into c:\inetpub\wwwroot\blog (Navigate into the zip file in an explorer window, and double click on the file)

2. Create database and user
- Open MySQL client (Start Menu -> Programs -> MySQL -> MySQL Command Line Client)
- Enter your admin user password (hopefully you wrote this down)
- Type in the following commands (the expected outcome of each command should look like "Query OK, x row affected")

> create user wordpressusr identified by 'wordpresspwd';
> create database wordpress;
> grant all privileges on wordpress.* to wordpressusr;
> flush privileges;
> exit;

3. Setup Wordpress Config file
- Open an explorer window and navigate to c:\inetpub\wwwroot\blo
- Rename wp-config-sample.php file to wp-config.php
- Open wp-config.php in a text editor (Use notepad if there's nothing else)
- Find the three lines that look like below and changed them to match:

define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'wordpressusr'); // Your MySQL username
define('DB_PASSWORD', 'wordpresspwd'); // ...and password

4. Go through Wordpress Install
- In a web browser, go to http://localhost/blog/wp-admin/install.php
- Follow the self-explanatory instruction. It will walk you through creating an administrator account.

5. Change blog address
(This step is missing in all instructions that I've seen)
- In a web browser, go to http://localhost/blog
- Find the login link and login as administrator.
- Click on "settings" (near right hand side of screen)
- For "Blog Address" and "Wordpress Address", change from "localhost" to "yourdomain.homeserver.com"

6. Change wp-content write permission
(This step is also missing in all instructions that I've seen)
- In an explorer window, navigate to c:\inetpub\wwwroot\blog\
- Right-click on wp-content
- Click on "Properties"
- Click on "Security" tab
- In the top-half of the window, click on "Windows/Users" in the list of users
- Then in the bottom-half of the window, click on checkbox for "modify" and "write"
- (If you don't do this, you won't be able to upload images and other content)

7. Now you are finally done
- In a web browser, go to http://yourdomain.homeserver.com/blog
- (If you don't see anything, make sure you had set up index.php as default content. See step 4 of how to install php)
- Login. Spend the rest of the day downloading and figuring out which theme you want to use (no one can resist spending hours fussing with themes)
- Oh yes, and blog.