### Install Lizmap Demo Projects Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md Installs demonstration projects for testing Lizmap functionality. This requires `unzip` and either `wget` or `curl` to be installed on the system. The `--keep-config` flag preserves existing configurations. ```bash lizmap/install/reset.sh --keep-config --demo ``` -------------------------------- ### Install Lizmap Modules using Composer Source: https://context7.com/3liz/lizmap-documentation/llms.txt This bash script outlines the process for installing additional Lizmap modules. It involves navigating to the Lizmap installation directory, setting up Composer, installing a specific module (e.g., PgMetadata), configuring it, running the installer, and updating modules. ```bash # Navigate to Lizmap installation cd /var/www/lizmap-web-client/ # Setup Composer for module management cp -n lizmap/my-packages/composer.json.dist lizmap/my-packages/composer.json composer install --working-dir=lizmap/my-packages # Install a module (example: PgMetadata) composer require --working-dir=lizmap/my-packages "lizmap/lizmap-pgmetadata-module" # Configure the module php lizmap/install/configurator.php pgmetadata # Run installer to complete setup php lizmap/install/installer.php lizmap/install/clean_vartmp.sh lizmap/install/set_rights.sh www-data www-data # Update modules to latest version composer update --working-dir=lizmap/my-packages ``` -------------------------------- ### Enable and Start QGIS Server Service Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/py-qgis-server.md Enables the QGIS Server systemd service to start automatically on system boot and then starts the service immediately. ```bash systemctl enable qgis service qgis start ``` -------------------------------- ### Run Lizmap Installation Script Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md Executes the Lizmap installation script to set up necessary SQL tables and finalize the installation. This script is typically run after configuring the environment and setting appropriate permissions. ```bash cd /var/www/lizmap-web-client-$VERSION/ lizmap/install/set_rights.sh www-data www-data ``` -------------------------------- ### Use Environment Variables for PostgreSQL Credentials Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/advanced_install.md This example demonstrates how to use environment variables (e.g., `LIZMAP_PGSQL_HOST`) to configure PostgreSQL connection details in `profiles.ini.php`. This enhances security by avoiding hardcoding sensitive information. ```bash LIZMAP_PGSQL_HOST=localhost LIZMAP_PGSQL_DATABASE=lizmap LIZMAP_PGSQL_LOGIN=admin LIZMAP_PGSQL_PASSWORD="Sup3Rp4ssw0rd!" ``` ```ini [jdb:jauth] driver="pgsql" database=${LIZMAP_PGSQL_DATABASE} host=${LIZMAP_PGSQL_HOST} user=${LIZMAP_PGSQL_LOGIN} password=${LIZMAP_PGSQL_PASSWORD} ``` -------------------------------- ### Launch Lizmap Web Installer Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md Initiates the Lizmap web installer process after configuration files have been set up. This command-line execution creates the necessary SQL tables for Lizmap to function. ```bash php lizmap/install/installer.php ``` -------------------------------- ### Configure and Finalize Lizmap Module Installation Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md This snippet covers the post-installation steps for Lizmap modules, regardless of the installation method. It includes running the module configurator, the main Lizmap installer, and cleanup scripts to ensure the module is properly set up and integrated. ```bash php lizmap/install/configurator.php name_of_the_module # example: php lizmap/install/configurator.php pgmetadata php lizmap/install/installer.php lizmap/install/clean_vartmp.sh lizmap/install/set_rights.sh ``` -------------------------------- ### Download and Install Lizmap Web Client Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md Sets environment variables for Lizmap version and installation location, downloads the specified version of Lizmap Web Client, unzips it, creates a symbolic link for web access, and removes the downloaded archive. ```bash VERSION=3.9.0 LOCATION=/var/www cd $LOCATION wget https://github.com/3liz/lizmap-web-client/releases/download/$VERSION/lizmap-web-client-$VERSION.zip # Unzip archive unzip lizmap-web-client-$VERSION.zip # virtual link for http://localhost/lizmap/ ln -s $LOCATION/lizmap-web-client-$VERSION/lizmap/www/ /var/www/html/lizmap # Remove archive rm lizmap-web-client-$VERSION.zip ``` -------------------------------- ### Install Transifex CLI on Linux Source: https://github.com/3liz/lizmap-documentation/blob/master/DEV.md Downloads and installs the Transifex Command Line Interface (CLI) tool on a Linux system. This tool is essential for managing translations with Transifex. ```bash cd /tmp; \ curl -L "https://github.com/transifex/cli/releases/latest/download/tx-linux-amd64.tar.gz" | tar xz --skip-old-files; \ sudo mv tx /usr/local/bin/tx ``` -------------------------------- ### QGIS Server XML Error Example Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/pre_requirements.md This snippet shows a typical XML error response from QGIS Server, indicating a 'Project file error'. This output is useful for initial verification of the QGIS Server setup before configuring Lizmap. ```xml Project file error ``` -------------------------------- ### Install Py-QGIS-Server and Dependencies Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/py-qgis-server.md Installs necessary system packages and sets up a Python virtual environment for Py-QGIS-Server. It then installs the Py-QGIS-Server package and its dependencies using pip within the virtual environment. ```bash apt install python3-venv python3-psutil set -e python3 -m venv /opt/local/py-qgis-server --system-site-packages /opt/local/py-qgis-server/bin/pip install -U pip setuptools wheel pysocks typing py-qgis-server ``` -------------------------------- ### Install Lizmap Web Client on Debian/Ubuntu Source: https://context7.com/3liz/lizmap-documentation/llms.txt Installs Lizmap Web Client, its dependencies, and configures necessary directories and permissions on a Debian-based Linux system. This includes installing Nginx, PHP 8.3 with extensions, downloading and extracting Lizmap, setting up configuration files, and running the installer. ```bash # Install required packages sudo apt update sudo apt install curl openssl nginx-full nginx nginx-common # Install PHP 8.3 with required extensions sudo apt install php8.3-fpm php8.3-cli php8.3-bz2 php8.3-curl php8.3-gd \ php8.3-intl php8.3-mbstring php8.3-pgsql php8.3-sqlite3 php8.3-xml \ php8.3-ldap php8.3-redis php8.3-cgi # Create data directories mkdir -p /home/data/cache/ # Download and install Lizmap VERSION=3.9.0 LOCATION=/var/www cd $LOCATION wget https://github.com/3liz/lizmap-web-client/releases/download/$VERSION/lizmap-web-client-$VERSION.zip unzip lizmap-web-client-$VERSION.zip ln -s $LOCATION/lizmap-web-client-$VERSION/lizmap/www/ /var/www/html/lizmap rm lizmap-web-client-$VERSION.zip # Create configuration files cd lizmap/var/config cp profiles.ini.php.dist profiles.ini.php cp lizmapConfig.ini.php.dist lizmapConfig.ini.php cp localconfig.ini.php.dist localconfig.ini.php cd ../../.. # Set permissions and run installer lizmap/install/set_rights.sh www-data www-data php lizmap/install/installer.php # Optionally install demo projects lizmap/install/reset.sh --keep-config --demo # Test installation: http://localhost/lizmap # Check QGIS Server status: http://localhost/lizmap/index.php/view/app/metadata # Expected response: # {"qgis_server":{"test":"OK","mime_type":"text/xml; charset=utf-8"}} ``` -------------------------------- ### Install Lizmap Module with Composer Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md Installs a Lizmap module using Composer, PHP's package manager. This method requires Composer to be installed and the module to be available as a Composer package. It involves creating a composer.json file, installing dependencies, and then requiring the specific module package. ```bash cp -n lizmap/my-packages/composer.json.dist lizmap/my-packages/composer.json composer install --working-dir=lizmap/my-packages composer require --working-dir=lizmap/my-packages "lizmap/lizmap-pgmetadata-module" composer update --working-dir=lizmap/my-packages ``` -------------------------------- ### Install Lizmap Server Plugin using QGIS-Plugin-Manager Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/pre_requirements.md This snippet demonstrates the correct command to install the 'Lizmap server' plugin for QGIS Server using the qgis-plugin-manager. It highlights the difference between the server plugin and the desktop plugin to avoid installation errors. ```bash # Not correct, this plugin is only for QGIS desktop # qgis-plugin-manager install Lizmap # Correct, the plugin designed for QGIS server qgis-plugin-manager install 'Lizmap server' ``` -------------------------------- ### Install Sphinx and Dependencies (Bash) Source: https://github.com/3liz/lizmap-documentation/blob/master/README.md Installs Python virtual environment and project dependencies using pip. This is a prerequisite for building the documentation. ```bash python3 -m venv .venv .venv/bin/pip install -r requirements.txt ``` -------------------------------- ### Install Lizmap Module Manually (Without Composer) Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md Installs a Lizmap module by manually extracting its files. This method is used when a module is not available as a Composer package. It involves unzipping the module into the designated directory and then proceeding with configuration and installation steps. ```bash unzip /path/to/module.zip -d lizmap/lizmap-modules/ ``` -------------------------------- ### Install PostgreSQL and PostGIS on Debian 12 Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md Installs PostgreSQL, PostGIS, and pgtune on Debian 12. This is a prerequisite for managing spatial data centrally with Lizmap. ```bash apt install postgresql postgresql-contrib postgis pgtune ``` -------------------------------- ### Install PostgreSQL PHP Extension Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md Installs the PostgreSQL extension for PHP 8.3 and restarts the PHP-FPM service to enable the extension for Lizmap. ```bash apt install php8.3-pgsql service php8.3-fpm restart ``` -------------------------------- ### Execute Lizmap Installation and Configuration Scripts Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/upgrade.md These commands are used to clean temporary files, run the Lizmap configurator to upgrade configuration files, and then execute the installer to upgrade database tables and data. They are essential for completing the Lizmap upgrade process. ```bash sudo lizmap/install/clean_vartmp.sh php lizmap/install/configurator.php php lizmap/install/installer.php ``` -------------------------------- ### Lizmap Log Storage File Path (Bash Example) Source: https://github.com/3liz/lizmap-documentation/blob/master/source/admin/logs.md This example shows the typical file path for the Lizmap log database (`logs.db`) based on a common installation directory. The logs are stored in a SQLite database, which can be accessed using SQLite tools or SQL queries. ```bash # if Lizmap Web Client is installed here : /var/www/lizmap-web-client-2.8.1/, the file is: /var/www/lizmap-web-client-2.8.1/lizmap/var/logs.db ``` -------------------------------- ### Configure Lizmap Settings Files Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md Copies default configuration files and prepares them for customization. This step involves creating `lizmapConfig.ini.php` and `localconfig.ini.php` from their distribution templates, allowing users to set specific parameters like the QGIS map server URL. ```bash cd lizmap/var/config cp lizmapConfig.ini.php.dist lizmapConfig.ini.php cp localconfig.ini.php.dist localconfig.ini.php cd ../../.. ``` -------------------------------- ### Convert PNG to JPG using GraphicsMagick Source: https://github.com/3liz/lizmap-documentation/blob/master/source/images/README.md Demonstrates how to install GraphicsMagick and use its 'gm convert' command for image conversion. This method is suggested as potentially yielding better results than ImageMagick. ```bash sudo apt install graphicsmagick gm convert image.png image.jpg ``` -------------------------------- ### Configure QGIS_SERVER_LIZMAP_REVEAL_SETTINGS Environment Variable Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/pre_requirements.md This snippet shows how to enable the QGIS_SERVER_LIZMAP_REVEAL_SETTINGS environment variable to expose server settings for Lizmap Web Client. It provides examples for Apache FCGI and Nginx fastcgi configurations. ```ini # Apache FCGI example FcgidInitialEnv QGIS_SERVER_LIZMAP_REVEAL_SETTINGS True # nginx fastcgi fastcgi_param QGIS_SERVER_LIZMAP_REVEAL_SETTINGS True; ``` -------------------------------- ### QGIS Popup Configuration for Media Display Source: https://github.com/3liz/lizmap-documentation/blob/master/source/publish/configuration/media.md This example demonstrates how to configure QGIS popups to display media files based on attribute fields. It shows the HTML structure needed for images and links, using QGIS's expression syntax for dynamic content. ```html ``` -------------------------------- ### Configure Lizmap profiles.ini.php for PostgreSQL Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md Copies the default profiles.ini.php.dist to profiles.ini.php and configures it to use PostgreSQL for authentication and logging. It includes parameters for host, port, database, user, password, and search path. ```bash cd lizmap/var/config cp profiles.ini.php.dist profiles.ini.php cd ../../.. ``` -------------------------------- ### Create Py-QGIS-Server Directories Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/py-qgis-server.md Creates essential directories required by Py-QGIS-Server for storing plugins, configuration files, project data, logs, and server state. ```bash mkdir -p /srv/qgis/plugins /srv/qgis/config /srv/data /var/log/qgis /var/lib/py-qgis-server ``` -------------------------------- ### Build Documentation with Sphinx (Bash) Source: https://github.com/3liz/lizmap-documentation/blob/master/README.md Commands to build the documentation in HTML format using Sphinx. `make gettext && make html` builds all languages, while `make htmlen` builds only English. Removing the build directory (`rm -rf build/`) ensures all warnings are shown. ```bash make gettext && make html ``` ```bash make htmlen ``` ```bash rm -rf build/ && make htmlen ``` -------------------------------- ### Configure WebDAV Storage in Lizmap Profiles Source: https://github.com/3liz/lizmap-documentation/blob/master/source/publish/lizmap_plugin/editing.md This configuration snippet shows how to set up a default WebDAV connection in Lizmap's profiles.ini.php file. It specifies the base URI, enables the connection, and provides optional user credentials for authentication. Ensure the baseUri matches the one configured in the Attachment widget. ```ini [webdav:default] baseUri=https://webdav/dav/ enabled=1 user=mywebdavuser password=mywebdavpassword ``` -------------------------------- ### Lizmap PostgreSQL Database Configuration Example Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/upgrade.md This INI configuration demonstrates how to connect Lizmap to a PostgreSQL database for user authentication and logs. It includes parameters for the driver, host, port, database name, user, password, and search path. This configuration is used after migrating from SQLite. ```ini [jdb:jauth] driver=pgsql host=localhost port=5432 database="your_database" user=my_login password=my_password search_path=lizmap,public [jdb:lizlog] driver=pgsql host=localhost port=5432 database="your_database" user=my_login password=my_password search_path=lizmap,public ``` -------------------------------- ### Lizmap Iframe Embedding URL Example Source: https://github.com/3liz/lizmap-documentation/blob/master/source/publish/customization/iframe.md This example shows the URL structure for embedding a Lizmap project within an iframe. The 'embed' view is suggested for a lighter interface compared to the standard 'map' view. This is useful for integrating Lizmap functionality into other web applications. ```html ``` -------------------------------- ### Directory Structure for Shared Media Folder Source: https://github.com/3liz/lizmap-documentation/blob/master/source/publish/configuration/media.md This bash snippet illustrates a recommended directory structure for a shared media folder. It shows how to organize JavaScript files, themes (CSS), and other media assets in a root 'media' folder, alongside project-specific folders. ```bash ├── media │   └── js │   | └── default │   | ├── another_script.js │   | └── one_script.js │   └── themes │   | └── default │   | └── css │   | ├── main.css │   | └── map.css │   └── photo_1.jpg ├── my_repository │   ├── project_a.qgs │   ├── project_a.qgs.cfg │   ├── project_b.qgs │   └── project_b.qgs.cfg └── other_repo ├── media │   └── js │   ├── default │   │   └── script_for_all_projects_in_other_repo.js │   └── project_x │   └── script_for_project_x.js ├── project_x.qgs ├── project_x.qgs.cfg ├── project_y.qgs ├── project_y.qgs.cfg ├── project_z.qgs └── project_z.qgs.cfg ``` -------------------------------- ### Lizmap PostgreSQL Search Path Configuration Source: https://github.com/3liz/lizmap-documentation/blob/master/source/install/linux.md Example of configuring the `search_path` in `profiles.ini.php` to include multiple schemas ('lizmap', 'my_schema', 'public') for Lizmap to access. ```ini search_path=lizmap,my_schema,public ```