Install WordPress with IIS 7, PHP, MySQL – the easy way

Original Post: https://zousu.wordpress.com/2011/06/19/installing-wordpress-on-iis-7-php-mysql-the-easy-way/

Install WordPress with IIS 7, PHP, MySQL – the easy way

Recently I’ve started to play around with WordPress.com however the best way to get the most out of all WordPress extras is to install it on your own PC. In this tutorial we will go through the steps to install IIS 7, PHP  5, MySQL 5 and WordPress 3.

Step 1: Files to Download

  1. PHP 5.3 – windows installer non-thread safe.
  2. MySQL 5.5 – grab the MSI installer for either 32 or 64 bit machine. Also grab this GUI Workbench tool.
  3. WordPress

Step 2: Install IIS 7

Go to Start -> Control Panel -> Programs -> Turn Windows Feature On/Off.

Expand the Internet Information Services tick:

  • Web Management Tools/IIS Management Console
  • World Wide Web Services/Application Development Features/CGI
  • World Wide Web Services/Common HTTP Features/Default Document, Directory Browsing, HTTP Errors, Static Content.

Click “Ok” and wait for it to finish!

In your browser go to http://localhost and if installed correctly the main screen of IIS7 should appear.

Step 3: Install PHP

Run the installer and go with the defaults. Select “IIS FastCGI” when prompted. The installer will automatically add pre-sets to IIS. Done!

Test the PHP install by creating a text file in C:\inetpub\wwwroot\test.php. Name it “test.php” and put the following code in

<?php
 phpinfo();
?>

Now go to http://localhost/test.php and you should see the PHP screen.

Step 4: Install MySQL

Run the installer for MySQL 5.5 and the GUI Management Tool. Choose “Typical” setup when prompted and use the default settings.

Once completed an “Instance Configuration Wizard” will start. Follow the default settings. Enter the root password when prompted, keep it simple and write it down. Let the wizard run through.

Next install the GUI Workbench. Again follow through with the default settings.

Step 5: Create wordpress database

Open the GUI Workbench through Start->All Programs -> MySQL -> MySQL Workbench

In the SQL Development column double click on “Local instance MySQL”. Once logged in, on the left-hand menu you will see “Add Schema”, click it. Change the “new_schema” name to “wordpress”. Finish by clicking “Apply” and “Finish”. Now next to “test”, you should see “wordpress”.

Step 6: Install WordPress

Unzip the downloaded wordpress.zip folder. Copy the contents into C:\inetpub\wwwroot\wordpress.

To start the installer in you browser go to http://localhost/wordpress/

When prompted put in the database name, and root passwords we had in step 4 & 5

Once completed go to http://localhost/wordpress/wp-login.php to start creating your first WordPress site.

Extra Step: Turn automatic on for IIS and MySQL services

Most likely you won’t be playing around with WordPress everyday, so it makes sense to only turn on the servers when you need to. MySQL and IIS are set to turn on automatically when the PC starts.

To turn off the automatic start, go to Control Panel -> System and Security -> Administrative Tools -> Services

Scroll down to “MySQL”, right-click to “Properties” and set “Startup Type”: to Manual

Do the same for “World Wide Web Publishing Service”.

Common Problems:

WordPress could not create wp-config.php. Go into C:\inetpub\wwwroot\wordpress copy the wp-config-sample.php and change the DB_NAME, DB_USER, DB_PASSWORD, DB_HOST values. and save it as wp-config.php

WordPress can’t upload any files, go to C:\inetpub\wwwroot\wordpress\wp-content right-click to select Properties -> Security -> Edit. Give IIS_IUSRS “Full Control”

When I go http://localhost/wordpress/ a list of files show. Open up the IIS Manager. Select Sites-> Default Web Site -> wordpress , double-click on “Default Document” in the Features View. Add “index.php

If you liked this tutorial or spotted any errors please let me know by leaving a comment below.

Installing WordPress on CentOS 5/6

1. wget http://wordpress.org/latest.tar.gz
2. cp /home/IICT/latest.tar.gz /var/www/html/
3. cd /var/www/html/
4. tar -xzvf latest.tar.gz
5. mysql -uroot -p(password)
6. nano /var/www/html/wordpress/wp-config.php

