Skip to content

Install mapserver on ubuntu 18.04 from official repository

Lennart Landsmeer edited this page Apr 28, 2020 · 5 revisions

Install the binary

The MapServer program itself consists of only one file, the mapserv binary executable. This is a CGI executable, meant to be called and run by your web server.

  1. Install the packages
sudo apt-get install apache2 apache2-bin apache2-utils cgi-mapserver \
                     mapserver-bin mapserver-doc libmapscript-perl\
                     python-mapscript ruby-mapscript libapache2-mod-fcgid
  1. enable cgi and fastcgi
sudo a2enmod cgi fcgid
  1. on Apache2 configuration file (e.g. /etc/apache2/sites-available/000-default.conf) add the following lines:
         ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
         <Directory "/usr/lib/cgi-bin/">
                 AllowOverride All
                 Options +ExecCGI -MultiViews +FollowSymLinks
                 AddHandler fcgid-script .fcgi
                 Require all granted
         </Directory>
  1. restart apache2 daemon
sudo service apache2 restart
  1. check mapserver install
  • typing from terminal:
mapserv -v 
msCGILoadMap(): Web application error. CGI variable "map" is not set.

NB

The standard repository of Ubuntu do not contains the most recent version of MapServer. To install newer version of MapServer it is better to use ubuntugis repository ubuntugis or qgis-ubuntugis:

Clone this wiki locally