www-data ALL = NOPASSWD: /usr/local/bin/create_ftp_user.sh, /usr/local/bin/delete_ftp_user.sh
CAT_EOF
..note:: If you want to quickly install and test Lizmap Web Client in a few steps, you can follow those
`instructions <https://github.com/3liz/lizmap-docker-compose>`_ using Docker and Docker-Compose.
..note:: In Debian distributions, you can work as administrator (log in with ``root``), without using ``sudo`` on contrary to Ubuntu.
Generic Server Configuration with Nginx server
==============================================
This documentation provides an example for configuring a server with the Debian 11 distribution. We assume you have base system installed and updated.
..warning:: This page does not describe how to secure your Nginx server. It's just for a demonstration.
Configure Locales
-----------------
For simplicity, it is interesting to configure the server with UTF-8 default encoding.
..code-block:: bash
# configure locales
locale-gen fr_FR.UTF-8 #replace fr with your language
dpkg-reconfigure locales
# define your timezone [useful for logs]
dpkg-reconfigure tzdata
apt install ntp ntpdate
..note:: It is also necessary configure the other software so that they are using this default encoding if this is not the case.
Installing necessary packages
-----------------------------
..warning:: Lizmap web client 3.6 is based on Jelix 1.8. You must install at least the **7.4** version of PHP. The **dom**, **simplexml**, **pcre**, **session**, **tokenizer** and **spl** extensions are required (they are generally turned on in a standard PHP 7/8 installation)
..code-block:: bash
sudo su # only necessary if you are not logged in as root
You must restart the Nginx server to validate the configuration.
..code-block:: bash
service nginx restart
Enable geolocation
==================
The automatic geolocation provided by Lizmap relies on Google services. To enable it, your webGIS must be placed under a secure protocol, like HTTPS. See for more details:
Lizmap Web Client tests whether the spatialite support is enabled in PHP. If it is not, then spatialite layers will not be used in the editing tool. You can always use PostgreSQL data for editing.
Give the appropriate rights to the directory containing Spatialite databases
So that Lizmap Web Client can modify the data contained in databases Spatialite, we must ensure that **the webserver user (www-data) has well write access to the directory containing each Spatialite file**
For example, if a directory contains a QGIS project, which uses a Spatialite database placed in a **db** directory at the same level as the QGIS project:
..code-block:: bash
/path/to/a/lizmap_directory
|--- mon_projet.qgs
|--- bdd
|--- my_spatialite_file.sqlite
So you have to give the rights in this way:
..code-block:: bash
chown :www-data /path/to/a/lizmap_directory -R
chmod 775 /path/to/a/lizmap_directory -R
..note::
So if you want to install Lizmap to provide access to multiple map publishers, you should tell them to
always create a **db** directory at the same level as the QGIS projects in the Lizmap Web Client directory.
This will facilitate the admin work that just have to change the rights of this unique directory.
Configuring Lizmap and launching the installer
================================================
Give the appropriate rights to directories and files
Set rights for Nginx/Apache, so PHP scripts could write some temporary files or do changes.
..code-block:: bash
cd /var/www/lizmap-web-client-$VERSION/
lizmap/install/set_rights.sh www-data www-data
Setup configuration
-------------------
Create :file:`lizmapConfig.ini.php`, :file:`localconfig.ini.php` and edit them
to set parameters specific to your installation. You can modify :file:`lizmapConfig.ini.php`
to set the url of qgis map server and other things.
..code-block:: bash
cd lizmap/var/config
cp lizmapConfig.ini.php.dist lizmapConfig.ini.php
cp localconfig.ini.php.dist localconfig.ini.php
cd ../../..
Launching the installer
-----------------------
After creating configuration files, you can launch the installer
..code-block:: bash
php lizmap/install/installer.php
It will finished the installation, and will create all SQL tables needed by Lizmap.
Adding some demonstration projects
----------------------------------
If you want to test Lizmap with some demonstration projects, you must install ``unzip`` and either ``wget`` or ``curl``.
..code-block:: bash
lizmap/install/reset.sh --keep-config --demo
First test
----------
For testing launch: ``http://localhost/lizmap`` in your browser.
In case you get a ``500 - internal server error``, run again:
..code-block:: bash
cd /var/www/lizmap-web-client-$VERSION/
lizmap/install/set_rights.sh www-data www-data
..note:: Replace ``localhost`` with the address or IP number of your server.
In the administration panel, you should check the :guilabel:`QGIS server version` and the :guilabel:`WMS server URL` with the URL of QGIS Server.
..warning::
Before trying to have a QGIS project working in Lizmap, you **must** have the communication between QGIS Server and Lizmap Web Client working properly.
Versions about QGIS Server plugins **must** be visible from the administration interface. Please read :ref:`lizmap-server-plugin`.
If you didn't install the demo, you can check that you have well installed Lizmap and configured QGIS Server within Lizmap by checking the ``qgis_server`` section in this URL: