We won again!

Great victory for the People - Tax Cut!

Movng WordPress Site to a W2K8 Server and IIS7

If you like to be in control of all your servers, you would love the gentle nature of WordPress installation.  Installation includes PHP,  MySQL  and  WordPress components.  All steps can be done manually.  Instead of running install, you can just copy files and directories, and make manual configurations adjustments.  It is like labyrinth of  DLL(s) meets the non-DLL world for the first time.

 

Check IIS7 Installed Components

Windows Server 2008 comes with IIS 7.  Windows 7  and Server 2008 R2 come with IIS 7.5.

Check that CGI is installed under IIS Roles (Windows Features).

 

Installing PHP

Download and install latest PHP.
Warning 1: Pick “nts” (non-thread-safe) package, if you are planning to run PHP on IIS FastCgiModule.
Warning 2: During install visually check that “MySQL” extension is selected (out of many similarly-named extensions).

Validate *.php mapping is added in IIS Admin (php-cgi.exe)

Validate default document index.php is added to the list of default documents.

Validate PHP is operational.    Create info.php with one line of code
<?php phpinfo(); ?>and open it in your browser.

 

Installing MySQL

Manual MySQL Config
There is a way to enable MySQL without an install. Just add a directory, where your my.ini is sitting to your PATH, or borrow a CurrentControlSet\Services\MySQL branch from the registry of other similarly configured server.

Download and install latest MySQL
Set root user password and record it.
Stop MySQL service.
Move your MySQL data directory to a desired locaton.
Modify my.ini file to point to a new D/B path.
Start MySQL service.

 

Copy WordPress from Another Server

Copy both your WP site and your MySQL database to W2K8 Server.

Notice 1: To be able to write to a directory on W2K8 Server from an outside PC, add Authenticated Users and give Write rights to a share..

Notice 2: To move MySQL Database, you need to stop MySQL service first.  MySQL data directory contains all the D/B users and their rights.

If you have difficulties accessing your WordPress site, or if it lost its formatting,  you might need to fix 2 values in wp_options table using MySQL Command Shell:

use Your_DB_Name;
update wp_options set option_value = "URL_OF_YOUR_SERVER" where option_name in ("home", "siteurl");

Also, check, if any adjustments to your wp-config.php are required.

Your WP site should start working right away.

 

Troubleshoot Errors

(01) Error message:  “Your PHP installation appears to be missing the MySQL

Search for MYSQL string in php.ini and on your PHP validation page.  It is very easy to pick some wrong extension instead of MySQL.   Usually MySQL extension  option is selected by default with PHP install.

(02) Error message: “HTTP Error 500 – Server Error.  The FastCGI Handler was unable to process the request”.

First. Your might picked a wrong PHP package.  You need to download and install an “nts” (non-thread-safe) PHP package.
Second.  Search for PHP_OPENSSL line in your php.ini file and try to enable/disable it:

extension=php_openssl.dll

 

Security Permissions on Your WordPress Site Folder

If you place your WordPress site outside inetpub/wwwroot, you need to add not only default Internet user IIS_IUSRS, but also user NT SERVICE\TrustedInstaller to have Full Control.    [That was NOT confirmed on later tests.]

 

Final Notes

[On Sunday, July 18 just before 23:38 we installed WordPress on Windows 2008 Server]
This article was originally written to save knowledge gained during our first install of a WordPress on a local Windows 2008 Server.  Above is a quick recap of the steps taken.

Since then, we rolled out multiple WordPress installation and various migration scenarios.  This document is continuously updated to reflect latest findings.

(Visited 52 times, 1 visits today)

Be the first to comment

Your question, correction or clarification Ваш вопрос, поправка или уточнение