<div dir="ltr"><div>Hi Richard!</div><div>I should have mentioned that. The request you suggest gives a Not Found response.</div><div>The request</div><div><a href="http://qgis.demo/cgi-bin/qgis_mapserv.fcgi?service=WMS&request=getcapabilities" target="_blank">http://qgis.demo/cgi-bin/qgis_mapserv.fcgi?service=WMS&request=getcapabilities</a></div><div>gives</div><div><i>Project file error. For OWS services: please provide a SERVICE and a MAP parameter pointing to a valid QGIS project file</i></div><div>Doing that, like this</div><div><a href="http://qgis.demo/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities&map=/home/qgis/projects/my_12.qgz" target="_blank">http://qgis.demo/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities&map=/home/qgis/projects/my_12.qgz</a></div><div>I get the wanted XML file. I would like to query the catalogue instead of a single project file.<br></div><div><br></div><div>And like I said, the same request is valid for QGIS desktop <u>on the same machine</u>.</div><div>A similar request, using the DNS name for the server, from the outside<br><a href="http://geonet.se/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities&map=/home/qgis/projects/my_12.qgz">http://geonet.se/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities&map=/home/qgis/projects/my_12.qgz</a></div><div>gives a 404 not found response.</div><div><h1 style="color:rgb(0,0,0);font-family:"Times New Roman"">Not Found</h1><p style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">The requested URL was not found on this server.</p><hr style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"><address style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium">Apache/2.4.41 (Ubuntu) Server at <a href="http://geonet.se">geonet.se</a> Port 80</address></div><div><b><br></b></div><div><b><br></b></div><div><b>Conclusion</b>: QGIS Server is running behind the firewall but not accessible from the outside, <u>which of course is the purpose for my concept</u>.</div><div><b><br></b></div><div><b>Comment on other replies</b>: 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.</div><div><u>But </u> 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.</div><div><br></div><div>Regards, Mats.E</div><div><i></i></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Den sön 3 okt. 2021 kl 02:01 skrev Richard Greenwood <<a href="mailto:richard.greenwood@gmail.com" target="_blank">richard.greenwood@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 2, 2021 at 10:02 AM Mats Elfström <<a href="mailto:mats.elfstrom@giskraft.se" target="_blank">mats.elfstrom@giskraft.se</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Hi!</div><div>Let me just recuperate that the goal for QGIS server is to be used as a map and data server for webmaps on MapStore and to be harvestable by Geonetwork for a metadata catalogue. MapStore and Geonetwork are running on another machine. QGIS server shall run on a Ubuntu machine, along with data in PostGIS. The address for this machine is <a href="http://geonet.se" target="_blank">http://geonet.se</a></div><div>Essentially, I see QGIS Server as an equivalent to Geoserver but with outstanding design capabilities.</div><div><br></div>Here comes a run-through of an attempt to install QGIS server on an Ubuntu 20.4 system, using these instructions: <div><a href="https://docs.qgis.org/testing/en/docs/server_manual/getting_started.html#installation-on-debian-based-systems" target="_blank">https://docs.qgis.org/testing/en/docs/server_manual/getting_started.html#installation-on-debian-based-systems</a><br>The first step is to install QGIS, according to this page</div><div><a href="https://qgis.org/en/site/forusers/alldownloads.html" target="_blank">https://qgis.org/en/site/forusers/alldownloads.html</a></div><div>I opted to install qgis-server by adding that in the last command as suggested.<br>No problems so far. Only, when returning to the first manual page, I see that I probably should have installed the LTR version instead of 3.20. If this is important, the user should be advised earlier, and instructed how to get the LTR version. For this review I will continue with 3.20.<br>Next, the user is again advised to install qgis-server and optionally python-qgis. The motive for this is rather unclear at this stage, but I chose to install python as advised.<br>Testing the installation by calling the fcgi seems to give a correct response, even if it differs from the two samples. Notice error code 302 for instance.<br><font face="monospace">root@geonet:~# /usr/lib/cgi-bin/qgis_mapserv.fcgi<br>Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.<br>Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.<br>Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.<br>"Loading native module /usr/lib/qgis/server/libdummy.so"<br>"Loading native module /usr/lib/qgis/server/liblandingpage.so"<br>"Loading native module /usr/lib/qgis/server/libwcs.so"<br>"Loading native module /usr/lib/qgis/server/libwfs.so"<br>"Loading native module /usr/lib/qgis/server/libwfs3.so"<br>"Loading native module /usr/lib/qgis/server/libwms.so"<br>"Loading native module /usr/lib/qgis/server/libwmts.so"<br>Content-Length: 0<br>Location: http:/index.json<br>Server:  QGIS FCGI server - QGIS version 3.20.3-Odense<br>Status:  302</font><br><br>Next, it is suggested that I download a QGIS project or ‘use your own’ so I manually created the /home/qgis/projects/ folder, and then saved a simple QGIS project file to the folder. By default, this was saved in the qgz format.<br>Then an HTTP server is needed.<br>A note says <b><i>In the following, please replace localhost with the name or IP address of your server</i>.</b><br>But localhost only appears in the string webmaster@localhost where it probably does not matter. There is no other mention of localhost in the configuration file.<br>I go on to install Apache, as I have never used NGINX.<br><b><i>You can run QGIS Server on your default website</i></b><br>This is probably what I would want to do, but I do not know how, so I go on to create a virtualhost as instructed by the name qgis.demo. I make the log and qgisserverdb folders as instructed and set their permissions. Then I enable fcgid and the site qgis.demo. The last command advises to run systemctl reload apache2, but the manual suggests systemctl restart apache2. I do both just to make sure. Then comes a tricky part, adding the virtualhost to the hosts file. After that operation, it contains this. Note that the server IP address got two definitions. I am bothered by this.<br><font face="monospace">127.0.0.1     localhost<br>::1              localhost ip6-localhost ip6-loopback<br>ff02::1         ip6-allnodes<br>ff02::2         ip6-allrouters<br><br># Auto-generated hostname. Please do not remove this comment.<br>206.72.203.32 <a href="http://geonet.se" target="_blank">geonet.se</a> geonet<br>206.72.203.32 qgis.demo</font><br><br>Calling <a href="http://qgis.demo/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities" target="_blank">http://qgis.demo/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities</a> from within the server gives <br><b><ServerException><br>Project file error. For OWS services: please provide a SERVICE and a MAP parameter pointing to a valid QGIS project file<br></ServerException></b><br><br>This seems correct. However, there is a totally confusing note here.<br><i><b>Remember that both the myhost.conf and /etc/hosts files should be configured for your setup to work. You can also test the access to your QGIS Server from other clients on the network (e.g. Windows or macOS machines) by going to their /etc/hosts file and point the myhost name to whatever IP the server machine has on the network (not 127.0.0.1 as it is the local IP, only accessible from the local machine). On *nix machines the hosts file is located in /etc, while on Windows it’s under the C:\Windows\System32\drivers\etc directory. Under Windows you need to start your text editor with administrator privileges before opening the hosts file.</b></i><br>What is myhost.conf and what should it contain? The rest is very strange. My goal is to access QGIS server from the internet, using the <a href="http://geonet.se" target="_blank">http://geonet.se</a> address, looked up by DNS as usual. Not from ‘other clients on the network’ and the <i>myhost </i>name. What would be the point for this? Not surprising, <br><a href="http://geonet.se/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities" target="_blank">http://geonet.se/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities</a><br>from the outside returns<br><i><b>Not Found<br>The requested URL was not found on this server.<br>Apache/2.4.41 (Ubuntu) Server at <a href="http://geonet.se" target="_blank">geonet.se</a> Port 80 </b></i><br>Doing just <a href="http://geonet.se" target="_blank">http://geonet.se</a> returns the Apache2 Ubuntu Default Page<br>And here the show stops.<br><ul><li>I might add that PostgreSQL and Geoserver are accessible from the outside, and Geoserver serves WMS to the Internet as expected. Port 80 is obviously open too.</li><li>I can also access QGIS server from QGIS desktop <u>on the same machine</u>, using <a href="http://qgis.demo" target="_blank">http://qgis.demo</a> as root. But I had to include a MAP request in the string, with a full path to the project file.</li></ul></div><div><br></div><div>Conclusion: The missing piece of information seems to be how to make Apache2 direct incoming requests to QGIS Server, OR how to configure QGIS server to run as <b><i>your default website. </i></b>As all the rest depends on this, it is a vital piece of information.</div></div></div></blockquote><div><br></div><div></div></div><div><br></div><div>Matts,</div><div><br></div><div>I am not a qgis server user so I am not the best qualified to answer your questions, but it sounds like you probably have qgis server installed properly and your problems are with Apache. Does your Linux machine have a desktop (a GUI)? If so, in a browser enter:</div><div>   <a href="http://localhost/cgi-bin/qgis_mapserv.fcgi?service=WMS&request=getcapabilities" target="_blank">http://localhost/cgi-bin/qgis_mapserv.fcgi?service=WMS&request=getcapabilities</a></div><div>and you will see an xml document if the request is successful. If you Linux machine is headless, in a shell enter:</div><div>   curl "<a href="http://localhost/cgi-bin/qgis_mapserv.fcgi?service=WMS&request=getcapabilities" target="_blank">http://localhost/cgi-bin/qgis_mapserv.fcgi?service=WMS&request=getcapabilities</a>"</div><div>and you will see an xml document if the request is successful.<br></div><div><br></div><div>A default Ubuntu install with Apache makes /cgi-bin/* available to all hosts on that server if cgi and fcigd have been enabled.</div><div><br></div><div>--<br></div><div dir="ltr"><div dir="ltr">Richard W. Greenwood, PLS<br><a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a></div></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><span><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><p><b><img src="https://drive.google.com/uc?id=1sRHl_CnQrtHqnEvCnblOPhzklqxxeH5J&export=download"><br></b></p><p><b>GisKraft</b>, Geodatakonsult</p><p>Mats Elfström,
Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden<br>tel: +46 70 595 39 35
/ <a href="http://www.giskraft.se" target="_blank">www.giskraft.se</a></p></div></div></div></div></div></div></div></span></div></div></div></div>