<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
* installation. You don't have to use the web site, you can just copy this file
* to "wp-config.php" and fill in the values.
*
* @package WordPress
*/

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', 'iict123');

/** 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', '');

/**#@+
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
define('AUTH_KEY', 'put your unique phrase here');
define('SECURE_AUTH_KEY', 'put your unique phrase here');
define('LOGGED_IN_KEY', 'put your unique phrase here');
define('NONCE_KEY', 'put your unique phrase here');
define('AUTH_SALT', 'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT', 'put your unique phrase here');
define('NONCE_SALT', 'put your unique phrase here');

/**#@-*/

/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each a unique
* prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_';

/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*/
define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

CREATE DATABASE wordpress;
mysql> CREATE USER wordpressuser@localhost;
Query OK, 0 rows affected (0.02 sec)

mysql> SET PASSWORD FOR wordpressuser@localhost= PASSWORD("iict123");
Query OK, 0 rows affected (0.02 sec)

mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.02 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
8. Goto http://localhost/wordpress/wp-admin/install.php

9. Details:

WordPress is a content management system originally developed for blogging, but has been greatly expanded through widgets, themes and plugins. Complete the following steps to install WordPress on a CentOS 5/6.

Pre-reqs

yum -y install mysql-server httpd php php-mysql unzip wget  
chkconfig httpd on 
chkconfig mysqld on  
/etc/init.d/mysqld start 
/etc/init.d/httpd start

Create a WordPress database and MySQL User

Note: After the wordpress files are unzipped, they will be in a directory called wordpress in the home directory.

  • Log in to the MySQL Shell and create a new MySQL directory for wordpress
    mysql -u root -p
  • After logging in using your MySQL root password, create a WordPress database:

(For this example, we will use the database name WordPressdb.)

   CREATE DATABASE WordPressdb; 
  • Then we need to create the new user. You can replace the database, name, and password, with whatever you prefer:
    CREATE USER wordpressuser@localhost; 
  • Set the password for your new user:
   SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password"); 

Note: For security purposes, you would obviously not use “password” for your password. Be sure to assign a secure password in this line instead.

  • Grant all applicable privileges to the new user. Without this command, the wordpress installer will not start up:
   GRANT ALL PRIVILEGES ON WordPressdb.* TO wordpressuser@localhost IDENTIFIED BY 'password'; 

  • Refresh MySQL:
FLUSH PRIVILEGES;
  • Exit out of the MySQL shell:
   exit

Configure WordPress

  • Copy the sample wordpress configuration file from the wordpress directory, into a new file.
  • Edit the new file to create a new usable wordpress config file:
    cp ~/WordPressdb/wp-config-sample.php ~/WordPressdb/wp-config.php
  • Open the wordpress config:
    vi ~/WordPressdb/wp-config.php
  • Find the section that contains the field below and substitute in the correct name for your database, username, and password:
// ** MySQL settings - You can get this info from your web host ** // 
/** The name of the database for WordPress */ define('DB_NAME', 'WordPressdb'); 
/**MySQL database username */ define('DB_USER', 'wordpressuser'); 
/** MySQL database password */ define('DB_PASSWORD', 'password');
  • Save and Exit.

