How to Install MapServer on Windows






MapServer is an open source and free software for translating vector maps to raster images and displaying it on a web page. It supports installation on Windows and Unix/Linux platform. This tutorial will cover installation guide for Windows platform, guide for Unix/Linux platform will be covered on another tutorial.

MapServer for Windows comes in a package that allow us to quickly install. It is designed to perform a full installation of Apache, PHP, MapServer CGI and MapScript in a single installation. The package was developed by MapTools.org and available for free download here. Current release package at the time of this writing is ms4w_3.0_beta7.zip, which comes with Apache version 2.2.10, PHP version 5.2.6 and MapServer version 5.2.1.

How to Install

  1. Download installation package from MapTools.org
  2. If you upgrading from older version, go to ms4w directory and run the apache-uninstall.bat file to stop and uninstall the Apache Service. Rename the old ms4w directory to something like ‘ms4w-old’.
  3. Extract ms4w_3.0_beta7.zip at the root of a drive, eg. C:. If successfull, you should get a new ms4w directory (C:/ms4w).
  4. Run apache-install.bat file under ms4w directory (/ms4w/apache-install.bat) to start and install Apache Web Server as service. This will open a cmd window that prints log messages like image shown below:
  5. Install Apache

    Install Apache

  6. To test the installation, open your Web browser and type http://localhost or http://127.0.0.1 into address bar, you should see the main ms4w page like image shown below:
  7. MS4W Page

    MS4W Page

Generated Map Image
Default MapServer generated map images are located on /ms4w/tmp/ms_tmp that available as /ms_tmp via URL (http://localhost/ms_tmp/). The absolute image URL and image path should be /ms_tmp and /ms4w/tmp/ms_tmp.

Change the Installation Directory
Default MapServer installation is at the root of a drive (eg. C:/ms4w). To change it to another location other than drive root (eg: D:/Server/ms4w), you should replace all ‘/ms4w/‘ in files listed below with your new path.

  • /ms4w/Apache/conf/httpd.conf
  • /ms4w/Apache/cgi-bin/php.ini
  • All files in /ms4w/httpd.d
  • /ms4w/setenv.bat
  • Share/Bookmark

Leave a Reply