QuartzMap/docs/source/install.rst

295 lines
6.2 KiB
ReStructuredText
Raw Normal View History

2024-07-10 16:27:23 +00:00
Install
=====
2024-07-10 21:15:48 +00:00
System Requirements
------------------
2024-07-10 21:26:02 +00:00
- Operating System:
2024-09-01 06:05:13 +00:00
- Ubuntu 24
2024-07-10 21:19:16 +00:00
2024-07-10 21:26:02 +00:00
- Minimum:
2024-07-10 21:21:43 +00:00
- 4 GB RAM
2024-09-01 06:05:13 +00:00
- 15 GB Disk
2024-07-10 21:21:43 +00:00
- 2 vCPU
2024-07-10 21:15:48 +00:00
2024-07-10 16:27:23 +00:00
2024-09-01 06:05:13 +00:00
Note: if you are only publishing qgis2web, the minimum is 2 GB of RAM and 1 CPU.
2024-07-10 21:30:02 +00:00
Using the Script Installers
-------------------------
2024-07-10 16:27:23 +00:00
2024-07-10 20:20:22 +00:00
If you plan to use SSL, be sure to set the hostname
2024-07-10 16:27:23 +00:00
.. code-block:: console
2024-07-10 20:20:22 +00:00
$ hostnamectl set-hostname qpod.webgis1.com
Download QuartzMap or use Git.
2024-07-10 20:42:54 +00:00
Installer scripts are available in the install directory and should be called from the quartzmap directory.
2024-07-10 20:20:22 +00:00
.. code-block:: console
2024-07-25 13:20:36 +00:00
$ git clone https://github.com/AcuGIS/quartzmap-web-client.git
$ cd quartzmap-web-client
2024-07-10 16:27:23 +00:00
2024-07-25 13:36:43 +00:00
Alternatively, you can simply download the binary and unzip:
.. code-block:: console
wget https://github.com/AcuGIS/quartzmap-web-client/releases/download/2.1.0/quartzmap-web-client-2.1.0.zip
unzip -q quartzmap-web-client-2.1.0.zip
cd quartzmap-web-client-2.1.0
2024-07-10 20:20:22 +00:00
If PostgreSQL is not installed, install it using /installer/postgres.sh
.. code-block:: console
$ ./installer/postgres.sh
Run the installer:
.. code-block:: console
$ ./installer/app-install.sh
2024-07-10 20:42:54 +00:00
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
2024-07-13 22:11:17 +00:00
If checks pass, click "Next"
.. image:: images/install-1.png
Populate the required fields and click Submit
2024-07-13 22:22:01 +00:00
.. image:: images/install-2.png
2024-07-13 22:11:17 +00:00
2024-07-10 20:20:22 +00:00
2024-07-13 22:13:30 +00:00
Log in to the application:
.. image:: images/install-3.png
2024-07-10 20:20:22 +00:00
Manual Installation
-------------------
2024-07-10 16:27:23 +00:00
2024-07-13 22:22:01 +00:00
The installation steps below are from the app-install.sh script. You can adapt as needed.
For below, we will use the following.
2024-07-10 20:56:03 +00:00
.. code-block:: console
APP_DB='quartz'
APP_DB_PASS='SuperSecret';
DATA_DIR='/var/www/data'
CACHE_DIR='/var/www/cache'
APPS_DIR='/var/www/html/apps'
2024-07-10 21:07:28 +00:00
Install dependencies:
2024-07-10 20:42:54 +00:00
.. code-block:: console
apt-get -y install apache2 php-{pgsql,zip,gd,simplexml,curl,fpm} proftpd libapache2-mod-fcgid postfix python3-certbot-apache gdal-bin
2024-07-10 21:07:28 +00:00
Install QGIS Repository
2024-07-10 20:42:54 +00:00
.. code-block:: console
wget --no-check-certificate --quiet -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg
2024-07-10 21:07:28 +00:00
Check release using lsb_release -cs and create /etc/apt/sources.list.d/qgis.sources as below
.. code-block:: console
2024-07-10 20:42:54 +00:00
Types: deb deb-src
URIs: https://qgis.org/ubuntu
2024-07-10 20:52:49 +00:00
Suites: # use output from lsb_release -cs above
2024-07-10 20:42:54 +00:00
Architectures: amd64
Components: main
Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg
2024-07-10 21:07:28 +00:00
Update and install QGIS Server:
.. code-block:: console
2024-07-10 20:42:54 +00:00
apt-get update -y || true
2024-07-10 20:52:49 +00:00
2024-07-10 20:42:54 +00:00
apt-get install -y qgis-server
2024-07-10 21:07:28 +00:00
Create /etc/logrotate.d/qgisserver with below:
.. code-block:: console
2024-07-10 20:42:54 +00:00
2024-07-10 21:07:28 +00:00
/var/log/qgisserver.log {
2024-07-10 20:42:54 +00:00
su www-data www-data
size 100M
notifempty
missingok
rotate 3
daily
compress
create 660 www-data www-data
2024-07-10 21:07:28 +00:00
Create qgisserver.log and set permissions
.. code-block:: console
2024-07-10 20:42:54 +00:00
2024-07-10 20:56:03 +00:00
mkdir -p ${DATA_DIR}/qgis
chown www-data:www-data ${DATA_DIR}/qgis
2024-07-10 20:42:54 +00:00
touch /var/log/qgisserver.log
chown www-data:www-data /var/log/qgisserver.log
2024-07-10 21:07:28 +00:00
Set up Apache
2024-07-10 20:42:54 +00:00
.. code-block:: console
a2enmod ssl headers expires fcgid cgi
2024-07-10 21:07:28 +00:00
Copy conf files from installer directory
2024-07-10 20:42:54 +00:00
.. code-block:: console
2024-07-10 16:27:23 +00:00
2024-07-10 20:42:54 +00:00
cp installer/apache2.conf /etc/apache2/sites-available/default-ssl.conf
2024-07-10 16:27:23 +00:00
2024-07-10 21:07:28 +00:00
Copy conf files from installer directory and configure
.. code-block:: console
2024-07-10 20:42:54 +00:00
2024-07-10 21:07:28 +00:00
sed "s|\$DATA_DIR|$DATA_DIR|" < installer/qgis_apache2.conf > /etc/apache2/sites-available/qgis.conf
2024-07-10 20:42:54 +00:00
a2ensite 000-default default-ssl qgis
a2disconf serve-cgi-bin
2024-07-10 21:07:28 +00:00
Switch to mpm_event and use HTTP2
.. code-block:: console
2024-07-10 20:42:54 +00:00
a2enmod proxy_fcgi setenvif http2
2024-07-10 21:07:28 +00:00
a2enconf php8.1-fpm
2024-07-10 20:42:54 +00:00
a2enmod mpm_event
systemctl reload apache2
2024-07-10 21:07:28 +00:00
Set up ProFTPD
2024-07-10 20:42:54 +00:00
.. code-block:: console
sed -i.save '
s/#DefaultRoot~/DefaultRoot ~/
s/# RequireValidShelloff/RequireValidShell off/' /etc/proftpd/proftpd.conf
systemctl enable proftpd
systemctl restart proftpd
2024-07-10 21:07:28 +00:00
Create the PostgreSQL database
2024-07-10 20:42:54 +00:00
.. 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
2024-07-10 21:07:28 +00:00
Create the Data, Cache, and Apps directories
2024-07-10 20:42:54 +00:00
.. code-block:: console
2024-07-10 20:56:03 +00:00
mkdir -p "${APPS_DIR}"
mkdir -p "${CACHE_DIR}"
mkdir -p "${DATA_DIR}"
chown -R www-data:www-data "${APPS_DIR}"
chown -R www-data:www-data "${CACHE_DIR}"
chown -R www-data:www-data "${DATA_DIR}"
2024-07-10 20:42:54 +00:00
2024-07-10 21:07:28 +00:00
Give sync service +w to apps/1/images dir
2024-07-10 20:42:54 +00:00
.. code-block:: console
chmod -R g+w "${APPS_DIR}"
2024-07-10 21:07:28 +00:00
Create the admin/incl/const.php configuration file using values from above
2024-07-10 20:42:54 +00:00
.. code-block:: console
<?php
define("DB_HOST", "localhost");
define("DB_NAME", "${APP_DB}");
define("DB_USER", "${APP_DB}");
define("DB_PASS", "${APP_DB_PASS}");
define("DB_PORT", 5432);
define("DB_SCMA", 'public');
define("APPS_DIR", "${APPS_DIR}");
define("CACHE_DIR", "${CACHE_DIR}");
define("DATA_DIR", "${DATA_DIR}");
define("SUPER_ADMIN_ID", 1);
define("SESS_USR_KEY", 'quartz_user');
2024-07-10 21:07:28 +00:00
?>
2024-07-10 20:42:54 +00:00
2024-07-10 21:07:28 +00:00
Copy files from quartzmap directory to /var/www/html
2024-07-10 20:42:54 +00:00
.. 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 <<CAT_EOF
www-data ALL = NOPASSWD: /usr/local/bin/create_ftp_user.sh, /usr/local/bin/delete_ftp_user.sh, /usr/local/bin/update_ftp_user.sh
CAT_EOF
Optionally, install an SSL certificate using certbot
.. code-block:: console
certbot --apache --agree-tos --email hostmaster@yourdomain.com --no-eff-email -d yourdomain.com
2024-07-10 16:27:23 +00:00
2024-07-10 20:42:54 +00:00
Go to https://yourdomain.com/admin/setup.php to complete the installation