GEOSS Banner

Section 4.3.1: Offering a DXF file with mapserver WFS

4.3.1 Offering a DXF file with mapserver WFS Step 1: MapServer Installation

MapServer is an Open Source project which can be installed from several Windows Installers. In this tutorial we are going to describe two different installers: OSGeo4W and MS4W. In both cases a step by step explanation is done, while specifying requirements of the system and common errors during the installation.

Other documentation of interest:

• MapServer

• Introduction to MapServer:

• Mapfile Reference:

• Data Input in MapServer:

• OGC Support in MapServer:

A. Installation of mapserver with MS4W

Download MS4W

1. Download the version available at of the Set up exe installer: ms4w-3.0.3-setup.exe


A. Installation of the MS4W

2. To install the MS4W .zip file, use a compression program (e.g. WinZip) to extract the package at the root of a drive, e.g., drive C:. If successful, you should have a new directory named 'ms4w' at the root of the drive you chose (e.g. C:/ms4w).

Start your MS4W Apache Web Server by running /ms4w/apache-install.bat (at the command line or by double-clicking it). This file installs Apache as a Windows service (called "Apache Web Server") so that it starts whenever your machine is restarted. When executed, a DOS window should pop up with the following message:

Installing the Apache MS4W Web Server service
The Apache MS4W Web Server service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service
can be started.
The Apache MS4W Web Server service is starting.
The Apache MS4W Web Server service was started successfully.

This means that Apache is running and installed as a service.

The window “Setup: License Agreement” will appear. Read the license agreement and click I Agree.


3. An “Installation Option” windows will open. Select your installation options.


After selecting your installation options click “Next”.

4. When the “Installation Folder” opens, you must specify the location to install the MS4W. Usually this is set to the root directory (C:). Then click “Next”.


5. Set the Apache port. The port you set doesn’t have to be already in use. If you think that the port 80 might be already in use then try a higher port number (above 1024) such as 8081. Click “Install”.



A downloading window will show the progress of the installation.






6. There are two options to verify that the mapserver is correctly installed, one way would be that on the MS4W-Shell DOS window type mapserv –v. The DOS window should show the following message:



Another way to verify if mapserver is installed is by browsing to the localhost, and then the following page should be seen:


If you want to install more programs, they have to be downloaded into the root of the ms4w directory.



Not that in both cases there are no addon packages installed into your localhost. If you want to install new applications these should be downloaded from Mapserver web page, and save the new application to the root directory were the mapserver is installed, as accept to replace the files you have for the new ones.


B. Installation with OSGeo4W

OSGeo4W is an installer for the Windows operating system that contains several packages related to the Open Source Geospatial Foundation.



OSGeo4W is a Windows installer that downloads and/or updates MapServer, add-on applications, and also other Open Source geospatial software. The following steps illustrate how to use OSGeo4W:

Download OSGeo4W

1. Download OSGeo4W

Download OSGeo4W Installer from:

2. Start the OSGeo4W Installer

2.1Execute (double-click) the ‘osgeo4w-setup.exe’, and a new window should openChoose an option on this new window.




Choose an option on this new window.

- The “Express Desktop Install” option contains options for higher-level packages such as MapServer, GRASS and u-Dig.

- The “Express Web-GIS Install” option, can be a basic option

- The “Advanced Install” gives you full access to choosing command line tools and applications for MapServer that are not included in the Express installation.

Once you have one of the options installed, all other options or packages can be updated or downloaded afterwards. It will be explained later on this tutorial.

2.2 On this new window choose the “Advanced Install” option.

A new window will open, choose the Download Source and click “Next”.


Select the root directory where the program will be installed.


Next window that appears has it set by default by the

Firefox. We change it to the desired one.


Select your internet connection.


2.3 Select the packages to install


On this page, you can click into each of the Default texts. For example, when clicking on the “Web Default” text, a drop-down menu will open indicating which Web’s sub-packages are going to be installed by default. You can also click on the “skip” text besides the sub-package name (such as MapServer) to install a package that by default would not be installed.


Note: If the Selected package option is left with the Skip text on, this will mean that the installation of that package will not be done. To select a package, you have to click on the Skip text to obtain:


You can see that the size of the package vary depending on the option you set up.

After setting up which packages you want to install, a new window opens. On the “Create Icons” window you have to select one or both options offered.


2.4 Download Packages/Installation


The installer should now automatically fetch and install MapServer and all of its libraries from the OSGeo download server.

2.5 Finish Installation

Once downloading and installation from the OSGeo download server is complete, you can now optionally choose to creat shortcuts for OSGeo4W on your desktop, and also in your Start Menu (both are recommended). Click the “Finish” button to finalize the installation.

2.6 To verify that MapServer installation is working You can verify that MapServer is installed through several ways.

To run the program firstly you need to open the OSGeo4W Shell that you will find on:

Start/OSGeo4W/OSGeo4W Shell


It can be also available as a shortcut in your computer

Note: The fist time you try to run the OSGeo4W Shell, you may need to browse to your Shell in order to open it. Comprovar la manera que diu el tutorial descarregat….

Secondly, you need to run the apache-install.bat script to install the Appache Service. This will be ran through the OSGeo4W shell (DOS window)

Access to the

Note: Be aware that if you have changed the default port number during the installation process you will then have to access to the

To verify that MapServer is working, go to . This page should appear. Step 2: Setup a DXF file in MapService Open the OSGeo4W Shell

In order to set up a DXF file with mapserver, you first need make sure that the GRASS package has been installed when installing the mapserver. This can be easily done by accessing to the (or your mapserver home page), if GRASS is installed, you should see it on the list of packages. Otherwise, you should go to the step 2. Installatiojn, and select the package on the step 2.3.

Ones installed open the OSGeo4W Shell

Run the apache-install.bat script in the OSGeo4W Shell

On your “All Programs”, under the OSGeo4W it should also have a quick link to GRASS.

To have more information on GRASS, please go to and Step 3: Test your WFS Service in clients

Accessing the service

1. Start uDig, under the File menu select New > New Map to create a new map.

2. Make sure your local GeoServer is started and ready to go.

3. Select Layer > Add

4. This will bring up a Wizard allowing you to choose which Data source you want to use.. Select Web Feature Server.

5. This open a window where you have to insert the URL of a web feature server you want to access. In our case type: http://localhost:8080/geoserver/wfs? and click Next.

6. You have now access to all WFS layers available on our Mapserver, press the Finish button. The layer will be drawn on your map. Step 6: Optimizing the service performance and maintenance

Information regarding optimization can be found in Step 7: Service errors and troubleshooting

Common errors can be found in

<<Prev T.O.C.  Next>>

Files (0)

You must login to post a comment.