[GIS] ” QFSFileEngine::open: No file name specified ” installing QGIS Server on Windows 2012R2

apachegdalqgis-serverwindows server 2012

I am attempting to get QGIS Server installed on a Windows 2012 R2 Server. After following the information at the https://anitagraser.com/2012/04/06/qgis-server-on-windows7-step-by-step/, and looking at other resources on StackExchange and the official QGIS Server Wiki, YouTube, and everywhere else I could find, I have managed to almost get it working.

When I attempt to access http:///qgis/qgis_mapserv.fcgi.exe? I receive a 500 Internal Server Error. I also receive in the Apache error logs:

(OS 109)The pipe has been ended.  : mod_fcgid: get overlap result error
Premature end of script headers: qgis_mapserv.fcgi.exe

When I run the qgis_mapserv.fcgi.exe binary directly, I see this output:

 QFSFileEngine::open: No file name specified 
 Content-Length: 206
 Content-Type: text/xml; charset=utf-8

 <ServiceExceptionReport version="1.3.0"
 xmlns="http://www.opengis.net/ogc">  <ServiceException code="Service
 configuration error">Service unknown or unsupported</ServiceException>
 </ServiceExceptionReport>

Now I think the cause is the first line, since the server is recognizing that it's not a valid HTTP header and hence terminating the script, but I can't figure out the cause or what I can do to make it go away.

My httpd_qgis.conf file looks like this:

LoadModule fcgid_module modules/mod_fcgid.so

DefaultInitEnv PATH "C:\OSGeo4W\bin;C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\apps\grass\grass-@grassversion@\bin;C:\OSGeo4W\apps\grass\grass-@grassversion@\lib;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
DefaultInitEnv QGIS_PREFIX_PATH "C:\OSGeo4W\apps\qgis"
DefaultInitEnv QT_PLUGIN_PATH "C:\OSGeo4W\apps\qgis\qtplugins;C:\OSGeo4W\apps\qt4\plugins"
DefaultInitEnv TEMP "C:\Users\C_Young\AppData\Local\Temp"
DefaultInitEnv PYTHONHOME "C:\OSGeo4W\apps\Python27"

#DefaultInitEnv PYTHONPATH "C:\OsGeo4W\apps\qgis\.\python;C:\OsGeo4W\apps\qgis\.\python\plugins;C:\OsGeo4W\apps\Python27\DLLs;C:\OsGeo4W\apps\Python27\lib;C:\OsGeo4W\bin;C:\OsGeo4W\apps\Python27;C:\OsGeo4W\apps\Python27\lib\site-packages"

#DefaultInitEnv GDAL_DATA "C:\OSGeo4W\share\gdal"
DefaultInitEnv GDAL_DRIVER_PATH "C:\OSGeo4W\bin;C:\OSGeo4W\bin\gdalplugins"

#DefaultInitEnv PROJ_LIB "C:\OSGeo4W\share\proj"

#DefaultInitEnv GDAL_FILENAME_IS_UTF8 YES
#DefaultInitEnv VSI_CACHE TRUE
#DefaultInitEnv VSI_CACHE_SIZE 1000000

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>

As you can see, there's a number of other commented out directives. I've tried everything I can find relative to OsGeo4W, and QGIS Server, but still to no avail. If I could just find a way to suppress the first line, I'd be happy at this point.

Best Answer

Looking at the use of Alias in my Apache.conf files on Windows, I think the following line in your code might be wrong.

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

I would have it as:

Alias /qgis/ "C:/OSGeo4W/apps/qgis/bin/"
Related Question