Monday 25 November 2019

ubuntu - QGIS Server Capabilities Response doesn't contain any Layers (Fedora 15 64-bit)


I'm having similar issues running QGIS Mapserver under a fresh install of Fedora 15 (64-bit). The XML response from GetCapabilities will not show the individual layers inside the QGIS project, just the 'project' layer. All the layers show up just fine under QGIS (1.7.1). For some reason QGIS Mapserver isn't able to parse my project file or find the shapefiles the same way as QGIS does. Shapefiles are located in my HOME directory. The QGIS project file is in /var/www/wms as per the sample configuration file included in /etc/httpd/conf.d/gis-mapserver.conf



Shapefiles are readable by everyone, so is the project. By the way, everything works perfectly under a fresh install of Ubuntu 11.04 32-bit (QGIS 1.7.0 and QGIS-Mapserver 1.7.0) but for some reason I'm up against a brick wall when it comes to Fedora 15 (64-bit). httpd log files don't show anything out of the ordinary. I tried moving the shapefiles into /var/www/wms but Apache (httpd) didn't like that at all. Any ideas?


Here's the procedure I used under Fedora 15 (64-bit) to get where I am. Further down is the procedure I used for Ubuntu 11.04 (32-bit) which worked.


$su -c 'yum update'
$su -c 'yum install httpd'
$su -c '/etc/init.d/httpd start'

Tested apache by going to localhost in firefox


got a Fedora test page . . .


$su -c 'yum install qgis qgis-python qgis-mapserver'


run qgis to test (installed qgis 1.7.1 and qgis-mapserver 1.7.1)


Copied over QGIS projects and shapefiles from another Linux box into my HOME directory, made sure they were readable by everyone


Followed instructions in README file located here:


/usr/share/doc/qgis-mapserver-1.7.1/qgis-mapserver-README.fedora


$cd /var/www
$su -c 'mkdir wms'
cd wms

copied a qgis project into the new wms folder


restarted httpd



$su -c '/etc/init.d/httpd restart'

http//localhost/wms/name_of_qgis_project?service=WMS&version=1.3.0&request=GetCapabilities


(The colon : after http above is missing because evidently I'm only allowed a maximum of 2 links in this post)


XML response shows only the 'project' layer and none of the shapefile layers inside the qgis project




If it helps anyone, here is the procedure I used to get QGIS Mapserver working on Ubuntu 11.04. I started from a fresh install and didn't compile anything from source. This worked for me.


$sudo apt-get update
$sudo apt-get install nedit
$sudo nedit /etc/apt/sources.list


Added to the bottom of the /etc/apt/sources.list file:


deb     http://qgis.org/debian natty main
deb-src http://qgis.org/debian natty main

Then


$sudo gpg --keyserver keyserver.ubuntu.com --recv 1F9ADD375CA44993
$sudo gpg --export --armor 1F9ADD375CA44993 | sudo apt-key add -
$sudo apt-get update


Got an error message:


W: GPG error: http://qgis.org natty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2A22E8244865A03


$sudo apt-get install apache2 qgis libfcgi-dev libapache2-mod-fcgid qgis-mapserver

WARNING: The following packages cannot be authenticated! libqgis1.7.0 python-qgis-common python-qgis qgis-providers-common qgis-providers qgis-common qgis qgis-mapserver qgis-plugin-grass-common qgis-plugin-grass


(I installed these packages without verification)


Tested apache by going to localhost in firefox


It should say "It Works!"


Copied over QGIS projects and shapefiles from another Linux box into my HOME directory, made sure they were readable by everyone


Made a new folder inside /usr/lib/cgi-bin and copied one QGIS project into it, along with wms_metadata.xml and qgis_mapserv.fcgi



restarted apache


$sudo /etc/init.d/apache2 restart

Tested GetCapabilities


http//localhost/cgi-bin/new_folder_goes_here/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities


(The colon : after http above is missing because evidently I'm only allowed a maximum of 2 links in this post)


Was able to add the WMS Layer from inside QGIS without any problem. However, I still cannot get it to load using ESRI ArcCatalog or ArcMap.



Answer



Got it working under Fedora 15 by moving the shapfiles out of my home directory, and then disabling SELinux. Not the ideal solution, but I'll take it for now. I can't figure out how to make it work otherwise.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...