Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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 127.0.0.1] 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

share|improve this question
    
Have you checked the path definitions in the project file and whether the server can reach the files? –  underdark Sep 20 '11 at 12:40
    
Yes, they are correct, so I assume the server can reach them (but is there a way to make this sure?) –  Paulo Sep 20 '11 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 '12 at 19:37
    
I tried both (linking and copying),same result. I am not sure what you mean with the last step –  Paulo Oct 8 '12 at 18:58
    
try using this url: yourpath/qgis_mapserv.fcgi?map=/usr/lib/cgi-bin/VECEA/project_name.qgs –  underdark Oct 8 '12 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

share|improve this answer

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

Hope this helps!

Rayner

share|improve this answer
    
Thanks for the answer. I tried your suggestion, but no change –  Paulo Sep 27 '11 at 19:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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