-
-
Notifications
You must be signed in to change notification settings - Fork 374
Install mapserver on ubuntu 18.04 from official repository
Lennart Landsmeer edited this page Apr 28, 2020
·
5 revisions
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.
- 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
- enable cgi and fastcgi
sudo a2enmod cgi fcgid
- 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>
- restart apache2 daemon
sudo service apache2 restart
- check mapserver install
- typing from terminal:
mapserv -v
- on the browser for cgi script http://localhost/cgi-bin/mapserv?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities that normally return the following message:
msCGILoadMap(): Web application error. CGI variable "map" is not set.
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: