From 9e242638532da17b25c1ac039e290d0f9a6c396e Mon Sep 17 00:00:00 2001 From: AcuGIS Date: Wed, 10 Jul 2024 20:42:54 +0000 Subject: [PATCH] Update docs/source/install.rst --- docs/source/install.rst | 194 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 179 insertions(+), 15 deletions(-) diff --git a/docs/source/install.rst b/docs/source/install.rst index 3619b06..5366381 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -13,16 +13,14 @@ If you plan to use SSL, be sure to set the hostname $ hostnamectl set-hostname qpod.webgis1.com -Installer scripts are available in the install directory and should be called from the base directory. - Download QuartzMap or use Git. -Change to the quartzmap directory +Installer scripts are available in the install directory and should be called from the quartzmap directory. .. code-block:: console $ git clone https://github.com/AcuGIS/quartzmap.git - $ cd quartzmap + $ cd quartzmap If PostgreSQL is not installed, install it using /installer/postgres.sh @@ -37,23 +35,189 @@ Run the installer: $ ./installer/app-install.sh +Optionally, install an SSL certificate using certbot + +.. code-block:: console + + certbot --apache --agree-tos --email hostmaster@yourdomain.com --no-eff-email -d yourdomain.com + + +Go to https://yourdomain.com/admin/setup.php to complete the installation + Manual Installation ------------------- -To retrieve a list of random ingredients, -you can use the ``lumache.get_random_ingredients()`` function: +1. Install dependencies: -.. autofunction:: lumache.get_random_ingredients +.. code-block:: console -The ``kind`` parameter should be either ``"meat"``, ``"fish"``, -or ``"veggies"``. Otherwise, :py:func:`lumache.get_random_ingredients` -will raise an exception. + apt-get -y install apache2 php-{pgsql,zip,gd,simplexml,curl,fpm} proftpd libapache2-mod-fcgid postfix python3-certbot-apache gdal-bin -.. autoexception:: lumache.InvalidKindError +2. Install QGIS Server -For example: +.. code-block:: console ->>> import lumache ->>> lumache.get_random_ingredients() -['shells', 'gorgonzola', 'parsley'] + RELEASE=$(lsb_release -cs) + wget --no-check-certificate --quiet -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg + + cat >>/etc/apt/sources.list.d/qgis.sources </etc/logrotate.d/qgisserver < /etc/apache2/sites-available/qgis.conf + + for f in default-ssl 000-default; do + sed -i.save "s/#ServerName example.com/ServerName ${HNAME}/" /etc/apache2/sites-available/${f}.conf + done + + a2ensite 000-default default-ssl qgis + a2disconf serve-cgi-bin + + # switch to mpm_event to server faster and use HTTP2 + PHP_VER=$(php -version | head -n 1 | cut -f2 -d' ' | cut -f1,2 -d.) + a2enmod proxy_fcgi setenvif http2 + a2enconf php${PHP_VER}-fpm + a2enmod mpm_event + + systemctl reload apache2 + +5. Set up ProFTPD + +.. code-block:: console + + sed -i.save ' + s/#DefaultRoot~/DefaultRoot ~/ + s/# RequireValidShelloff/RequireValidShell off/' /etc/proftpd/proftpd.conf + systemctl enable proftpd + systemctl restart proftpd + +6. Create the PostgreSQL database + +.. code-block:: console + + + su postgres + createdb quartz + createuser -sd quartz + psql -c "alter user quartz with password 'SuperSecret'" + psql -c "ALTER DATABASE quartz OWNER TO quartz" + CMD_EOF + +7. Create the Data, Cache, and Apps directories + +.. code-block:: console + + mkdir /var/www/data + mkdir /var/www/cache + mkdir /var/www/html/apps + + chown -R www-data:www-data /var/www/data + chown -R www-data:www-data /var/www/cache + chown -R www-data:www-data /var/www/html/apps + + +8. Give sync service +w to apps/1/images dir + +.. code-block:: console + + chmod -R g+w "${APPS_DIR}" + +9. Create the const.php configuration file using values from above + +.. code-block:: console + + cat >admin/incl/const.php < + CAT_EOF + +10. Copy files from quartzmap directory to /var/www/html + +.. code-block:: console + + cp -r . /var/www/html/ + chown -R www-data:www-data /var/www/html + rm -rf /var/www/html/installer + + systemctl restart apache2 + +11. Configure FTP users + +.. code-block:: console + + groupadd qatusers + + for f in create_ftp_user delete_ftp_user update_ftp_user; do + cp installer/${f}.sh /usr/local/bin/ + chown www-data:www-data /usr/local/bin/${f}.sh + chmod 0550 /usr/local/bin/${f}.sh + done + + cat >/etc/sudoers.d/q2w <