[GIS] QGIS Server 2.8 on Windows Server 2012

apacheqgisqgis-serverwindows server 2012

I'm attempting to install QGIS Server 2.8 on Windows Server 2012 R2. I've followed the instructions here and here. I've moved all the dlls from OSGeo4W to SysWOW64 for completeness' sake. I'm still getting a the following 500 error when I attempt to use GetCapabilities:

[Tue Mar 03 11:30:13 2015] [warn] [client 127.0.0.1] (OS 109)The pipe has been ended.  : mod_fcgid: get overlap result error
[Tue Mar 03 11:30:13 2015] [error] [client 127.0.0.1] Premature end of script headers: qgis_mapserv.fcgi.exe

When I attempt to run qgis_mapserv.fcgi.exe directly from bin, I get this message:

The program can't start because qscintilla2.dll is missing from your computer. Try reinstalling the program to fix the problem. 

My httpd_qgis.conf is:

LoadModule fcgid_module modules/mod_fcgid.so

SetEnv PATH "C:\OSGeo4W\bin;C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\apps\grass\grass-6.4.4\bin;C:\OSGeo4W\apps\grass\grass-6.4.4\lib;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
SetEnv QGIS_PREFIX_PATH "C:\OSGeo4W\apps\qgis"
SetEnv QT_PLUGIN_PATH "C:\OSGeo4W\apps\qgis\qtplugins;C:\OSGeo4W\apps\qt4\plugins"
SetEnv TEMP "C:\Users\ADMINI~1\AppData\Local\Temp\3"

Alias /qgis/ C:\OSGeo4W/apps/qgis/bin/

<Directory "C:\OSGeo4W/apps/qgis/bin/">
    SetHandler fcgid-script
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>

Can anybody help me out with this error?

Best Answer

Your PYTHONPATH environment variable must be specified. QGIS Server 2.8 deals with Python extension and you must provide it a good environment.

Here is my httpd.conf

Alias /qgis/ "C:/OSGeo4W64/apps/qgis/bin/"  

FcgidInitialEnv PATH "C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\grass\grass-6.4.3\lib;C:\OSGeo4W64\apps\grass\grass-6.4.3\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\WBem"
FcgidInitialEnv QT_PLUGIN_PATH "C:\OSGeo4W64\apps\qgis\qtplugins;C:\OSGeo4W64\apps\Qt4\plugins"
FcgidInitialEnv PYTHONHOME "C:\OSGeo4W64\apps\Python27"
#FcgidInitialEnv PYTHONPATH "C:\OSGeo4W64\apps\qgis\.\python;C:\OSGeo4W64\apps\qgis\.\python\plugins;C:\OSGeo4W64\apps\Python27\DLLs;C:\OSGeo4W64\apps\Python27\lib;C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\Python27;C:\OSGeo4W64\apps\Python27\lib\site-packages"

SetEnvIf Request_URI ^/qgis QGIS_PREFIX_PATH "C:\OSGeo4W64\apps\qgis"
SetEnvIf Request_URI ^/qgis TEMP "C:\Windows\Temp"

SetEnvIf Request_URI ^/qgis GDAL_DATA "C:\OSGeo4W64\share\gdal"
SetEnvIf Request_URI ^/qgis GDAL_DRIVER_PATH "C:\OSGeo4W64\bin"
SetEnvIf Request_URI ^/qgis PDAL_DRIVER_PATH "C:\OSGeo4W64\bin"
#SetEnvIf Request_URI ^/qgis GDAL_SKIP "JP2ECW"
SetEnvIf Request_URI ^/qgis PROJ_LIB "C:\OSGeo4W64\share\proj"

<Directory "C:/OSGeo4W64/apps/qgis/bin/">
    SetHandler fcgid-script
    #SetHandler cgi-script
    Options ExecCGI
    AllowOverride all
    Order allow,deny
    Allow from all
    Satisfy any  
</Directory>

My QGIS Server is now working. Hope yours will work too

Related Question