[mapserver-users] RE: port from Apache to IIS

Jessie Xu t-zheqxu at microsoft.com
Sun Apr 26 19:24:59 PDT 2009


Hi all,
Thanks for help on the mapserver configuration on IIS. Now I've figured out the way to run mapserver on IIS7 , which is quite different from the way to IIS 5&6. I made a summary below and share with you. Hope it would be helpful. :)
How to port Mapserver from Apache to IIS 7?
Base configuration

*         Windows 7

*         IIS 7.0

*         MS4W 2.3.1

*         PHP 5.2.6

*         Mapserver 5.2.1

*         MS4W was installed in D:\ms4w

Steps:
Enable FastCGI Support in IIS 7.0
Add the CGI feature by going to Control Panel-> Programs and Features -> Turn Windows features on or off.
[cid:image001.png at 01C9C721.4A0C7B70]
Install and Configure PHP
Php.ini file is located in D:\ms4w\Apache\cgi-bin. Open the file and modify settings as followed:

*         Set cgi.force_redirect = 0

*         Set cig.fix_pathinfo = 1

Configure IIS 7 to handle PHP requests
In order for IIS 7.0 to host PHP applications, it is necessary to add a handler mapping that tells IIS to pass all PHP specific requests to the PHP application framework via FastCGI protocol.

*         Open IIS Manger

*         Create a new site (eg. map)

*         select and open "Handler Mappings" under  the new site

[cid:image002.png at 01C9C721.4A0C7B70]

*         Add Script Map:

o   Request path: *.php

o   Executable: D:\ms4w\Apache\cgi-bin\php-cgi.exe



[cid:image003.png at 01C9C721.4A0C7B70][cid:image004.png at 01C9C721.4A0C7B70]



*         Edit feature permissions: click on read & script & execute

[cid:image005.png at 01C9C721.4A0C7B70]

*         Test PHP: http://localhost/phpinfo.php

If everything was setup correctly, you will see the standard PHP information page.

[cid:image006.png at 01C9C721.4A0C7B70]

Under the tree for your website, create virtual directories

*         Cgi-bin:    set local path point to d:\ms4w\apache\cgi-bin

*         Ms_tmp:     set local path point to d:\ms4w\tmp\ms_tmp

*         Tmp:    set local path point to d:\ms4w\tmp

Mapfile configuration (using gmap for testing)

*         Add a line to the mapfile: CONFIG PROJ_LIB "d:\ms4w\proj\nad\"

*         Create a virtual directory for it:  local path point to: d:\ms4w\apps\gmap\htdocs

Environment Variables

*         Go to system properties -> Advanced -> environment variables

*         Under system variables, find PATH and click edit

*         In the variable value, add D:\ms4w\Apache\cgi-bin; in it.
Ok, that's it. Try http://localhost/gmap and enjoy!

Warmest regards,
Jessie


From: Jessie Xu
Sent: Wednesday, April 08, 2009 1:19 PM
To: 'mapserver-users at lists.osgeo.org'
Subject: port from Apache to IIS

I'd like to have mapserver running on IIS 7 and want to know how? I saw an article called 'IIS setup for Mapserver' but it is written in 2005 based on IIS 5. Could someone give me a hand to figure out how to port from Apache to IIS 7? What changes should be made to config files, virtual directories and permissions, etc?

Thanks for help!

Jessie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090427/af6df169/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 45851 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090427/af6df169/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 118964 bytes
Desc: image002.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090427/af6df169/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 13498 bytes
Desc: image003.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090427/af6df169/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 32666 bytes
Desc: image004.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090427/af6df169/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 57427 bytes
Desc: image005.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090427/af6df169/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 30425 bytes
Desc: image006.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090427/af6df169/attachment-0005.png>


More information about the MapServer-users mailing list