Providing geoscience data globally Navigation
Main content
Bottom links


Home > How to serve a OneGeology WMS > Setting up a MapServer WMS > Using the GISInternals packages for Windows

4.4.3 Using the GISInternals packages for Windows

The most recent versions of the GISInternals GDAL and MapServer packages are available online at:

In most instances we would recommend using the MS4W packages to install Apache and MapServer to give youself a Windows implementation of MapServer, but in some instances, for example if you want the latest version of MapServer or if you want to use 64-bit software, you can alternatively use one of the GISinternals packages for your MapServer service.

In this section we will assume you are familiar with configuring a MS4W service and just provide some notes to assist you configure this alternative MapServer on Windows service using Apache-HTTP as your web server.

First install your web server

The first thing to note is that you will need to install your server software (such as Apache-HTTP) separately, as it is not included with GISInternals.

You may get the previous versions (that is, up to version 2.2.n) of Apache-HTTP for Windows (32 bit), from the Apache HTTP server project site:

If instead you want to use the latest stable release of Apache-HTTP, that is the version 2.4.n releases (latest is currently 2.4.4), you must instead go to the Apache Lounge site: There are several options here both in server architecture (32 bit and 64 bit), and server functionality, for you to choose from to fit your needs.

For the purposes of this example we have selected a 64 bit package from Apache Lounge and installed it to our C:\ drive as C:\Apache24\ .

Installing a GISInternals package

Once you have a working web service installed, you now need to obtain the corresponding GISInternals binaries, for example in this case we downloaded the zip file, and unzipped onto our C:\ drive as C:\apps\gisinternals\ .

Now we must run the SDKShell.bat batch file to set up some environment variables, for example it adds the following locations to the system PATH:

  • C:\apps\gisinternals\bin;
  • C:\apps\gisinternals\bin\gdal\python\osgeo;
  • C:\apps\gisinternals\bin\proj\apps;
  • C:\apps\gisinternals\bin\gdal\apps;
  • C:\apps\gisinternals\bin\ms\apps;
  • C:\apps\gisinternals\bin\gdal\csharp;
  • C:\apps\gisinternals\bin\ms\csharp;
  • C:\apps\gisinternals\bin\curl;

The MapServer executable file (mapserv.exe) is found in the C:\apps\gisinternals\bin\ms\apps folder. As ever, you can check the version by using the -v option in a command window like:

c:\apps\gisinternals\bin\ms\apps>mapserv.exe -v

Configuring your service


You may put your OneGeology data for your service (and the map file etc) anywhere on your server, but here we will follow the same pattern as we have for used for the MS4W services. In this case we have extracted the exemplar shapefile data to a location on our D:\ drive as:

  • D:\WxS\ms\apps\cookbookExemplars\BGS_Bedrock_and_Superficial_Geology
    • data (folder)
    • templates (folder)
    • wwwroot (folder)
    • (file)
    • ICSClasses.txt (file)

You will need to make a few change to the map file from the downloaded exemplar file. For example you will need to tell MapServer where to find the proj files so that you can reproject your data. You do this by adding a CONFIG statement at the top of the map file like:

    CONFIG "PROJ_LIB" "C:/apps/gisinternals/bin/proj/SHARE"
You will also need to change the IMAGEPATH statement to point at your chosen temporary file location (within the WEB section of the map file) like:
# Start of WEB interface definition (including WMS enabling metadata)
        HEADER "templates/query_header.html"
        FOOTER "templates/query_footer.html"
        IMAGEPATH "D:/WxS/ms/out/tmp/"
        IMAGEURL "/ms_tmp/"

MapServer cgi-bin

For this installation we will now create some folders in the Apache-HTTP cgi-bin folder to hold our copy of the mapserv.exe executable (which we will rename as ‘wms’) as:

  • C:\Apache24\cgi-bin (folder)
    • exemplars (folder)
      • BGS_Bedrock_and_Superficial_Geology (folder)
        • wms (file)

At this stage you will have a working MapServer service such that a request like the below (where we also specify the ‘map’ variable explicitly) will give you a GetCapabilities reponse document.


httpd.d configuration files

For this installation we will now create a httpd.d folder on our D:\ drive, to hold our OneGeology service configuration files, as: D:\WxS\ms\httpd.d\ , and create an http_ file (i.e. ‘httpd_BGS_Bedrock_and_Superficial_Geology_Exemplar.conf’) for our exemplar service as below.

# Note: Alias is one line in the file, but split here to make the page easier to read... 
Alias /BGS_Bedrock_and_Superficial_Geology_Exemplar/ 
<Directory "D:/WxS/ms/apps/cookbookExemplars/BGS_Bedrock_and_Superficial_Geology/wwwroot/">
    AllowOverride None
    Options FollowSymLinks Multiviews
    Require all granted
# Note: SetEnvIf is one line in the file, but split here to make the page easier to read... 
SetEnvIf Request_URI "/cgi-bin/exemplars/BGS_Bedrock_and_Superficial_Geology/wms"
  MS_map file=D:/WxS/ms/apps/cookbookExemplars/BGS_Bedrock_and_Superficial_Geology/

Note, that there is a change in the way access permissions are handled between versions 2.2.n and 2.4.n of Apache, so if you are copying the existing MS4W httpd_ conf files you will need to change your <Directory> information; that is, you will need to replace the ‘Order allow,deny’ and ‘Allow from all’ directives with ‘Require all granted


Finally you will need to add some information to the Apache-HTTP server configuration file (C:\Apache24\conf\httpd.conf) as per the below snippets.

<IfModule alias_module>
  # Alias: Maps web paths into filesystem paths and is used to
  # access content that does not live under the DocumentRoot.

  Alias /ms_tmp "D:/WxS/ms/out/tmp" 

  # ScriptAlias: This controls which directories contain server scripts. 
  # ScriptAliases are essentially the same as Aliases, except that
  # documents in the target directory are treated as applications and
  # run by the server when requested rather than as documents sent to the
  # client.

  ScriptAlias /cgi-bin/ "C:/Apache24/cgi-bin/"
<Directory "C:/Apache24/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
# Parse our MapServer Apache conf files
Include D:/WxS/ms/httpd.d/httpd_*.conf

Section last modified: 27 June 2013