Install Joomla! on IIS

Introduction

Joomla is an open-source content management system (CMS) that lets you build Web sites and powerful online applications, such as:

  • Corporate Web sites or portals
  • Corporate intranets and extranets
  • Online magazines, newspapers, and publications
  • E-commerce and online reservations
  • Government applications
  • Small business Web sites
  • Non-profit and organizational Web sites
  • Community-based portals
  • School and church Web sites
  • Personal or family home pages

For more information about Joomla, visit the Joomla Web site.

This article describes how to install and configure Joomla for use with the FastCGI extension on Internet Information Services 7 (IIS 7) on Windows® Web Server 2008. The instructions assume that you have set up and configured the FastCGI extension and the PHP libraries. The instructions have been tested and found to work with the following software versions:

  • PHP 5.2.9
  • MySQL 5.1.34
  • Joomla 1.5.14

Prerequisites

From the base default configuration file provided by PHP, modify the following lines in your Php.ini configuration:

  • Define extension_dir as c:\php\ext (for example, the location of your php extensions directory).
  • Uncomment extension=php_mysql.dll in the extensions list to enable MySQL support.

In order for Joomla to work correctly with IIS 7, it is necessary to install an update for IIS FastCGI module for IIS 7.

Download and Unpack the Application

First, download the latest stable release of Joomla. For this article, Joomla version 1.5.14 was used (future versions are likely to be similar to install). Uncompress the Joomla files and copy them to C:\Inetpub\wwwroot\joomla (or another directory of your choosing).

Before running the Joomla installer, create the configuration file Configuration.php, which Joomla uses to store key configuration settings. Assign write permissions to it with the command (from the installation directory):

C:\inetpub\wwwroot\joomla>icacls configuration.php /grant BUILTIN\IIS_IUSRS:W

The installer will modify the Configuration.php file with information provided during the installation process.

Joomla uses the Administrator\Cache folder Tmp and therefore needs to be able to write and modify files in this folder. Grant “modify” permissions to the folder:

C:\inetpub\wwwroot\Joomla>icacls administrator\cache /grant BUILTIN\IIS_IUSRS:(OI)(CI)(M)

Joomla uses the temporary folder Tmp to store temporary files and therefore needs to be able to write and modify files in this folder. Grant “modify” permissions to the folder:

C:\inetpub\wwwroot\Joomla>icacls tmp /grant BUILTIN\IIS_IUSRS:(OI)(CI)(M)

Set Up the Database

Before starting the installation procedure for Joomla, you must create a database on your server. Also create a user and grant this user “db ownership” permission to the database. This article uses the following database information:

  • Database name: joomla
  • Database user: joomla
  • Account password: joomla

Run the Installation Script

1. Start the configuration procedure in a Web browser. Go to http://localhost/joomla/. (If the Index.php file is not in the browser default document, then add it.)

2. Select the language, and then click Next.

Figure 1: Choose Language page

3. Verify that all pre-installation checks are successful, and then click Next.

Figure 2: Pre-installation Check page

4. Review the GNU General Public License, and then click Next.

 

Figure 3: License page

5. On this page enter the following information, and then click Next.

      a. Host Name: localhost
      b. Username: joomla
      c. Password: joomla
      d. Database: joomla

Figure 4: Database Configuration page

6. On the FTP Configuration page, select the No option button (not to enable FTP file system layer), and then click Next.

Figure 5: FTP Configuration page

7. Specify the site name and the administrator password. Click Next to complete the installation.


Note: You may scroll down and install sample data if you prefer.


Figure 6: Main Configuration page

8. The Finish page appears, and you are instructed to delete the C:\inetpub\wwwroot\joomla\installationdirectory.

Figure 7: Finish page

9. You can now go to the Joomla site.

Figure 8: Joomla site

Enable Search Engine Friendly URLs

By default, Joomla uses query string parameters for all the URLs it generates for your Web site. You change this by by enabling search engine friendly URLs, a feature which relies on the URL rewriting functionality.

IIS 6.0 does not include URL rewriting capabilities; you can use a third-party URL rewriting product such as ISAPI_Rewrite or Ionics ISAPI Rewrite Filter.

IIS 7 includes URL rewriting support, which can be enabled by installing Microsoft URL Rewrite Module for IIS 7.

1. Download and install the Microsoft URL Rewrite Module.

2. If it does not already exist; create and open a Web.config file located in the C:\inetpub\wwwroot\joomla directory.

3. Paste the following XML code into this file.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Security Rule" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions logicalGrouping="MatchAny">
            <add input="{QUERY_STRING}" pattern="mosConfig_[a-zA-Z_]{1,21}(=|\%3D)" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="base64_encode.*\(.*\)" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="(\&lt;|%3C).*script.*(\>|%3E)" />
            <add input="{QUERY_STRING}" pattern="GLOBALS(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
            <add input="{QUERY_STRING}" pattern="_REQUEST(=|\[|\%[0-9A-Z]{0,2})" ignoreCase="false" />
          </conditions>
          <action type="CustomResponse" url="index.php" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
        </rule>
        <rule name="SEO Rule">
          <match url="(.*)" ignoreCase="false" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" pattern="" ignoreCase="false" />
            <add input="{URL}" negate="true" pattern="^/index.php" ignoreCase="false" />
            <add input="{URL}" pattern="(/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$" />
          </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>
      </rules>
    </rewrite>
 </system.webServer>
</configuration>

4. Save the web.config file.

5. Open a Web browser, and log on to the Joomla administrator console at http://localhost/joomla/administrator/.

6. Click on Site --> Global Configuration menu to configure SEO Settings:

1. Search Engine Friendly URLs - Yes

2. Add suffix to URLs - No

Figure 9: Global Configuration page

3. Click Apply to save the configuration.

4. Restart Windows® Internet Explorer®.

5. Go to http://localhost/joomla/. All links in Joomla pages now have URLs without query string parameters. If you click on any of these links, the server returns a correct response:

Figure 10: Links in Joomla page

 

Note: This article updates “Joomla! on IIS” by Ruslan Yakushev, published on December 12, 2008.

Links for Further Information 

Setting up FastCGI for PHP.

Using FastCGI to Host PHP Applications on IIS 7.0.

Installing PHP on Windows Vista with FastCGI.

Installing FastCGI Support On Server Core.

FastCGI forum.

PHP community forum.

Related Content

Comments

Hi there. Great tutorial.
Works great except for one thing (might be me).
If I use anchor links on the site I just get redirected to the start page.
Is it because the # character?
Would be great if anyone has a minute to se what the error I get is.
/John

Feb 10 2009 by johndriper

Hi!

Did everything above except for the Search Engine Friendly URL since I am using a development machine. Everything works fine except for the extension manager upload options. I get the following error

JFolder::create: Path not in open_basedir paths
Unable to create destination

Anyone know why?

Mario

Mar 11 2009 by abelanet

Hi!

A few minutes ago I posted an issue for which I have solved. It took me 4 days to find this even though it look stupid now that I found it.

JOOMLA is case sensitive. I found out that there are 2 files that need to have the paths as windows is displaying them. These are configuration.php in the root directory of Joomla and php.ini in the root of the PHP directory.

Make sure that any paths references are according to the case windows is displaying them. Eg Drive C is always in capital so it must be so in the both config files.

BTW I am using joomla 1.5.9 on IIS7 with mySQL 5.1.

Mario

Mar 11 2009 by abelanet

Hi!

It seems that Joomla only likes Linux/Unix. I am noticing that although I got it to work in uploading extensions it has got another issue. Joomla seperate directories uses the Unix/Web conversion / however Windows uses the \. I am noticing that this is confusing Joomla. Eg when I added the extension PHOCA GALLERY (www.phoca.cz) Joomla got confused when I added images. The first part of the directory for the images was using the Windows convension but the last part it was using the Unix convension. Sounds more fun. Has anyone got any idea of how to go around it? Mario

Mar 11 2009 by abelanet

Hello,

I have tried this but now working for me. Please check http://www.garantimagaza.com every link turns to index. Any link works properly.

Any idea?

Apr 03 2009 by ahmetkemal

JFolder::create: Path not in open_basedir paths
Unable to create destination


You receive this error when the Path is not set properly in configuration file of Joomla.

Check the configuration file and check the path. If everythng appears fine please paste the ftp information variables that are present in Joomla configuration file like:

var $ftp_enable = '0';
var $ftp_host
var $ftp_port
var $ftp_user
var $ftp_pass
var $ftp_root = '';

Also, check the tmp path(var $tmp_path)

May 13 2009 by vishweshP

I'm having the same problems as "ahmetkemal". I get the rewrite working but each link i click on brings me back to the index page. Am I missing a setting in the Microsoft URL Rewrite Module for IIS 7.0.

Also, I'm using sh404SEF..

Aug 27 2009 by kikanshathomas

I've followed the Instruction above. The urls are now shorten. Look great. But If I click on any menu link, it takes me to the front page.

Any advice please help.

Oct 23 2009 by Sophorth

Everything was done exactly as it is described here. And everything works fine even the SEF and mod_rewrite. But… The search does not work in Joomla. I can say that it finds exactly one page which has 404th number. If we turn it off everything works. But the main component of the site we offered does not work this way already.

The real trouble is that it is not a test site. We have found it not to work proper two late. It has visitors already and even some first results in search engine optimization. Not one night but a weak was spend in attempts to settle this BIG problem (also some of our components are based on the internal search).

I am not a server administrator, I am just a user of a hosing services. All I can do is just to try different web.config files (and every time I have to ask somebody to transfer .htassess file into web.config!!!).

My hosting provider simply said to me that there most likely nothing in the article above and it’s version of web.config file to make the search to work.

So, to be honest I am thinking that I’ve lost more than a month with starting my project within IIS. This system terns to be not friendly not only for users as I am but also for professionals that helped me…

Nov 03 2009 by InMast

Submit a Comment

You must Log In to comment.

Microsoft Communities