[Qgis-user] QGIS Server

Jorge Gustavo Rocha jgr at di.uminho.pt
Wed Feb 24 14:07:02 PST 2016


Hi Clifford,

Attached is my Apache configuration, both for the QGIS server and the 
QGIS client (it is the same file).

The server is running on:
http://sigum.di.uminho.pt/cgi-bin/qgis_mapserv.fcgi

The client is avilable at:
http://sigum.di.uminho.pt

I hope it helps.

Regards,

J. Gustavo


Às 00:44 de 20-02-2016, Clifford Snow escreveu:
> Below is my sites-available config. If anyone else has a working copy
> for Ubuntu's Wily I would appreciate a copy.
>
> Apache loads with no error messages. Logs report mod_fcgid configured.
> Yet when querying
> localhost/cgi-bin/qgis_mapserv.fcgi?SERVICE=MMS&VERSION=1.3&REQUEST=GetCapabilites,
> apache returns a 404 "The requested URL /cgi-bin/qgis_mapserv.fcgi was
> not found on this server."
>
> 001-qgis-server.conf
>
>     <VirtualHost *:80>
>
>        ServerAdmin webmaster at localhost
>
>        DocumentRoot /var/www/html
>
>        ServerName <localhost>
>
>        ErrorLog ${APACHE_LOG_DIR}/qgis-server-error.log
>
>        CustomLog ${APACHE_LOG_DIR}/qgis-server-access.log combined
>
>        # Longer timeout for WPS... default = 40
>
>        FcgidIOTimeout 120
>
>        FcgidInitialEnv LC_ALL "en_US.UTF-8"
>
>        FcgidInitialEnv PYTHONIOENCODING UTF-8
>
>        FcgidInitialEnv LANG "en_US.UTF-8"
>
>        FcgidInitialEnv QGIS_DEBUG 1
>
>        FcgidInitialEnv QGIS_SERVER_LOG_FILE /tmp/qgis-000.log
>
>        FcgidInitialEnv QGIS_SERVER_LOG_LEVEL 0
>
>       # FcgidInitialEnv QGIS_PLUGINPATH "/opt/qgis-server/plugins"
>
>        # Needed for QGIS HelloServer plugin HTTP BASIC auth
>
>        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/qgis_mapserv.fcgi
>
>        <Directory "/usr/lib/cgi-bin/qgis_mapserv.fcgi">
>
>            AllowOverride None
>
>            Options +ExecCGI -MultiViews -SymLinksIfOwnerMatch
>
>            # for apache2 > 2.4
>
>            Require all granted
>
>            #Allow from all
>
>            SetEnv QGIS_LOG_FILE /tmp/qgislog.txt
>
>            AddHandler fcgi-script .fcgi
>
>        </Directory>
>
>          ErrorLog ${APACHE_LOG_DIR}/qgis-web-client-error.log
>
>          CustomLog ${APACHE_LOG_DIR}/qgis-web-client-access.log combined
>
>       </VirtualHost>
>
>
>
>
> On Thu, Feb 18, 2016 at 11:35 PM, Luca Manganelli <luca76 at gmail.com
> <mailto:luca76 at gmail.com>> wrote:
>
>     On Fri, Feb 19, 2016 at 8:08 AM, Clifford Snow
>     <clifford at snowandsnow.us <mailto:clifford at snowandsnow.us>> wrote:
>     > Now I'm getting a .cgi-bin/qgis_mapserv.fcgi was not found
>
>     Where is your qgis_mapserv.fcgi located? You should link to the
>     cgi-bin directory (see your apache2 configuration)
>
>
>
>
> --
> @osm_seattle
> osm_seattle.snowandsnow.us <http://osm_seattle.snowandsnow.us>
> OpenStreetMap: Maps with a human touch
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>

J. Gustavo
-- 
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Tel: +351 253604480
Fax: +351 253604471
Móvel: +351 910333888
skype: nabocudnosor
-------------- next part --------------
<VirtualHost *:80>
  ServerAdmin webmaster at localhost
  # Add an entry to your /etc/hosts file for qgis-web-client.localhost e.g.
  # 127.0.0.1 62.28.83.84
  ServerName sigum.di.uminho.pt

  DocumentRoot /home/sigum/qgis-web-client/site
  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>
  <Directory /home/sigum/qgis-web-client/site/>
    DirectoryIndex index.php index.html
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
    # apache 2.4 requires the next line
    # see http://httpd.apache.org/docs/2.4/upgrading.html
    Require all granted
  </Directory>

  # if qgis-server is installed from packages in ubuntu this is usually /usr/lib/cgi-bin/
  # run "locate qgis_mapserv.fcgi" if you don't know where qgis_mapserv.fcgi is
  ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
  <Directory "/usr/lib/cgi-bin/">
    AllowOverride None
    Options +ExecCGI -MultiViews -SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    # apache 2.4 requires the next line
    # see http://httpd.apache.org/docs/2.4/upgrading.html
    Require all granted
    #Uncomment the next line to enable logging to a file
    #SetEnv QGIS_LOG_FILE /tmp/qgislog.txt
  </Directory>
  AddHandler cgi-script .cgi

  # optional rewrite rules
  RewriteEngine On

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

  # Search with SearchPanel

  # sample search on layer 'Hello'
  # sample search on layer 'Hello'
  #RewriteCond %{QUERY_STRING} ^(?:.*)query=samplesearch&*(?:.*)$
  #RewriteCond %{QUERY_STRING} ^(?:(?:.*)&)?colour=([^&]*)(?:.*)$
  #RewriteRule ^/wms/(.+)$ /cgi-bin/qgis_mapserv.fcgi?map=/home/qgis/qgis-web-client/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=/home/qgis/qgis-web-client/projects/mapname.qgs
  RewriteRule ^/wms/(.+)$ /cgi-bin/qgis_mapserv.fcgi?map=/home/sigum/qgis-web-client/projects/$1.qgs [QSA,PT]
  # Rewrite /maps to index
  RewriteRule ^/maps/?$ / [PT]
  # Rewrite /maps/mapname to qgis-web-client main page. mapname will be extracted for wms calls in Javascript code.
  RewriteRule ^/maps/([^\.]+)$ /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/(.*) /$1 [PT]


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

</VirtualHost>


More information about the Qgis-user mailing list