2

I have setup QGIS server using this guide sucessfully and would now like to setup qgis-web-client alongside it.

My QGIS server folder is: /usr/lib/cgi-bin

For qgis-web-client I have followed the qgis-web-client readme here and have cloned from github (as recommended) here:

/home/web/qgis-web-client

I am now stuck with editing the qgis-web-client.conf file to get things working correctly. I updated the path to "home/web/qgis-web-client/site" file. (See qgis-web-client.conf below for reference)

I think I am doing something wrong now and cannot understand the rest of the instructions in the readme. In particular:

  1. Check the symlink in cgi-bin is correct.
  2. Check the QGIS libs are in your /etc/ld.so.conf path
  3. Copy site/index.xml and check paths match your system OR Modify index.html and point your browser to that

Please can you tell me what is wrong with my configuration?

Please can you explain what the 3 points above mean?

Many thanks!

There seems to be many questions related to how to setup qgis-web-client and a lot of confusion. I have spent a lot of time scouring the gis stackexchange for the answer but so far have been unsuccessful!

<VirtualHost *:80>
ServerAdmin webmaster@localhost
# Add an entry to your /etc/hosts file for qgis-web-client.localhost e.g.
# 127.0.0.1 qgis-web-client.localhost
ServerName qgis-web-client.localhost

DocumentRoot /home/web/qgis-web-client/site
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/web/qgis-web-client/site/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /home/web/qgis-web-client/cgi-bin/
<Directory "/home/web/qgis-web-client/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiViews -SymLinksIfOwnerMatch
Order allow,deny
Allow from all
#Uncomment the next line to enable logging to a file
#SetEnv QGIS_LOG_FILE /tmp/qgislog.txt
</Directory>


# optional rewrite rules

# Forbid direct access
#  RewriteRule ^/cgi-bin/.*$ - [F]

# Search with SearchPanel

# sample search on layer 'Hello'
RewriteCond %{QUERY_STRING} ^(?:.*)query=samplesearch&*(?:.*)$
RewriteCond %{QUERY_STRING} ^(?:(?:.*)&)?colour=([^&]*)(?:.*)$
RewriteRule ^/wms/(.+)$ /cgi-bin/qgis_mapserv.fcgi?map=/<path-to-qgis-server-      projects>/$1.qgs&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS=Hello&QUERY_LAYERS=Hello&FEATURE_COUNT=20&INFO_FORMAT=text/xml&SRS=EPSG:4326&FILTER=Hello:"colour"\ =\ '%1' [PT]

# Rewrite /wms/mapname to qgis_mapserv.fcgi?map=/<path-to-qgis-server-    projects>/mapname.qgs
RewriteRule ^/wms/(.+)$ /cgi-bin/qgis_mapserv.fcgi?map=/<path-to-qgis-server-projects>/$1.qgs [QSA,PT]
# Rewrite /maps/mapname to qgis-web-client main page. mapname will be extracted for wms calls in Javascript code.
RewriteRule ^/maps/([^\.]+)$ /qgis-web-client/site/qgiswebclient.html [PT]
# Rewrite /maps/* to qgis-web-client/site (e.g. /maps/gis_icons/mActionZoomNext.png -> /qgis-web-client/site/gis_icons/mActionZoomNext.png)
RewriteRule ^/maps/(.*) /qgis-web-client/site/$1 [PT]


ErrorLog ${APACHE_LOG_DIR}/qgis-web-client-error.log
CustomLog ${APACHE_LOG_DIR}/qgis-web-client-access.log combined

</VirtualHost>
1

Ok so after a lot of blindly changing settings I realise that my issue was probably primarily to do with my poor understanding of apache2, virtual hosts etc.

  1. I renamed the qgis-web-client folder to "map" and moved to: /var/www/html/

  2. Updated my qgis-web-client.conf file paths:

path-to-qgis-web-client = /var/www/html/map/

path-to-qgis-server-projects = /usr/lib/cgi-bin/mymapname/

  1. I can now reach my project at: http://MYIPADDRESS/map/site/qgiswebclient.html?map=/usr/lib/cgi-bin/MYMAPNAME

For some reason the map is zoomed in on Eastern Mali rather than the location specified by my project but at least I can access qgis-web-client - so I consider question answered

0

Check out this question/answer (78422) for information about getting QGIS-web-client to show your map and not Central Africa. Basically it's a bug/missing feature, there are only a few projections that QGIS-web-client supports and if your project is not in the default then it will not display your extents. I tried adding a new projection in site/libs/proj4js (NAD 83 / UTM) using the output from QGIS Desktop projection settings but it doesn't do anything. So you're stuck converting everything into WGS 84 / Mercator.

How do I change the default location of a project in qgis-web-client?

0

now the QGIS web client has an easy installer that will take care of all the paths.

  • Any chance there is a tutorial for this anywhere? – washways Apr 12 '15 at 18:06
  • No luck with the easy installer :( It seems there is some conflict between references to 'qgis-server' and 'qgis-mapserver' – washways May 9 '15 at 5:50
  • what sort of conflicts? – mbernasocchi May 11 '15 at 10:05
  • It says package qgis-server does not exist. In installation of qgiS serveR package is qgis-mapserver – washways May 11 '15 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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