Skip to content

Instantly share code, notes, and snippets.

@elemoine
Created August 30, 2019 06:04
Show Gist options
  • Save elemoine/1b582417813152b6d17850688eb89d31 to your computer and use it in GitHub Desktop.
Save elemoine/1b582417813152b6d17850688eb89d31 to your computer and use it in GitHub Desktop.
Apache mod_fcgid configuration for QGIS Server
<VirtualHost *:80>
DocumentRoot /home/www/qgis-server
ServerName 172.16.0.162
ErrorLog ${APACHE_LOG_DIR}/qgis-server-error.log
LogFormat "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"" custom
CustomLog ${APACHE_LOG_DIR}/qgis-server-access.log custom
FcgidMaxRequestsPerProcess 1000
FcgidInitialEnv QGIS_SERVER_LOG_FILE /tmp/qgis-000.log
FcgidInitialEnv QGIS_SERVER_LOG_LEVEL 2
RewriteEngine on
RewriteRule "^/qgis/project1$" "/qgis?MAP=/home/qgiserver/project1.qgs" [QSA]
<Location "/qgis">
SetHandler fcgid-script
Options +ExecCGI
FcgidWrapper /usr/bin/qgis_mapserv.fcgi virtual
Require all granted
</Location>
RewriteRule "^/qgis/project2$" "/qgis?MAP=/home/qgiserver/project2.qgs" [QSA]
<Location "/qgis">
SetHandler fcgid-script
Options +ExecCGI
FcgidWrapper /usr/bin/qgis_mapserv.fcgi virtual
Require all granted
</Location>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment