Setup Magento on IIS

Step 1: Create a new folder called magento under C:\Inetpub\wwwroot, then copy and put all the files into that folder.

Step 2: Right-click on the newly created magento folder and click on Properties. Then, click on the Security tab. Give full permission to this folder. See below.

Step 3: Please prepare the database now using the .sql file. If you need to change any database configuration settings, please open the C:\Inetpub\wwwroot\magento\app\etc\local.xml file for editing.

Step 4: Using any database editor, please open the database table core_config_data and change two path values

path = web/secure/base_url

value = http://nazmul.asthait.com/magento/

and

path = web/secure/base_url

value = http://nazmul.asthait.com/magento/

In both cases, the value http://nazmul.asthait.com/magento/ should be changed.

Note: You should delete all the files and folders under C:\Inetpub\wwwroot\ magento \var\cache in order to prevent unwanted cache problems.  See below.

Step 5: This is the most important step for running a Magento project under IIS.

Please download ISAPI_Rewrite3_0073_Lite.msi from http://www.helicontech.com/download-isapi_rewrite3.htm

See below.

Install this software.

IIS will be automatically restarted after installation.

Verify if the installation was successful by opening up the IIS Manager. Right-click on Web Sites and select Properties. You should now have a new tab if installation was successful. See the screenshot below for reference.

ISAPI Rewrite filter has been successfully installed, but we are not done yet. Your httpd.conf file should be empty, so we need to put some rewrite rules in it. The following lines are taken from the .htaccess file in the root of your Magento installation (that is, the website’s root folder), and put into the httpd.conf file.

So click on Edit, and then you have got a chance to add the following code.

RewriteEngine on

RewriteBase /magento/

RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* index.php [L]

See the screenshot below for reference.

Now press Apply (top-left corner of the editor).

You’re done configuring the ISAPI Rewrite filter and can now run the Magento project.

3 Responses to Setup Magento on IIS

  1. Ganesh says:

    Hi, I am having a hard time getting Magento (latest v1.4.1) installed on IIS 5.1. I tried to follow your steps but without much success.

    Issues I am facing:
    1. I downloaded sample data from magento website and ran the .sql file but still no data in the table you mentioned.I could see data in other tables though.
    2. I do not see the local.xml, maybe it is created when I am able to install the magento via web.
    3. The Rewrite module is installed and I copied your code into the .conf file, after which the install wizard of magento opens up. But here there are two issues: A. Other PHP apps stop working (they work again once I say Rewriter Engine off) B. Continue button does not get enabled even if terms conditions is checked.

    My setup: XP with 5.1 IIS with FactCGI, PHP 5.3, MySql

    Can you please help me out since I would want to get it running soon?

    Thanks,
    Ghanshyam

    • nazmulb says:

      You should create a virtual website (e.g. your-domain.com) or virtual directory (e.g. http://localhost/magento) for your magento website then use this following Rewrite Condition only for that URL so that the following rules only applies for magento website not for other php/.net sites that runs on IIS.

      # Helicon ISAPI_Rewrite configuration file
      # Version 3.1.0.73

      RewriteCond %{HTTP_HOST} your-domain\.com
      RewriteEngine on
      RewriteCond %{HTTP_HOST} your-domain\.com
      RewriteBase /
      RewriteCond %{HTTP_HOST} your-domain\.com
      RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
      RewriteCond %{HTTP_HOST} your-domain\.com
      RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-l
      RewriteCond %{HTTP_HOST} your-domain\.com
      RewriteRule .* index.php [L]

      Thanks

  2. Don says:

    Perfect, thanks. Do you use any Magento modules? We used one that really helped to speed up page response times. It took a while to get 100% and function to our needs but now it’s untouchable. Saved loads on hosting by having it in a cloud. Thanks, Don.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: