I installed QGis-Server 2.14 on Ubuntu 16.04 following the instructions on this blog. The fgci
on its own is responsive and correctly replying to a GetCapabilities request like:
http://localhost/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
However, if I point the browser to a QGis project file, like:
http://localhost/cgi-bin/project/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
The response is an error:
<ServiceExceptionReport version="1.3.0">
<ServiceException code="WMS configuration error">
There was an error reading the project file or the SLD configuration
</ServiceException>
</ServiceExceptionReport>
Using directly the command line I get a different error message:
$ ./qgis_mapserv.fcgi "QUERY_STRING=SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities"
QFSFileEngine::open: No file name specified
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.
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>
The Apache logs are clean. The error log is empty and the access log is reporting nothing unusual.
Are there any other logs I can look into? Any hints on what may be causing this error(s)?
Update I: I was able to set up logging following the suggestions by elpaso66. As he expected, QGis-Server is returning a file not found error, but the file actually exists:
$ tail /tmp/qgis-000.log
[8066][15:50:44] inserting pair MAP // /usr/lib/cgi-bin/project/project.qgs into the parameter map
[8066][15:50:44] MAP:/usr/lib/cgi-bin/project/project.qgs
[8066][15:50:44] REQUEST:GetCapabilities
[8066][15:50:44] SERVICE:WMS
[8066][15:50:44] VERSION:1.3.0
[8066][15:50:44] Error, configuration file '/usr/lib/cgi-bin/project/project.qgs' does not exist
[8066][15:50:44] Checking byte array is ok to set...
[8066][15:50:44] Byte array looks good, setting response...
[8066][15:50:44] Sending HTTP response
[8066][15:50:44] Request finished in 0 ms
$ ls -la /usr/lib/cgi-bin/project/project.qgs
lrwxrwxrwx 1 root root 49 Sep 29 14:41 /usr/lib/cgi-bin/project/project.qgs -> /home/desouslu/Projects/project/project.qgs
$ ls -la /home/desouslu/Projects/project/project.qgs
-rw-rw-r-- 1 desouslu desouslu 156185 Aug 16 15:40 /home/desouslu/Projects/project/project.qgs
Update II: This ended up being an issue with permissions. On Ubuntu, folders created in the home folder by default do not have execution permissions for all. A chmod a+x
is required on the folder structure leading to the .qgs
file, otherwise Apache fails to access it.