Copy the Files

  • Transfer the unzipped WordPress files to the website’s root directory.
    sudo cp -r ~/wordpress/* /var/www/html
  • Set the permissions on the installation. First, switch in to the web directory:
    cd /var/www/
  • Give ownership of the directory to the apache user.
    sudo chown www-data:www-data * -R sudo usermod -a -G www-data username
  • Install the following php module on your server, to enable the WordPress installation form online. Download php-gd:
    sudo apt-get install php-gd
  • Restart Apache:
    sudo service httpd restart

Confirm setup

  • Review your new set up at http://your-server-ip-or-hostname/wp-admin/install.php

http://www.rackspace.com/knowledge_center/article/installing-wordpress-on-centos-56

How To Install WordPress on Centos 6

https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-centos-6–2

About WordPress

WordPress is a free and open source website and blogging tool that uses php and MySQL. It was created in 2003 and has since then expanded to manage 22% of all the new websites created and has over 20,000 plugins to customize its functionality.

Setup

The steps in this tutorial require the user to have root privileges. You can see how to set that up here in steps 3 and 4.

Before working with wordpress, you need to have LAMP installed on your server. If you don’t have the Linux, Apache, MySQL, PHP stack on your server, you can find the tutorial for setting it up here.

Once you have the user and required software, you can start installing wordpress!

Step One—Download WordPress

We can download WordPress straight from their website:

wget http://wordpress.org/latest.tar.gz

This command will download the zipped wordpress package straight to your user’s home directory. You can unzip it the the next line:

tar -xzvf latest.tar.gz

Step Two—Create the WordPress Database and User

After we unzip the wordpress files, they will be in a directory called wordpress in the home directory.

Now we need to switch gears for a moment and create a new MySQL directory for wordpress.

Go ahead and log into the MySQL Shell:

mysql -u root -p

Login using your MySQL root password, and then we need to create a wordpress database, a user in that database, and give that user a new password. Keep in mind that all MySQL commands must end with semi-colon. First, let’s make the database (I’m calling mine wordpress for simplicity’s sake; feel free to give it whatever name you choose):

CREATE DATABASE wordpress;
Query OK, 1 row affected (0.00 sec)

Then we need to create the new user. You can replace the database, name, and password, with whatever you prefer:

CREATE USER wordpressuser@localhost;
Query OK, 0 rows affected (0.00 sec)

Set the password for your new user:

SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password");
Query OK, 0 rows affected (0.00 sec)

Finish up by granting all privileges to the new user. Without this command, the wordpress installer will not be able to start up:

GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.00 sec)

Then refresh MySQL:

FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Exit out of the MySQL shell:

exit

Step Three—Setup the WordPress Configuration

The first step to is to copy the sample wordpress configuration file, located in the wordpress directory, into a new file which we will edit, creating a new usable wordpress config:

cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php

Then open the wordpress config:

vi ~/wordpress/wp-config.php

Find the section that contains the field below and substitute in the correct name for your database, username, and password:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wordpressuser');

/** MySQL database password */
define('DB_PASSWORD', 'password');

Save and Exit.

Step Four—Copy the Files

We are almost done uploading WordPress to the server. The final move that remains is to transfer the unzipped WordPress files to the website’s root directory.

