Personal tools
You are here: Home Documentation How-tos

IIS Setup for MapServer/Chameleon/PhpPgAdmin

Document Actions
Some help on how to set up MapServer/Chameleon/PhpPgAdmin on Microsoft IIS (v5.0). Contains note on changes to the php.ini file and necessary changes to the MapServer mapfiles. Please contribute or make changes as required.
Windows 2000
IIS 5.0
MS4W 1.2.1
Chameleon 2.2
PHP 4.3.11
MapServer 4.7
PhpPgAdmin 3.5.4 (if using postgresql/postgis)
Postgres 8.0.3 (if using postgresql/postgis)
Postgis 1.0.3 (if using postgresql/postgis)

This setup assumes that MS4W was unzipped to form c:\ms4w\ directory.

Php.ini file:

  • session.save_path (absolute path to your tmp directory)
  • extension_dir (relative path to your php/extensions directory)
  • cgi.force_redirect = 0
  • enable the pg_sql extension (php_pgsql.dll) (for Postgresql)

Internet Services Manager

Under your website tree, create a new website (e.g. msprojects). View the properties for the new website.
  • Web Site Tab: set the IP address and under the Advanced tab put the complete Host Header name (e.g.msprojects.gc.ca).
  • Home Directory Tab:
  • -content should come from: A directory located on this computer.
    -Local Path: c:\ms4w\Apache\htdocs
    -Read access + whatever else you need
    -Execute Permissions: Scripts only
    -Configuration button - App Mappings (Add extensions .php and .phtml, Executable is c:\ms4w\Apache\cgi-bin\php.exe,select All verbs, Script Engine, and check that file exists
  • Documents Tab: Add index.phtml and index.html
  • Directory Security Tab: Anonymous access amd authentication control: Select Anonymous access and the edit button should indicate the IUSR_ account
  • Server Extensions Tab: Enable authoring is selected and client scripting says Javascript

Under the tree for your new website - add virtual directories for:

  • cgi-bin - under Properties, virtual directory tab Local Path should point to c:\ms4w\apache\cgi-bin. Select Read. Execute Permissions should say "scripts and executables"
  • ms_tmp - Under Properties, virtual directory tab Local Path should point to c:\ms4w\tmp\ms_tmp. Select Read, Write. Execute Permissions should say "scripts only". This is where temporary images are written to so in the File system Security tab (use windows explorer), the c:\ms4w\tmp\ms_tmp directory should have permissions set for the Internet Guest Accounnt (Read and execute, Read, Write, List Folder Contents).
  • tmp -Under Properties, virtual directory tab Local Path should point to c:\ms4w\tmp. Select Read, Write. Execute Permissions should say "scripts only". This is where chameleon writes sessions to so in the File system Security tab (use windows explorer), the c:\ms4w\tmp directory should have permissions set for the Internet Guest Accounnt (Read and execute, Read, Write, List Folder Contents).
  • chameleon -Under Properties, virtual directory tab Local Path should point to C:\ms4w\apps\chameleon\htdocs. Select Read. Execute Permissions should say "scripts only". Under the Chameleon tree, you can add virtual directories for admin (c:\ms4w\apps\chameleon\admin\htdocs), samples (c:\ms4w\apps\chameleon\samples\htdocs), cwc2 (c:\ms4w\apps\chameleon\cwc2\htdocs)
  • phppgadmin - (if using postgresql/postgis) Under Properties, virtual directory tab Local Path should point to C:\ms4w\Apache\htdocs\phpPgAdmin. Select Read, Write. Execute Permissions should say "scripts and executables". Under Documents - add index.php. Please note that We had to unzip the phppgadmin package into this directory in order to get phppgadmin to show us the login page at http://yourserver/phppgadmin/index.php. You might want additional security on this directory.
  • gmap -Good for testing purposes. Remember to change your mapfiles as discussed in Mapfiles for IIS below. Under Properties, virtual directory tab Local Path should point to C:\ms4w\apps\gmap\htdocs. Select Read. Execute Permissions should say "scripts only".

Test PHP:

In a command line window, navigate to c:\ms4w\apache\cgi-bin and run php -i. This should return the output that the phpinfo() function returns. I got an error about how it couldn't find ntwdblib.dll. I found this in c:\ms4w\apache\php\dlls and I copied it to the cgi-bin directory.

Mapfiles for IIS:

  • Add a config line to the MAP level of the mapfile:
    CONFIG PROJ_LIB "path/to/proj/nad/"
    e.g. CONGIG PROJ_LIB "c:\ms4w\proj\nad\"

  • change the IMAGEPATH to be an absolute path to your tmp/ms_tmp folder
    e.g. IMAGEPATH "c:\ms4w\tmp\ms_tmp"

Configuration files:

For Chameleon:
C:\ms4w\apps\chameleon\config\chameleon.xml
C:\ms4w\apps\chameleon\config\cwc2.xml

For phppgadmin: (if using postgresql/postgis)
C:\ms4w\apps\phpPgAdmin\conf\config.inc.php

This How-to applies to: MapServer 4.6

by Debbie Pagurek last modified 2005-12-12 13:16
Contributors: Debbie Pagurek

WORKS FOR THE LATEST VERSION OF MS4W?

Posted by jose luis romero lagos at 2006-10-13 17:58
This works for the lates version of MS4W, because it's php5?

about advance version of ms4w

Posted by Goutam Kumar Giri at 2007-01-15 05:50
send me the iis setup for the advance version of ms4w and other software like chameleon,phppgadmin because the old versions are not available in the net.

Using PHP CGI Processor

Posted by Dewald Troskie at 2007-01-30 07:24
The HOWTO specifies to use the PHP.exe file (for PHP5 binaries). This is a CLI binary, not a CGI binary. For Mapserver to run under IIS, use the PHP-CGI.exe file instead when defining your virtual directory. A reference to this can be found at http://www.php.net/manual/en/install.windows.iis.php under the "Windows NT/200x/XP and IIS 4 or newer" section.

Long to see

Posted by Jedi at 2007-07-26 06:58
The article is too difficult to know! Anyone write more easier.
Thanks!

Powered by Plone