This question is similar as this one QGIS Server not working (problem with fast CGI), but with more details:

I installed the latest QGIS from trunk on Linux (Ubuntu 11.04) in the non-default location '/usr/local/qgis/'. I installed apache2 from the repository.

Next,I followed the steps outlined in this post on Linfiniti's blog (http://linfiniti.com/2010/08/qgis-mapserver-a-wms-server-for-the-masses/), but probably I did not understand the part about telling apache about the library path for my CGI; where do I add the ScriptAlias code to?

I created a qgis project with two vector (shapefiles). Under WMS server tab of the project properties I checked 'service capabilities' and gave the title 'trial'. I copied the qgs project file to the /usr/lib/cgi-bin/VECEA directory.

Trying http://localhost/cgi-bin/VECEA/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities in the browser gets me the 'capability' xml file. It contains the user information, but there is no information on the data layers (the qgis project has two shapefile vector layers) and the bounding box is not defined (all set at 0), is that right (I did define an 'advertised extent' in the qgis project under the WMS tab)

In QGIS I can connect to the server. However, it just gives me one row with the name of the project (ID 0), whereas I would expect it to show the two vector layers that were part of the project. When adding the layer, it is empty.

Edit: and now it stopped working altogether. When trying the getCapabilities, I am getting a 500 Internal Server error. Looking in the apache2 error log I am finding the following:

[Tue Sep 27 20:53:03 2011] [error] [client] Premature end of script headers: qgis_mapserv.fcgi /usr/lib/cgi-bin/VECEA/qgis_mapserv.fcgi: error while loading shared libraries: libqgis_core.so.1.8.0: cannot open shared object file: No such file or directory

Edit: Got the 'getCapabilities' part to work again. In http://lists.osgeo.org/pipermail/qgis-user/2011-March/011549.html, it was suggested to add LD_LIBRARY_PATH to /etc/apache2/mods-> enabled/fcgi.conf, adding the line "DefaultInitEnv LD_LIBRARY_PATH /usr/local/qgis_git/lib". Only, I had to edit '/etc/apache2/mods-available/fcgid.conf'

Still stuck with no layers showing when connecting to the server in QGIS

  • Have you checked the path definitions in the project file and whether the server can reach the files?
    – underdark
    Sep 20, 2011 at 12:40
  • Yes, they are correct, so I assume the server can reach them (but is there a way to make this sure?)
    – Ecodiv
    Sep 20, 2011 at 12:53
  • Did you link qgis_mapserv.fcgi into the VECEA folder or did you copy it? Also, you could try calling qgis_mapserv.fcgi with the map parameter set to the project path.
    – underdark
    Oct 7, 2012 at 19:37
  • I tried both (linking and copying),same result. I am not sure what you mean with the last step
    – Ecodiv
    Oct 8, 2012 at 18:58
  • try using this url: yourpath/qgis_mapserv.fcgi?map=/usr/lib/cgi-bin/VECEA/project_name.qgs
    – underdark
    Oct 8, 2012 at 19:43

2 Answers 2


I Have the Same issue : The GetCapabilities result show only non-vector Layer : - Project - Groups - Rasters

But groups of Vector Layers have not defined BoundBox (0) (All layers are checked in project Properties)

And it the same this even in browser or under QGIS/Import WMS/ (No Vector Layers)

[Solved] : My Vector Files were in /root/ directory


Is your QGIS project read-able by all? I copied mine over from an XP box and doing a chmod worked for me.

  • Thanks for the answer. I tried your suggestion, but no change
    – Ecodiv
    Sep 27, 2011 at 19:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.