This are updated instructions from November 2017! Enterprise DB Stack Builder does not contain Apache+PHP anymore so XAMPP is used, read more below!

Tested also on Windows Server 2012!

Update 2017-11-16
Using XAMPP to install Apache+PHP

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):

  1. Apache 2.4
  2. PHP 5.5
  3. PostgresSQL 9.4
  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.


Test for 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.

ScriptAlias

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:\OSGeo4W64\share\gdal"
SetEnv QGIS_AUTH_DB_DIR_PATH "C:\OSGeo4W64\apps\qgis-ltr\resources"
SetEnv PYTHONHOME "C:\OSGeo4W64\apps\Python27"
SetEnv PATH "C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis-ltr\bin;C:\OSGeo4W64\apps\grass\grass-@grassversion@\bin;C:\OSGeo4W64\apps\grass\grass-@grassversion@\lib;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem"
SetEnv QGIS_PREFIX_PATH "C:\OSGeo4W64\apps\qgis-ltr"
SetEnv QT_PLUGIN_PATH "C:\OSGeo4W64\apps\qgis-ltr\qtplugins;C:\OSGeo4W64\apps\qt4\plugins"

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:\OSGeo4W64\share\gdal).
This is needed for exporting data.

 

Restart Apache server. To finish setup of Extended QGIS Web Client go to GitHub repository and Wiki pages .