Goal was to setup latest QGIS Server LTR (2.14.x) on Windows 10 for use with Extended QGIS Web Client (EQWC). Main components needed for this are (minimum required versions):
- Apache 2.4
- PHP 5.5
- PostgresSQL 9.4
- QGIS Server LTR 2.14
Apache and PHP
Download XAMPP distribution (difference is only PHP version). For this setup we will use latest PHP and remove other options as only installing Apache and PHP.
PostgreSQL
Install desired PG version with PostGreSQL install.
QGIS Server LTR 2.14
Download 64 bit OSGeo4W installer . Choose advanced installation, from web and then select QGIS Server LTR from Web part and qscintilla from libs. Install QGIS Desktop LTR if you want also to prepare projects on this machine.
Apache configuration
Edit httpd.conf
file. In case of XAMPP you get Control Panel where it is really simple to do that.
change line:
ScriptAlias /cgi-bin/ "C:/xampp/cgi-bin/"
to:
ScriptAlias /cgi-bin/ "c:/OSGeo4W64/apps/qgis-ltr/bin/"
QGIS Server configuration
Change part:
<Directory “C:/xampp/cgi-bin”
AllowOverride None
Options None
Require all granted
</Directory>
to:
<Directory “c:/OSGeo4W64/apps/qgis-ltr/bin”>
SetHandler cgi-script
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
Require all granted
</Directory>
Cgi handler
change line:
AddHandler cgi-script .cgi .pl .asp
to:
AddHandler cgi-script .cgi .pl .exe
Variables
insert at bottom of http.conf:
SetEnv GDAL_DATA "C:OSGeo4W64sharegdal"
SetEnv QGIS_AUTH_DB_DIR_PATH "C:OSGeo4W64appsqgis-ltrresources"
SetEnv PYTHONHOME "C:OSGeo4W64appsPython27"
SetEnv PATH "C:OSGeo4W64bin;C:OSGeo4W64appsqgis-ltrbin;C:OSGeo4W64appsgrassgrass-@grassversion@bin;C:OSGeo4W64appsgrassgrass-@grassversion@lib;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem"
SetEnv QGIS_PREFIX_PATH "C:OSGeo4W64appsqgis-ltr"
SetEnv QT_PLUGIN_PATH "C:OSGeo4W64appsqgis-ltrqtplugins;C:OSGeo4W64appsqt4plugins"
That completes Apache configuration.
Test
Restart Apache server (from XAMPP Control Panel) and open a GetCapabilities request to QGIS Server
http://localhost/cgi-bin/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
You should receive standard WMS Capabilities XML response from QGIS Server.
Extra setup for Extended QGIS Web Client
Add Rewrite rules in httpd.conf
RewriteEngine On
RewriteRule ^/proxy/(.+)$ /gisapp/admin/qgisproxy.php?map=$1.qgs [QSA,PT]
RewriteRule ^/gisapp/([^.]+)$ /gisapp/index.php [PT]
Edit php.ini, enable pdo connection to postgres:
;extension=php_pdo_pgsql.dll
to
extension=php_pdo_pgsql.dll
Add GDAL_DATA system variable
Open Control Panel and under System and Advanced System settings click on Environment variables and add new System variable GDAL_DATA with value of your gdal path from OSGeo installation (for example: C:OSGeo4W64sharegdal).
This is needed for exporting data.
Restart Apache server. To finish setup of Extended QGIS Web Client go to GitHub repository and Wiki pages .