Skip to content

Instantly share code, notes, and snippets.

@fgianoli
Created January 7, 2020 18:18
Show Gist options
  • Save fgianoli/02504876b8643508420076aa445d8ab3 to your computer and use it in GitHub Desktop.
Save fgianoli/02504876b8643508420076aa445d8ab3 to your computer and use it in GitHub Desktop.
Install QGIS Server and LizMap
## UBUNTU 18.04
## HOW TO INSTALL QGIS SERVER
# add to /etc/apt/sources.list these lines [ sudo nano /etc/apt/sources.list ]
deb https://qgis.org/ubuntu bionic main
deb-src https://qgis.org/ubuntu bionic main
# run
sudo gpg --keyserver keyserver.ubuntu.com --recv-key 51F523511C7028C3
sudo gpg --export --armor 51F523511C7028C3 | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
#Check QGIS Server version (optional)
sudo apt-cache policy qgis-server
#Install QGIS Server
sudo apt-get install qgis-server python-qgis libapache2-mod-fcgid
#Run
a2enmod fcgid
a2enconf serve-cgi-bin
sudo a2enmod rewrite
sudo service apache2 restart
#edit file 000-default.conf [etc/apache2/sites_enable] adding these lines.
FcgidIOTimeout 120
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>
sudo service apache2 restart
#to test
http://localhost/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
### INSTALL LIZMAP WEBCLIENT
## ensure to have PHP [PHP 7.x] installed and all required extensions:
#sudo add-apt-repository -y ppa:ondrej/php && sudo apt update && apt install -y php7.2-mbstring php7.2-zip php7.2-xml
# change the extension according to your php version installed
apt-get install php-sqlite3
sudo apt-get install libsqlite3-0 libsqlite3-dev
apt-get install php7.2-sqlite3
#INSTALL LIZMAP
# move to /var/www
mkdir lizmap
apt install git
git clone https://github.com/3liz/lizmap-web-client.git
## move to /var/www/lizmap/lizmap-web-client/lizmap/install
sudo ./set_rights.sh www-data www-data
#move to /var/www/lizmap/lizmap-web-client/lizmap/var/config
#these are the settings files
sudo cp lizmapConfig.ini.php.dist lizmapConfig.ini.php
sudo cp localconfig.ini.php.dist localconfig.ini.php
sudo cp profiles.ini.php.dist profiles.ini.php
## move to /var/www/lizmap/lizmap-web-client/lizmap/install
sudo php ./installer.php
## edit apache conf
Alias /lizmap/ /var/www/lizmap/
<Directory "/var/www/lizmap/lizmap-web-client/lizmap/">
Options -Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Require all granted
</Directory>
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment