[Qgis-user] Configuring QGIS server on Ubuntu 20.4

Richard Greenwood richard.greenwood at gmail.com
Mon Oct 4 18:06:18 PDT 2021


On Mon, Oct 4, 2021 at 3:58 AM Mats Elfström <mats.elfstrom at giskraft.se>
wrote:

> Hi Richard!
> I should have mentioned that. The request you suggest gives a Not Found
> response.
>

In a default configuration, the files in /cgi-bin/ would be available to
all of the hosts on your server, but there are more than one places where
that might be blocked and it may not be worth your time to figure out where
or why.


> The request
>
> http://qgis.demo/cgi-bin/qgis_mapserv.fcgi?service=WMS&request=getcapabilities
> gives
> *Project file error. For OWS services: please provide a SERVICE and a MAP
> parameter pointing to a valid QGIS project file*
> Doing that, like this
>
> http://qgis.demo/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities&map=/home/qgis/projects/my_12.qgz
> I get the wanted XML file. I would like to query the catalogue instead of
> a single project file.
>

I don't know qgis_mapserver well enough to comment on catalogues.

Generally you don't want the path to the project file to be visible in the
URL because it's considered a security concern. Again, I'm not a regular
qgis_mapserver user, but the mapserver documentation has some useful
suggestions:
https://mapserver.gis.umn.edu/ogc/wms_server.html#changing-the-online-resource-url

And like I said, the same request is valid for QGIS desktop *on the same
> machine*.
> A similar request, using the DNS name for the server, from the outside
>
> http://geonet.se/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities&map=/home/qgis/projects/my_12.qgz
> gives a 404 not found response.
>

I believe in a previous email you said that other resources on geonet.se
were accessible from the outside which indicates that your DNS is correctly
pointing to your server. In which case I'm guessing that it's an issue with
the Apache <virtualhost> configuration. It needs to be accepting all
requests to port 80, for example <VirtualHost *:80> but you probably don't
even need a virtualhost so try just commenting it out.


> *Conclusion*: QGIS Server is running behind the firewall but not
> accessible from the outside, *which of course is the purpose for my
> concept*.
>

Do you really have a true firewall, or is it your Apache configuration?
Like maybe your virtual host.


> *Comment on other replies*: I am not saying that QGIS server is not ready
> for production or immature. On the contrary, it seems well documented and
> ready. I seem to recall that it also is OCG compliant and certified.
> *But * I am saying that the instructions for installation and
> configuration, particularly for the interaction between QGIS Server and the
> http engine are insufficient and sketchy. Regardless of OS, apparently.
>

Yeah, I hear you. I haven't actually read the documentation. But don't give
up. If I didn't have 10k lines of .map files I'd be looking at qgis_server
very seriously.

-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20211004/8489d58d/attachment.html>


More information about the Qgis-user mailing list