I followed instructions at http://www.mapserver.org/installation/unix.html but it didn't work well.

My system is ubuntu 14.04 and I'm a total rookie when it comes to unix/compiling/working with the terminal

First Question: Is there a functioning script which can be executed in the terminal? ( I don't know c - compiling well and don't know how to get all required packages)

All I did so far is set up the Apache2. When I browse localhost with Firefox, I get the "Apache2 Ubuntu Default Page".

Second Question: I want to make a mapserver and a mapclient as WMS-server which is based on geotiff and shapefiles.

Where can I find information to get things started?

  • 1
    I think it should be divided into two separate questions Sep 3 '14 at 13:40

In order to install the MapServer in Ubuntu 14.04 after you have installed Apache2, it is good to install php5:

sudo apt-get install php5

After that you can install the available in the repositories version of the MapServer by executing:

sudo apt-get install cgi-mapserver mapserver-bin php5-mapscript

However, the available version in the Ubuntu repository is not the latest one. In order to get the latest one you should add the ubuntugis-unstable repository and then run the install:

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get install cgi-mapserver mapserver-bin php5-mapscript

Don't forget to check or set the correct permissions for the /var/www directory. You can set the permissions like that:

sudo adduser Your_User_Name_Here www-data 
sudo chown Your_User_Name_Here:www-data -R /var/www 
sudo chmod 0755 -R /var/www

Now, you just have to enable CGI and restart the Apache2 service:

sudo a2enmod cgi && sudo service apache2 restart

In order to verify the installation you can check if the MapServer is presented in the phpinfo() output:

touch /var/www/html/info.php
echo '<?php phpinfo(); ?>' >> info.php

Navigate to http://localhost/info.php and search for the MapServer row in the table to verify the installation.

For the second question, you can follow the MapServer documentation WMS Client that is quite complete and sufficient to get you started.

  • I get a mistake at "sudo apt-get install cgi-mapserver mapserver-bin php5-mapscript" It says: E: Unable to locate package cgi-mapserver-bin. Do I have to download it under Github and save it somewhere?
    – steveomb
    Sep 3 '14 at 14:27
  • @steveomb No, you don't have to download anything. Mapserver is available in the Ubuntu universe packages. You can check your spelling, execute sudo apt-get update, ` apt-cache search cgi-mapserver` or apt-cache policy cgi-mapserver. If any of this don't give you a clue for the error, open another thread.
    – hdt
    Sep 3 '14 at 18:51

It's been a long time since I last compiled MapServer, but usually all you had to do was:

./make install

'configure' basically evaluates what libraries are installed on your machine and creates a 'make file'. 'Make' then compiles the mapserv executable.

To serve shapefiles and tifs I think you need the gdal library, so you may have to install or compile that manually.

It may also be worth to take a look at UbuntuGIS (https://wiki.ubuntu.com/UbuntuGIS), it has packages for mapserver and gdal already that you can just install.


Not the answer you're looking for? Browse other questions tagged or ask your own question.