Introduction
Drupal is a free software package that allows an individual or a community of users to easily publish, manage and organize a wide variety of content on a website. Its built-in functionality, combined with dozens of freely available add-on modules, enables features such as:
- Content Management Systems
- Blogs
- Collaborative authoring environments
- Forums
- Peer-to-peer networking
- Newsletters
- Podcasting
- Picture galleries
- File uploads and downloads
and much more.
This article describes how to install and configure Drupal to run on Windows with IIS 6.0 and IIS 7.0. The article assumes that you have completed the setup and configuration steps necessary for running PHP applications on IIS 6.0 or IIS 7.0.
The following instructions have been tested and found to work on the following configuration:
- Windows Server 2008 Web Edition
- IIS 7.0
- PHP 5.2.6
- MySQL 5.0
- Drupal 6.
Notes on PHP setup
Drupal does not require many modifications beyond the default configuration provided by PHP. From the base configuration file provided by PHP, you only need to modify the following lines in your php.ini configuration file to get Drupal working:
- Define 'extension_dir' as 'c:\php\ext' (i.e., the location of your php extensions directory)
- Uncomment 'extension=php_mysql.dll' in the extensions list to enable MySQL support
Prerequisites
In order for Drupal to work correctly with IIS 7.0 it is necessary to install an update for IIS FastCGI module for IIS 7.0. More information about the update is available here.
Download and unZip Drupal
Find the the latest release of Drupal at http://drupal.org/. The instructions in this document are based on version 6.4, but future versions are likely to be very similar as far as installation is concerned. After downloading the zip package, extract its contents to C:\Inetpub\wwwroot\drupal or another directory of your choosing.
Grant write permissions on configuration file
Drupal comes with a default.settings.php file in the sites\default directory. Before running the installer you need to copy this file to "settings.php" and give the web server write privileges to the new file. (NOTE: do not rename the default file, copy it instead. Drupal needs the default.settings.php file to exist.) Drupal's installer will modify the settings.php file as needed with the details you provide during the installation process.
After creating the new file you can assign write permissions to it with the command (from the installation directory):
C:\inetpub\wwwroot\Drupal>icacls sites\default\settings.php /grant BUILTIN\IIS_IUSRS:(M)
Drupal should set the file permissions back to read-only once the installation is done. You should make sure this is the case and manually change it yourself if it didn't happen. You can use the following command for that:
C:\inetpub\wwwroot\Drupal>icacls sites\default\settings.php /reset
Create the "files" folder and grant write permissions
Drupal uses the sites\default\files directory to store temporary files. Because of that it needs to be able to write and modify files in this folder. To enable that, create a files folder:
C:\inetpub\wwwroot\Drupal>md sites\default\files
Grant modify permissions to this folder:
C:\inetpub\wwwroot\Drupal>icacls sites\default\files /grant BUILTIN\IIS_IUSRS:(OI)(CI)(M)
Set up the database
Before starting the installation procedure for Drupal, create a database on your server. Also create a user and grant this user db ownership permission to the database. Follow the instructions in the Setting Up a Database for a PHP Application on IIS article for a MySQL database. This walkthrough uses the following database information:
- Database Name: 'drupal'
- Database User: 'drupal'
- Account Password: 'drupal'
Run the installation script
To start the installation, open web browser and request http://localhost/drupal/. This will bring up the first page of the installation script:

Click on "Install Drupal in English". If all the prior configuration steps were completed successfully then the "Verify requirements" step will succeed and you will be taken to the "Set up database" step:

On this page enter the following:
- Database name: drupal
- User name: drupal
- Password: drupal
Click "Save and continue". The necessary database tables will be created and the configuration will be saved into the sites\default\settings.php. After this step you should remove the "Modify" permissions on this file.
Enter the required configuration information on the "Configure Site" page:

Enabling Clean URLs
By default Drupal uses query string parameters for all the links URLs it generates for your web site. This behavior can be changed by enabling what is called "Clean URLs". However, this feature relies on the URL rewriting functionality to be available on the web server. IIS 6.0 does not have URL rewriting capabilities, so you could use one of the third party URL rewriting products, such as ISAPI_Rewrite or Ionics ISAPI Rewrite Filter. IIS 7.0 has URL rewriting support, which can be enabled by installing Microsoft URL Rewrite Module for IIS 7.0. The following instructions describe how URL Rewrite Module for IIS 7.0 can be used to enable Clean URLs in Drupal.
First, you will need to download and install Microsoft URL Rewrite Module. Once it has been installed, create and open a web.config file located in C:\inetpub\wwwroot\drupal folder. Paste the following XML code into this file.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Drupal Clean URLs" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?q={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Save the web.config file and then open web browser and point it to http://localhost/Drupal/index.php?q=admin/settings/clean-urls.

Use this page to enable Clean URLs and then click on "Save configuration". If the URL format has been changed successfully you will see that all the URLs are represented in a hierarchical form that does not use query string parameters, e.g. http://localhost/Drupal/admin/settings/clean-urls.
Getting More Information
To discuss the FastCGI and URL Rewrite Module specific questions, or file bug reports, please use these forums:
To get more information regarding running various PHP applications on IIS, refer to:
Comments