sudo cp -r ~/wordpress/* /var/www/html

From here, WordPress has its own easy to follow installation form online.

However, the form does require a specific php module to run. If it is not yet installed on your server, download php-gd:

sudo yum install php-gd

Last of all restart Apache:

 sudo service httpd restart

Step Five—RESULTS: Access the WordPress Installation

Once that is all done, the wordpress online installation page is up and waiting for you:

Access the page by adding /wp-admin/install.php to your site’s domain or IP address (eg. example.com/wp-admin/install.php) and fill out the short online form (it should look like this).

Install WordPress with IIS 7, PHP, MySQL – the easy way

Recently I’ve started to play around with WordPress.com however the best way to get the most out of all WordPress extras is to install it on your own PC. In this tutorial we will go through the steps to install IIS 7, PHP  5, MySQL 5 and WordPress 3.

Step 1: Files to Download

  1. PHP 5.3 – windows installer non-thread safe.
  2. MySQL 5.5 – grab the MSI installer for either 32 or 64 bit machine. Also grab this GUI Workbench tool.
  3. WordPress

Step 2: Install IIS 7

Go to Start -> Control Panel -> Programs -> Turn Windows Feature On/Off.

Expand the Internet Information Services tick:

  • Web Management Tools/IIS Management Console
  • World Wide Web Services/Application Development Features/CGI
  • World Wide Web Services/Common HTTP Features/Default Document, Directory Browsing, HTTP Errors, Static Content.

Click “Ok” and wait for it to finish!

In your browser go to http://localhost and if installed correctly the main screen of IIS7 should appear.

Step 3: Install PHP

Run the installer and go with the defaults. Select “IIS FastCGI” when prompted. The installer will automatically add pre-sets to IIS. Done!

Test the PHP install by creating a text file in C:\inetpub\wwwroot\test.php. Name it “test.php” and put the following code in

<?php
 phpinfo();
?>

Now go to http://localhost/test.php and you should see the PHP screen.

Step 4: Install MySQL

Run the installer for MySQL 5.5 and the GUI Management Tool. Choose “Typical” setup when prompted and use the default settings.

Once completed an “Instance Configuration Wizard” will start. Follow the default settings. Enter the root password when prompted, keep it simple and write it down. Let the wizard run through.

Next install the GUI Workbench. Again follow through with the default settings.

Step 5: Create wordpress database

Open the GUI Workbench through Start->All Programs -> MySQL -> MySQL Workbench

In the SQL Development column double click on “Local instance MySQL”. Once logged in, on the left-hand menu you will see “Add Schema”, click it. Change the “new_schema” name to “wordpress”. Finish by clicking “Apply” and “Finish”. Now next to “test”, you should see “wordpress”.

Step 6: Install WordPress

Unzip the downloaded wordpress.zip folder. Copy the contents into C:\inetpub\wwwroot\wordpress.

To start the installer in you browser go to http://localhost/wordpress/

When prompted put in the database name, and root passwords we had in step 4 & 5

Once completed go to http://localhost/wordpress/wp-login.php to start creating your first WordPress site.

Extra Step: Turn automatic on for IIS and MySQL services

Most likely you won’t be playing around with WordPress everyday, so it makes sense to only turn on the servers when you need to. MySQL and IIS are set to turn on automatically when the PC starts.

To turn off the automatic start, go to Control Panel -> System and Security -> Administrative Tools -> Services

Scroll down to “MySQL”, right-click to “Properties” and set “Startup Type”: to Manual

Do the same for “World Wide Web Publishing Service”.

Common Problems:

WordPress could not create wp-config.php. Go into C:\inetpub\wwwroot\wordpress copy the wp-config-sample.php and change the DB_NAME, DB_USER, DB_PASSWORD, DB_HOST values. and save it as wp-config.php

WordPress can’t upload any files, go to C:\inetpub\wwwroot\wordpress\wp-content right-click to select Properties -> Security -> Edit. Give IIS_IUSRS “Full Control”

When I go http://localhost/wordpress/ a list of files show. Open up the IIS Manager. Select Sites-> Default Web Site -> wordpress , double-click on “Default Document” in the Features View. Add “index.php”

If you liked this tutorial or spotted any errors please let me know by leaving a comment below.

Install Internet Information Services 7.0 and WordPress 3.0.3 by Using the Microsoft Web Platform Installer 3.0

This article describes how to install and configure WordPress 3.0.3 on Windows Server 2008 R2 by using the Microsoft Web Platform Installer (Web PI) version 3.0.

The Web PI is a free tool that makes getting the latest components of the Microsoft Web Platform—including Internet Information Services (IIS), MySQL, the Microsoft .NET Framework, and Visual Web Developer—quick and easy. The Web PI also lets you install web applications such as WordPress with the built-in Windows Web App Gallery.

To install WordPress on IIS 7.0 by using the Web PI 3.0, follow these steps:

Prequisites

Step 1. Install the Web Platform Installer 3.0

Step 2. Select the products and applications to install

Step 3. Review and configure the selected products and applications

Step 4. Complete the installation and configuration

Step 5. Enable clean URLs (Pretty Permalinks)

Prerequisites

The supported operating systems for the Web PI 3.0 are Windows 7, Windows Vista Service Pack 1 (SP1), Windows Vista, Windows XP Service Pack 2 (SP2) and later versions, Windows Server 2008 R2, Windows Server 2008, and Windows Server 2003 Service Pack 1 (SP1) and later versions.

For this guide, it is assumed that you have Windows Server 2008 R2 installed on your computer. You will also need an Internet connection and administrator privileges for your computer.

It is a good idea to confirm that your system meets the hardware requirements for IIS 7.0. See http://technet.microsoft.com/en-us/library/cc268240.aspx for more information.

Step 1. Install the Web Platform Installer 3.0

In this step, you begin to install the Web PI 3.0, which is a 1.3 MB download.

  1. Log on to Windows Server 2008 R2 as a user who has administrative privileges.
  2. Start Windows Internet Explorer.
  3. Go to http://www.microsoft.com/web/downloads/platform.aspx, and then click Download It Now.
    Microsoft Web Platform Installer 3.0 webpage
  4. Click Run.
    File download security warning
  5. Click Run again.
    Internet Explorer security warning
  6. Wait a few seconds for the Web PI 3.0 to start.

Step 2. Select the products and applications to install

In this step, you select the version of WordPress that you want to install. WordPress 3.0.3 is used in this guide.

  1. Next to WordPress, click Add.
    Note: If WordPress is not in the items list, click Applications in the left navigation pane.
    Application selection
  2. Click Install.
    Application selection (continued)

Step 3. Review and configure the selected products and applications

In this step, you review and configure what you have added. Additionally, you add the database, name the MySQL database, and name the WordPress 3.0.3 site.

  1. When you are asked which type of database you want to use, leave MySQL selected.
    Note: This will install MySQL 5.1 for Windows to handle all the database transactions that are required by WordPress.
  2. In the list, select Install it on my machine, and then click Continue.
    Database engine selection
  3. Scroll down to confirm that all the following items have been automatically included as dependencies:
    • IIS 7.0
    • PHP 5.3.5
    • IIS URL Rewrite 2.0
    • Windows Cache Extension 1.1 for PHP 5.3
    • MySQL 5.1 for Windows
      Note: Windows Cache Extension is used to increase the speed of PHP applications that are running on your web host. IIS URL Rewrite allows “Pretty Permalinks” to be enabled for WordPress.
  4. Review the files to be downloaded and installed, as well as the license agreements, and then click I Accept.
    Application installation summary
  5. Specify a password for the MySQL administrator user name (root), and then click Continue.
    Note: It is important to remember this password because you will be asked for this password in the steps that follow.
    MySQL root password setup
  6. Allow the Web PI installation to complete.
  7. In the Web Site box, leave Default Web Site selected.
  8. In the ‘WordPress’ application name box, type a name for the WordPress 3.0.3 site, and then click Continue. For example, type myWordPress.
    Site information
  9. Leave Create new database selected.
  10. Type the database administrator user name (root) and password.
    Note: This account is used to create and manage the database that is needed for WordPress.
    Application configuration
  11. Type the database user name.
    Note WordPress will use this account to access and write to the database as needed.
  12. Type the password for the database user name.
  13. Leave the default database server name, localhost.
    Application configuration (continued)
  14. You may customize the name of the WordPress database as desired.
  15. Use the WordPress key generator at http://api.wordpress.org/secret-key/1.1/ to generate four unique keys, and then copy the keys into the following fields:
    • Unique Key for Passwords
    • Unique Key for Secure Passwords
    • Unique Key for Authentication
    • Second Unique Key for Authentication
      Note: You will not be required to recall these keys later.
  16. Click Continue.
    Application configuration (continued)
  17. Click Finish.
    Installation completed
  18. Click Exit to close the Web PI 3.0.

Step 4. Complete the installation and configuration

In this step, you complete the installation.

  1. Switch to Internet Explorer.
  2. Go to your WordPress website. For example, go to http://localhost/myWordPress.
  3. In the Site Title box, type the name of your site.
  4. In the Password, twice boxes, type a password for the admin account.
    WordPress site configuration
  5. In the Your E-mail box, type the email address for the admin account.
  6. Click Install WordPress.
    WordPress site configuration (continued)
  7. Click Log In.
    WordPress site configuration completed
  8. Type admin, type the password, and then click Log In.
    WordPress login

Step 5. Enable clean URLs (Pretty Permalinks)

In this step, you enable Pretty Permalinks now that WordPress has been installed.

  1. In the Dashboard menu, click Settings.
    WordPress dashboard menu
  2. Scroll down, and then click Permalinks.
    Settings
  3. Under Common settings, select a common Permalink setting or select Custom Structure to create your own Permalink, and then click Save Changes.
    Permalink settings
  4. Click in the gray text field, press CTRL + A, and then press CTRL + C.
    Web.config file contents
  5. Start Notepad as an administrator. To do this, click Start, type notepad in the search box, right-click Notepad in the list of results, and then click Run as administrator.
    Start menu
    Run as administrator command
  6. If you are prompted by User Account Control, click Yes.
    Administrative allowance
  7. In Notepad, press CTRL + V to paste the code that you copied from the WordPress configuration page.
    Web.config file contents
  8. Click File, and then click Save As.
    Notepad Save As menu
  9. In the Save As dialog box, browse to C:\intepub\wwwroot\myWordPress.
    Note: This step assumes that you named the WordPress site myWordPress during installation. If you used a different name, use that name instead of myWordPress.
  10. In the File name box, type web.config.
  11. In the Save as type box, click All Files.
  12. Click Save, and then close Notepad.
    Save As dialog box

The installation is now complete, and you are ready to use WordPress!

Create a WordPress blog on Windows Server 2008 R2, IIS 7.5 and MySQL

I think it is fitting that my first ever post on this WordPress Blog would be about setting up a WIMP server (Windows Server 2008 R2, IIS, MySQL & PHP).

Being a former Windows Systems Administrator I wanted to keep as many components running on familiar Microsoft applications (IIS 7.5 & SQL Server 2008 R2) and found this article explaining how to do it. However, at the time of writing this article I found that the WordPress on SQL Server (wp-sqlsrv) distribution was unavailable* so the only option was to use MySQL. In retrospect I am very happy with this outcome as the process of learning about MySQL has been very enjoyable and so far has proven to be a very stable and easy-to-use database application .

* Please note that the WordPress on SQL Server (wp-sqlsrv) distribution is now available.

The Environment

  • Server: Rackspace Cloud VM running Windows Server 2008 R2
  • Web server: IIS 7.5
  • Database application: MySQL

This blog you are reading is running off the environment above. So far I have found it to be an excellent blogging platform.

Install IIS 7.5

Logically, the first step is to install the web server application, IIS 7.5. From this point onwards I will simply refer to it as IIS.  To do so, perform the folowing steps:

1. Click Start > Run then enter servermanager.msc in the Open dialogue box then click OK  to load Server Manager:

C:\>servermanager.msc

2. Once Server Manager has loaded, right-click on Roles and click Add Roles, which initiates the Add Roles Wizard:

3. Click Next in the Before You Begin section:

4. Select Web Server (IIS) on the Select Server Role section and click Next:

20120416220536

5. Select the IIS services to be installed on the Select Role Services page. Keep the defaults but also select the CGI check box under Application Development. This enables both the CGI and FastCGI services which is required to use PHP:

6. Click Next and on the Confirmation page click Install.

7. Once the installation has completed, click Start > Run and then enter inetmgr in the dialogue box then click OK to load Internet Information Services (IIS) Manager. This will fire up IIS Manager and you will see IIS running and configured according to the options you selected earlier:

For more information, this article shows how to install IIS 7.5 with default settings and this article shows how add the CGI feature as described above.

Configure IIS 7.5

We now need to configure IIS in preparation for WordPress:

8. Click Start > Run and enter CMD in the dialogue box and then click OK.

9. At the command prompt enter the following and then hit enter on the keyboard:

md C:\Websites\Wordpress

This creates the directory where the new WordPress site will be located.

10. Open IIS Manager and click on Sites.

11. Right-click on Sites and then click Add Web Site:

In the Add Web Site dialogue box enter these details:

  • Name: WordPress
  • Physical path: C:\Websites\Wordpress
  • Bindings: All Unassigned. If your server has multiple IP addresses and you want the site to listen on a specific IP address select it from the drop-down box.
  • Host name: http://www.yourdomain.name. This should contain the fully-qualified domain name for your blog site.

Once all the sections have been completed click OK. You will now see the WordPress site under the Sites folder.

12. Click on Application Pools and in the middle pane you will see an application pool named WordPress. Right-click on it and select Advanced Settings:

13. Find the setting Enable 32-Bit Applications and click the drop-down box and click True. Click OK to save the settings:

20120417065550

We will leverage the improved security in IIS 7.5 by utilising ApplicationPoolIdentity. More information about this can be found here.

14. Select the WordPress site in the Connections pane and then double-click Authentication:

15. Select Anonymous Authentication and in the Actions pane on the right side click Edit:

16. Then select Application Pool Identity and click OK:

17. Click Start > Run and then enter CMD in the Open dialogue box then click OK  to load a command prompt enter the following and hit enter:

icacls "C:\Websites\Wordpress" /grant "IIS APPPOOL\Wordpress":(OI)(CI)(RX,W)

This configures the WordPress application pool to have write permissions to the directory where the new WordPress site is located.

IIS is now configured and ready for PHP to be installed!

Install PHP 5.3.10 for Windows

WordPress uses PHP therefore it is the next component to be installed. We require a ‘Non Thread Safe’ version and facilitate the installation we will use the latest version that comes with an ‘Installer’. At the time of writing, version 5.3.10, has an Installer. To proceed, perform the following:

18. Go to http://windows.php.net/download/.  Find version 5.3.10, under VC9 x86 Non Thread Safe, click the Installer version to download it. Click here for a direct download.

19. Once downloaded, run the .msi setup file, click Next at the first screen and accept the EULA (End User License Agreement)  and then click Next again.

20. Keep the default installation directory, which is C:\Program Files (x86)\PHP:

21. At the Web Server Setup step select IIS FastCGI:

22. Install the following features also; Script Executable, Register *.php files to open automatically and PEAR Install:

23. Click Next then Install and then click on Finish to complete the setup:

Install PHP Manager 1.2

PHP Manager is a plugin for IIS that allows you to manage and configure PHP settings and installations.

24. Go to http://phpmanager.codeplex.com/ and click on ‘View all downloads’ and download and install the x64 version.

25. Open IIS Manager and in the Connections pane select the server name. In the middle pane you will see all installed features within IIS. Select and open PHP Manager:

26. Under the PHP Setup section select View Recommendations:

27. Select all of the recommendations and hit the OK button:

Install MySQL

At the time of writing, MySQL 5.5.21, is the most recent version available.

28. Go to http://dev.mysql.com/downloads/mysql/ and download the 64-bit MSI Installer and run the setup (mysql-5.5.21-winx64.msi)

29. Accept the EULA and click Next.

30. In the Choose Setup Type section select Typical and click Next:

31. In the Ready To Install MySQL 5.5 section click Install:

32. When the installation completes ensure Launch the MySQL Instance Configuration Wizard is ticked and then click Finish:

33. Select Standard Configuration as the configuration type and then Next:

34. Select Server Machine as the server type and then click Next:

35. In the Windows Options section ensure the settings match the image below:

36. In the security options section check Modify Security Settings, enter the root password of your choice and then click Next:

37. In the configuration section shown below click Execute:

38. Once the process completes click Finish:

Configure MySQL for WordPress

We will now create the database for WordPress within MySQL. We will do this via the command line client.

39. Click Start > All Programs > MySQL > MySQL Server 5.5 > MySQL 5.5 Command Line Client to open a MySQL command prompt:

40. Enter the root password you chose earlier in the MySQL setup and hit enter:

41. To create the WordPressDB database type the following and hit enter:

CREATE DATABASE WordPressDB;

You will receive a confirmation that the command was successful:

Query OK, 1 row affected (0.00 sec)

41. To create the wp_user and grant it access and requisite permissions to the WordPressDB database type the following and hit enter:

GRANT ALL PRIVILEGES ON WordPressDB.* TO "wp_user"@"localhost" IDENTIFIED BY "password";

Please note that the “;” signals the end of the command. To go to a second line just hit Enter without a “;” at the end of a line.

42. Type Exit and hit enter to exit the MySQL command line client.

The confirugration of MySQL is now complete. We should now have the following information available for the WordPress install:

  • Database Name: WordPressDB
  • Database User: wp_user
  • DB User Password: password

Install WordPress

Go to http://wordpress.org/download/ and download the latest version of WordPress (currently 3.3.1) and then folllow these steps:

43. Extract the WordPress files to the location of the WordPress site we created earlier in IIS – C:\Websites\Wordpress.

44. Navigate to C:\Websites\Wordpress and find the file named wp-config-sample.php and open it with Notepad, as per below:

45. Ammend the following fields in wp-config-sample.php with the MySQL database info we created earlier :

  • DB_NAME: WordPressDB
  • DB_USER: wp_user
  • DB_PASSWORD: password

The screen shot below shows the variables that need to be changed. This is telling WordPress which database (WordPressDB) to store the configuration data in MySQL and also the connection information (wp_user and password) to be used:

46. Save the file as wp-config.php

47. Type in the following into your browser to start the WordPress installation script:

http://www.yourdomain.com/wp-admin/install.php

Be sure to replace http://www.yourdomain.com with your domain.

48. You will now see the WordPress welcome screen:

You need to configure the following fields with your own personal information:

  • Site Title: My First WordPress Blog
  • Username: choose your username (default is admin)
  • Password: choose your password
  • Your E-mail: email@yourdomain.com

49. Click the Install WordPress button and the setup script will run and you should see the following page soon after:

20120417114254

50. Click Login to go to the Admin Login page then enter your WordPress username and password you created earlier and start blogging!