[Qgis-user] QGIS Server on Mac OS X

Tobias Brühlmeier tobias.bruehlmeier at xwind.ch
Fri Jun 27 05:26:46 PDT 2014


Hi Larry

thanks a lot, it’s working now! 

Regards, Tobias

On 27. Juni 2014 at 13:25:14, Larry Shaffer (larrys at dakotacarto.com) wrote:

Hi Tobias,


On Fri, Jun 27, 2014 at 3:51 AM, Tobias Brühlmeier <tobias.bruehlmeier at xwind.ch> wrote:
Hi all,

I’m trying to install QGIS Server on Mac OS X Mavericks. Unfortunately, I’m stuck. Hope, somebody has a good hint for me.

This is what I have done so far:



INSTALLATION

1) I followed this documentation: http://hub.qgis.org/projects/quantum-gis/wiki/QGIS_Server_Tutorial. Unfortunately, it’s based on Mac OS X Mountain Lion, but adaptions are very obvious.

2) I’ve started on a clean installation of Mavericks (Virtual Machine), with Xcode and Xcode Command Line tools installed, as required.

3) I’ve installed QGIS 2.2 and all required plug-ins. Works fine.

4) I’ve worked around the Xcode bug via sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain

5) I’ve installed mod_fastcgi. The tutorial recommends using Apple’s version of mod_fastcgi, but since I wasn’t able to install it, and since it’s an old version, I’ve chosen Homebrew’s version (Terminal: brew install homebrew/apache/mod_fastcgi), and activated it in /etc/apache2/httpd.conf

6) I’ve created the file /etc/apache2/other/qgis-mapserver.conf, as described.

7) I’ve restarted Apache, and tested it successfully: http://localhost returns “It works!"

!! 8) Ive tried to test QGIS Server with: http://localhost/qgis-mapserv/qgis_mapserv.fcgi? Here is where trouble begins. According to the documentation, the returned message should be "Configuration file problem”, but instead, it says "Please check the value of the REQUEST parameter”. Couldn’t find a solution for that, and because error log doesn’t show an error, I suppose everything still works fine.



PUBLISHING MY FIRST PROJECT

As far as I understand, projects have to be located inside /Applications/QGIS.app/Contents/MacOS/fcgi-bin/: One project folder for every QGIS project.

9) I’ve created a project folder /Applications/QGIS.app/Contents/MacOS/fcgi-bin/my_map_project.

10) I’ve created a very simple QGIS project called cantons.qgs, taking canton boundaries from a PostGIS database.

11) I’ve copied it to /Applications/QGIS.app/Contents/MacOS/fcgi-bin/my_map_project.

12) I’ve copied Applications/QGIS.app/Contents/MacOS/fcgi-bin to /Applications/QGIS.app/Contents/MacOS/fcgi-bin/my_map_project.

!!!! 13) I tried to start my application with URLs
- http://localhost/qgis-mapserv/my_map_project/qgis_mapserv.fcgi?
- http://localhost/qgis-mapserv/my_map_project/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities

No success. After some time, my web browser returns:

—
Internal Server Error 

The server encountered an internal error or misconfiguration and was unable to complete your request. 

Please contact the server administrator, you at example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. 

More information about this error may be available in the server error log. 
— 

And Apache’s error log shows: 
---
dyld: Library not loaded: @executable_path/../../Frameworks/qgis_core.framework/qgis_core 
  Referenced from: /Applications/QGIS.app/Contents/MacOS/fcgi-bin/my_map_project/qgis_mapserv.fcgi 
  Reason: image not found 

You have moved the qgis_mapserv.fcgi binary into a subdirectory, so its @executable_path/../../Framew...etc load path fails. The
qgis_mapserv.fcgi binary needs to stay in the /Applications/QGIS.app/Contents/MacOS/fcgi-bin/ directory because it has 'relative' load paths that point to libraries/frameworks in the QGIS.app bundle.

You can symlink qgis_mapserv.fcgi elsewhere, if Apache's user has rights to that location and directives have been set up for the symlink's directory to allow following symlinks. Symlinking is not necessary, though. You do need to make sure the Apache user has read access to the directory of your projects and data, in the same way it needs access to HTML files, etc.

You can place the project directories where you like, but initially try at the root of your file system, e.g. /qgis, then set the permissions appropriately for the server user's access. When doing this, you will then need to pass the whole path to your project via the MAP parameter, e.g. MAP=/qgis/my-project/project.qgs.

There are certainly better, more secure setups, but that should get you started.

Regards

Larry Shaffer
Dakota Cartography
Black Hills, South Dakota
 
...



This is it. Any ideas?

Best regards, Tobias






_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140627/d69614cc/attachment.html>


More information about the Qgis-user mailing list