<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi,</p>
    <p>You can also add this in Apache configuration to avoid qgs file
      access by Apache :</p>
    <p><FilesMatch "\.(qgs)"><br>
              Require all denied<br>
      </FilesMatch><br>
    </p>
    <br>
    Nicolas<br>
    <br>
    <div class="moz-cite-prefix">Le 05/10/2017 à 11:01, Andreas Neumann
      a écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:7bf2e51d0a5b50eb7bddc943d2e78234@carto.net">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <p>Hi Axel,</p>
      <p>You don't need these symbolic links. They are unnecessary.</p>
      <p>It is also bad (security wise) to copy or link .qgs file into a
        directory that is reachable on the web - be it in a regular web
        directory or in a CGI directory.</p>
      <p>What I do is:</p>
      <ul>
        <li>.qgs Files reside in a path NOT REACHABLE by a webbrowser.
          This is important, as .qgs files contains sensitive
          information about datasource you don't want to reveal to the
          public. An example path is /home/xyz</li>
        <li>Use Postgis databases as a datasource (preferably use
          service name definitions and no hardcoded server/port/db
          combinations)</li>
        <li>scp the .qgs files to the server (or if it is on the same
          LAN you can use SAMBA and a Windows network share)</li>
        <li>Make sure the directory where the .qgs files reside can be
          read (not written) by the user that is used by the web-server
          (on Ubuntu: www-data)</li>
        <li>Copy SVG files or images needed by a QGIS layout or QGIS
          symbology if necessary either to the central svg directory or
          into the directory of the project</li>
        <li>In Apache (this has to be done by the sysadmin) I create
          Apache rewrite rules to hide the actual path where the .qgs
          files reside.</li>
      </ul>
      <p>There are plugins around for QGIS cloud or Lizmap that ease the
        deployment for the user. They take care about copying the .qgs
        file and necessary linked resources to the server. You may want
        to have a look at these plugins to see what they do.</p>
      <p>Hope this helps a bit,</p>
      <p>Definitely you don't need any symbolic links.</p>
      <p>Andreas</p>
      <p>On 2017-10-05 10:03, Axel Schaefer wrote:</p>
      <blockquote type="cite" style="padding: 0 0.4em; border-left:
        #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
        <div class="pre" style="margin: 0; padding: 0; font-family:
          monospace"><span style="white-space: nowrap;">Hi.</span><br>
          <br>
          How do you deploy your QGIS Server projects from your desktop
          to the server? Let's collect the possibilities. This should
          not deal directly with the installation but the deployment of
          your projects between two different machines (QGIS Desktop
          client-machine and QGIS Server server-machine).<br>
          <br>
          Background: Out of some talks, I know that there are some
          possiblities to get your QGIS qgs-files to the server and to
          let for example Apache do some work to facilitate an easy way.
          People are doing that in different ways, and I would like to
          know how. And it seems like all the ways provide a good
          mechanism to distinguish between the GIS-expert doing the work
          on the QGIS project and the sysadmin.<br>
          <br>
          <br>
          <span style="white-space: nowrap;">First way, the easy way:</span><br>
          <br>
          What I'm presenting right now is Level 1 and follows the way
          Anita Graser has described in her blog for Ubuntu: <a
href="https://anitagraser.com/2012/03/30/qgis-server-on-ubuntu-step-by-step/"
            target="_blank" rel="noopener noreferrer"
            moz-do-not-send="true">https://anitagraser.com/2012/03/30/qgis-server-on-ubuntu-step-by-step/</a>
          in Chapter "Adding a QGIS project file".<br>
          <br>
          After the installation I have the directory "/usr/lib/cgi-bin"
          with the 2 files qgis_mapserv.fcgi and wms_metadata.xml. For
          every new project (in this example called "bonn") I do the
          following steps.<br>
          <br>
          1.) Create a directory in /usr/lib/cgi-bin called "bonn":
          /usr/lib/cgi-bin/bonn.<br>
          <br>
          2.) Make two symbolic links: First to the "qgis_mapserv.fcgi"
          file and second to the "wms_metadata.xml" file.<br>
          <br>
          <br>
          <span style="white-space: nowrap;">  $ /usr/lib/cgi-bin/bonn % sudo ln -s ../qgis_mapserv.fcgi</span><br>
          <span style="white-space: nowrap;">  $ /usr/lib/cgi-bin/bonn % sudo ln -s ../wms_metadata.xml</span><br>
          <span style="white-space: nowrap;">  $ /usr/lib/cgi-bin/bonn % ls</span><br>
          <span style="white-space: nowrap;">  qgis_mapserv.fcgi  wms_metadata.xml</span><br>
          <span style="white-space: nowrap;">  $ /usr/lib/cgi-bin/bonn %</span><br>
          <br>
          3.) I create a third symbolic link to the QGIS-Project-file.
          But that resides in my home-directory.<br>
          <br>
          <br>
          <span style="white-space: nowrap;">  $ /usr/lib/cgi-bin/bonn % sudo ln -s ~/qgisserver/bonn/bonn.qgs</span><br>
          <span style="white-space: nowrap;">  $ /usr/lib/cgi-bin/bonn % ls -l</span><br>
            lrwxrwxrwx 1 root root 40 Sep 27 09:43 bonn.qgs ->
          /home/aschaefer/qgisserver/bonn/bonn.qgs<br>
            lrwxrwxrwx 1 root root 20 Sep 27 09:38 qgis_mapserv.fcgi
          -> ../qgis_mapserv.fcgi<br>
            lrwxrwxrwx 1 root root 19 Sep 27 09:38 wms_metadata.xml
          -> ../wms_metadata.xml<br>
          <span style="white-space: nowrap;">  $ /usr/lib/cgi-bin/bonn %</span><br>
          <br>
          <br>
          The interesting part is the last one. I can handle my
          qgis-files in my own home directory. All I have to do is to
          call the admin to a) create the directory, b) create the two
          symbolic links to the upper directory content and c) create
          the symbolic link to my project in my home. If I chnage the
          qgs file, the content of the service has changed.<br>
          <br>
          How do I update the content of the qgs-file? In this case via
          scp or some similar technique. I have to copy the file to the
          server. I do it in the beginning, call my admin to do his 3
          steps and after that I can update my file.<br>
          <br>
          URL to access the WMS: <a
href="http://localhost/cgi-bin/bonn/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities"
            target="_blank" rel="noopener noreferrer"
            moz-do-not-send="true">http://localhost/cgi-bin/bonn/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities</a><br>
          <br>
          <br>
          Basic condition: I use a central database for my geodata and
          don't hassle with local files.<br>
          <br>
          Advantage: Quick and easy and clearly to arrange. Work of
          GIS-expert can be done without work of admin.<br>
          <br>
          Disadvantage: Still communication and work to do. Might be
          sufficient for small departments with good communication
          between GIS guy and admin guy. The URL goes directly to the
          qgis_mapserv.fcgi file.<br>
          <br>
          So, how do you do it? Do you use rewrites to hide the
          unneccessary stuff from the URL and to make it look nicer? Do
          you use automatisms?<br>
          <br>
          <span style="white-space: nowrap;">Best regards</span><br>
          Axel<br>
          <br>
          -- <br>
          <span style="white-space: nowrap;">Axel Schaefer</span><br>
          <span style="white-space: nowrap;">WhereGroup GmbH & Co. KG</span><br>
          <span style="white-space: nowrap;">Eifelstraße 7</span><br>
          <span style="white-space: nowrap;">53119 Bonn</span><br>
          Germany<br>
          <br>
          <span style="white-space: nowrap;">Fon: +49 (0)228 / 90 90 38 - 23</span><br>
          <span style="white-space: nowrap;">Fax: +49 (0)228 / 90 90 38 - 11</span><br>
          <br>
          <span style="white-space: nowrap;"><a
              href="mailto:axel.schaefer@wheregroup.com"
              moz-do-not-send="true">axel.schaefer@wheregroup.com</a></span><br>
          <span style="white-space: nowrap;"><a
              href="http://www.wheregroup.com" target="_blank"
              rel="noopener noreferrer" moz-do-not-send="true">www.wheregroup.com</a> | <a
              href="http://www.mapbender.org" target="_blank"
              rel="noopener noreferrer" moz-do-not-send="true">www.mapbender.org</a> | <a
              href="http://www.meldemax.com" target="_blank"
              rel="noopener noreferrer" moz-do-not-send="true">www.meldemax.com</a></span><br>
          <span style="white-space: nowrap;">Amtsgericht Bonn, HRA 6788</span><br>
          <span style="white-space: nowrap;">-------------------------------</span><br>
          <span style="white-space: nowrap;">Komplementärin:</span><br>
          <span style="white-space: nowrap;">WhereGroup Verwaltungs GmbH</span><br>
          <span style="white-space: nowrap;">vertreten durch:</span><br>
          <span style="white-space: nowrap;">Olaf Knopp, Peter Stamm</span><br>
          <span style="white-space: nowrap;">-------------------------------</span><br>
          _______________________________________________<br>
          <span style="white-space: nowrap;">Qgis-user mailing list</span><br>
          <span style="white-space: nowrap;"><a
              href="mailto:Qgis-user@lists.osgeo.org"
              moz-do-not-send="true">Qgis-user@lists.osgeo.org</a></span><br>
          <span style="white-space: nowrap;">List info: <a
              href="https://lists.osgeo.org/mailman/listinfo/qgis-user"
              target="_blank" rel="noopener noreferrer"
              moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></span><br>
          <span style="white-space: nowrap;">Unsubscribe: <a
              href="https://lists.osgeo.org/mailman/listinfo/qgis-user"
              target="_blank" rel="noopener noreferrer"
              moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></span></div>
      </blockquote>
      <p><br>
      </p>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
    </blockquote>
    <br>
  </body>
</html>