Update docs/source/install.rst

This commit is contained in:
AcuGIS 2024-07-10 21:07:28 +00:00
parent 80b6881d16
commit 7e5e545c80
1 changed files with 44 additions and 31 deletions

View File

@ -59,37 +59,46 @@ For below, we will use the following. You can adjust as needed
APPS_DIR='/var/www/html/apps'
1. Install dependencies:
Install dependencies:
.. 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
2. Install QGIS Server
Install QGIS Repository
.. code-block:: console
# Check 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 <<CAT_EOF
Check release using lsb_release -cs and create /etc/apt/sources.list.d/qgis.sources as below
.. code-block:: console
Types: deb deb-src
URIs: https://qgis.org/ubuntu
Suites: # use output from lsb_release -cs above
Architectures: amd64
Components: main
Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg
CAT_EOF
Update and install QGIS Server:
.. code-block:: console
apt-get update -y || true
apt-get install -y qgis-server
Create /etc/logrotate.d/qgisserver with below:
.. code-block:: console
if [ -d /etc/logrotate.d ]; then
cat >/etc/logrotate.d/qgisserver <<CAT_EOF
/var/log/qgisserver.log {
/var/log/qgisserver.log {
su www-data www-data
size 100M
notifempty
@ -98,9 +107,11 @@ For below, we will use the following. You can adjust as needed
daily
compress
create 660 www-data www-data
}
CAT_EOF
fi
Create qgisserver.log and set permissions
.. code-block:: console
mkdir -p ${DATA_DIR}/qgis
chown www-data:www-data ${DATA_DIR}/qgis
@ -108,38 +119,42 @@ For below, we will use the following. You can adjust as needed
touch /var/log/qgisserver.log
chown www-data:www-data /var/log/qgisserver.log
3. Set up Apache
Set up Apache
.. code-block:: console
a2enmod ssl headers expires fcgid cgi
4. Copy conf files from installer directory
Copy conf files from installer directory
.. code-block:: console
cp installer/apache2.conf /etc/apache2/sites-available/default-ssl.conf
sed "s|\$DATA_DIR|$DATA_DIR|" < installer/qgis_apache2.conf > /etc/apache2/sites-available/qgis.conf
Copy conf files from installer directory and configure
for f in default-ssl 000-default; do
sed -i.save "s/#ServerName example.com/ServerName ${HNAME}/" /etc/apache2/sites-available/${f}.conf
done
.. code-block:: console
sed "s|\$DATA_DIR|$DATA_DIR|" < installer/qgis_apache2.conf > /etc/apache2/sites-available/qgis.conf
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.)
Switch to mpm_event and use HTTP2
.. code-block:: console
a2enmod proxy_fcgi setenvif http2
a2enconf php${PHP_VER}-fpm
a2enconf php8.1-fpm
a2enmod mpm_event
systemctl reload apache2
5. Set up ProFTPD
Set up ProFTPD
.. code-block:: console
@ -149,7 +164,7 @@ For below, we will use the following. You can adjust as needed
systemctl enable proftpd
systemctl restart proftpd
6. Create the PostgreSQL database
Create the PostgreSQL database
.. code-block:: console
@ -161,7 +176,7 @@ For below, we will use the following. You can adjust as needed
psql -c "ALTER DATABASE quartz OWNER TO quartz"
CMD_EOF
7. Create the Data, Cache, and Apps directories
Create the Data, Cache, and Apps directories
.. code-block:: console
@ -176,17 +191,16 @@ For below, we will use the following. You can adjust as needed
8. Give sync service +w to apps/1/images dir
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
Create the admin/incl/const.php configuration file using values from above
.. code-block:: console
cat >admin/incl/const.php <<CAT_EOF
<?php
define("DB_HOST", "localhost");
define("DB_NAME", "${APP_DB}");
@ -199,10 +213,9 @@ For below, we will use the following. You can adjust as needed
define("DATA_DIR", "${DATA_DIR}");
define("SUPER_ADMIN_ID", 1);
define("SESS_USR_KEY", 'quartz_user');
?>
CAT_EOF
?>
10. Copy files from quartzmap directory to /var/www/html
Copy files from quartzmap directory to /var/www/html
.. code-block:: console