Installation de Lizmap sous Windows
Note
Si vous voulez installer rapidement pour tester Lizmap Web Client en quelques étapes, suivez ces instructions.
La documentation montre les étapes nécessaires à l’installation de Lizmap Web Client dans un environnement Windows 7 et Windows 10. Les autres versions de Windows ne devraient pas poser de problème.
Note
Dans la documentation la version 3.3 de Lizmap Web Client est utilisée. Soyez certain de l’adapter en fonction de la version que vous voulez installer (la dernière est recommandée).
Prérequis
Text Editor (e.g. Notepad++ , Visual Studio Code )
Microsoft Visual C++ Redistributable 64-bits (cette installation a besoin de respecter la version compilée d’Apache et de PHP) ( Microsoft VCs C++ )
Web Server (Apache 24 64-bits )
PHP 7.3.10 (Non Thread Safe )
QGIS Server 3 64-bits (OSGeo4W Network Installer (64 bit))
Lizmap Web Client 3.x (Github Lizmap releases )
Configuration du serveur Apache 2.4.41
Commencez par la création d’un dossier près de C:\ (e.g. C:\webserver). Après cela, téléchargez la version 64 bits d’Apache et ses modules. Au moment d’écrire cette documentation, nous utilisons la version compilée VC16.
Note
You can use others installations of Apache but you need to be careful and install the correct the Microsoft Visual C++ Redistributables (e.g. VC15, VC16) and their modules for a correct Apache installation.
Extract the Apache24 zip file into C:\webserver\ and change the name from httpd-2.4.41-win64-VS16 to Apache24. After that unzip all modules and copy all .so files into the folder C:\webserver\Apache24\modules. Then you open the Apache configuration in C:\webserver\Apache24\conf\httpd.conf and edit with the text editor and replace the global variable ServerRoot to C:\webserver\Apache24. This action will allow Apache to recognize the path of Apache installation.
Define SRVROOT "c:/webserver/Apache24" #Variable to define the root folder
ServerRoot "${SRVROOT}"
The purpose of using the variable SRVROOT is the automatic replace of ${SRVROOT} to recognize the path that you define in the rest of the file. Now t’s time to see what port is « listen » by the Apache. By default, Apache uses the port 80.
Note
Si un autre port doit être utilisé, par ex. ** 1664 **, ajoutez l’option ** Listen ** au fichier Apache ** httpd.conf ** :
Listen 80 #Activated Default Apache port
#Listen 1664 Example port if default Apache port is taken
#You can activate or deactivate the ports using the # symbol
After choosing the port, is time to activate the Apache modules in the configuration file. For this action, you need to change the Apache configuration in C:\webserver\Apache24\conf\httpd.conf and enable the modules that you need. Search for LoadModule command lines and then uncheck ( remove #) of the following modules:
LoadModule fcgid_module modules/mod_fcgid.so
LoadModule actions_module modules/mod_actions.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule headers_module modules/mod_headers.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule expires_module expires_module modules/mod_expires.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule ident_module modules/mod_ident.so
Note
If it’s necessary to use a different port then is necessary to active other modules associated with the proxy module:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule cache_module modules/mod_cache.so
LoadModule cache_disk_module modules/mod_cache_disk.so
Après cette modification, cherchez avec Ctrl+F la variable ServerName et ajoutez à la suite les mots suivants ServerName localhost. Si vous continuez dans ce fichier, vous allez trouver « DirectoryIndex index.html » qui est à remplacer par DirectoryIndex index.html index.php et sauvegarder le fichier.
Démarrer Apache en ouvrant l’invite de commande avec Windows+R et taper cmd, ensuite écrire dans le shell C:\webserver\Apache24\bin\httpd.exe et ne fermez pas la fenêtre cmd.
Avertissement
Il est important d’effectuer un CLIQUE DROIT et « Exécuter en tant qu’administrateur » pour avoir accès à toutes les fonctions. Il faut le faire à chaque fois que l’on souhaite utiliser le Shell
Pressing Enter after the instruction in the command line will result in a dialogue of windows firewall where is need to check the option Allow Access For all.
Using a browser, write http://localhost and press enter, if everything went right in installation this will open the page with the text « It Works ».
Avertissement
Si vous n’avez pas d’alerte du pare-feux Windows, cela signifie sûrement que vous avez un anti-virus qui le gère. Dans ce cas, vous devez modifier la configuration pour ajouter manuellement le service apache. Autre astuce, si le pare-feux Windows n’indique pas la boite de dialogue précédente, vous devez ajouter manuellement le port 80 en entrée et sortie dans les propriétés avancées du pare-feux windows (panneau de configuration > outils d’administration > Pare-feux windows avec sécurité avancée)
Open the cmd where you run the previous command to start Apache and press Ctrl+C to stop Apache. To add the Apache in Windows System Path and have access directly in the cmd it’s necessary hold the Windows and search for Edit System environments. After clicking in the result will appear a dialog with Environment Variables. The next step is to append (not replace!) ;C:\webserver\Apache24\bin to the Path variable (double-click in « Path » line). After this step, close cmd , reopen cmd and check Apache is correctly declare in the System path. For this test, open cmd type httpd then hit enter this will run Apache, if Yes stop using the combination keys Ctrl+C.
Il est maintenant temps d’ajouter Apache comme service. Pour cela, vous devez ouvrir un terminal et taper httpd -k install. Cela va démarrer Apache comme un service Windows.
After test with success the Apache installation, it’s time to add the rest of Apache configurations that will serve the QGIS Server and the Lizmap Web Client. Open again the configuration file C:\webserverApache24\httpd.conf and add the following lines at the end of the file:
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\\.0[678] no-gzip
BrowserMatch \\bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \\.(?:gif|jpe?g|png|rar|zip)$ no-gzip dont-vary
Header append Vary User-Agent env=!dont-vary
</IfModule>
This configuration is important to deal with the files compression. After this configuration restart the Apache in the Windows command line using the following command httpd -k restart and press Enter to receive the new configuration. Now is time to prepare the configurations that will serve the php version. Start with a creation of an Apache configuration file to use the PHP configuration in C:\webserver\Apache24\conf\extra\ with the name of php73.conf. This can be done if you open a text editor (e.g. Notepad++, Visual Studio Code, etc) and save it with the following code:
FcgidInitialEnv PHPRC "C:\webserver\php73"
<FilesMatch \.php$>
AddHandler fcgid-script .php
FcgidWrapper "C:/webserver/php73/php-cgi.exe" .php
</FilesMatch>
FcgidInitialEnv PHPRC "C:\\webserver\\php73"
FcgidInitialEnv PATH "C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis-ltr\bin;C:\OSGeo4W64\apps\Qt5\bin;C:\OSGeo4W64\apps\grass\grass-6.4.3\lib;C:\OSGeo4W64\apps\grass\grass-6.4.3\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\WBem"
FcgidInitialEnv QT_PLUGIN_PATH "C:\OSGeo4W64\apps\qgis-ltr\qtplugins;C:\OSGeo4W64\apps\Qt5\plugins"
FcgidInitialEnv PYTHONHOME "C:\OSGeo4W64\apps\Python37"
FcgidInitialEnv PYTHONPATH "C:\OSGeo4W64\apps\qgis-ltr\.\python;C:\OSGeo4W64\apps\qgis-ltr\.\python\plugins;C:\OSGeo4W64\apps\Python37\DLLs;C:\OSGeo4W64\apps\Python37\lib;C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\Python37;C:\OSGeo4W64\apps\Python37\lib\site-packages"
FcgidInitialEnv QGIS_SERVER_LOG_LEVEL 0
FcgidInitialEnv QGIS_SERVER_LOG_FILE "C:\webserver\Apache24\logs\qgis_server.log"
FcgidIOTimeout 120
FcgidInitialEnv LC_ALL "en_US.UTF-8"
FcgidInitialEnv PYTHONIOENCODING UTF-8
FcgidInitialEnv LANG "en_US.UTF-8"
FcgidInitialEnv QGIS_DEBUG 1
FcgidInitialEnv QGIS_SERVER_LOG_FILE "C:\webserver\Apache24\logs\qgis_server.log"
FcgidInitialEnv QGIS_SERVER_LOG_LEVEL 0
FcgidInitialEnv QGIS_PLUGINPATH "C:\OSGeo4W64\apps\qgis-ltr\python\plugins"
SetEnvIf Request_URI ^/qgis QGIS_PREFIX_PATH "C:\OSGeo4W64\apps\qgis-ltr"
SetEnvIf Request_URI ^/qgis TEMP "C:\Windows\Temp"
SetEnvIf Request_URI ^/qgis GDAL_DATA "C:\OSGeo4W64\share\gdal"
SetEnvIf Request_URI ^/qgis GDAL_DRIVER_PATH "C:\OSGeo4W64\bin"
SetEnvIf Request_URI ^/qgis PDAL_DRIVER_PATH "C:\OSGeo4W64\bin"
SetEnvIf Request_URI ^/qgis GDAL_SKIP "JP2ECW"
SetEnvIf Request_URI ^/qgis PROJ_LIB "C:\OSGeo4W64\share\proj"
<FilesMatch \.php$>
AddHandler fcgid-script .php
FcgidWrapper "C:/webserver/php73/php-cgi.exe" .php
</FilesMatch>
Note
Assurez-vous que vous avez l’extension .conf dans ce fichier.
Allez sur http.conf et décommentez la ligne Include conf/extra/httpd-vhosts.conf. Cela vous permettra d’ajouter de nouveaux hôtes virtuels dans le fichier ** C:/webserver/Apache24/conf/extra/httpd-vhosts.conf**. Inclure les vhosts pour créer la configuration des nouveaux hôtes virtuels dans le fichier ** C:/webserver/Apache24/conf/extra/httpd-vhosts.conf**. Vous pouvez commenter ou supprimer les deux exemples à l’intérieur (approximativement entre les lignes 23 et 38). Si vous ajoutez le commentaire dans les exemples par défaut, copiez et collez ces configurations après les configurations par défaut:
<VirtualHost *:80>
Include conf/extra/php73.conf #include the diretory conf file for php73 configuration
ServerName localhost # name of the server, in this case is localhost
DocumentRoot "C:/webserver/lizmap/" #Path to the root document Directory
<Directory "C:/webserver/lizmap">
Options -Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Require all granted
</Directory>
CustomLog "logs/lizmap-access.log" common
ErrorLog "logs/lizmap-error.log"
<IfModule mod_fcgid.c>
RewriteEngine on
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
#Parameters for maximum requests and timeout connections of fgci module
<IfModule fcgid_module>
FcgidMaxRequestLen 51200000
FcgidConnectTimeout 60
</IfModule>
</VirtualHost>
After this step save the file.
Avertissement
The previous configuration will help us to check if apache is correctly configurated. The same file will be use to increment the rest of addition along te installation. In the Preparing the home of Lizmap Web Client Section this configuration will be changed to receive two environments.
Configuration php 7.3.10
Avertissement
Lizmap Web Client s’appuie sur Jelix 1.6. Vous devez installer au minimum la version 7 de PHP. Les extensions dom, simplexml, pcre, session, tokenizer et spl sont requises (elles sont actives en général dans une installation standard de PHP 7.x).
For this installation we use the PHP 7.3.10, if you install the previouly the Microsoft Visual C++ Redistributable for Apache version of this documentation, you don’t need to install again. Go to PHP binaries and download the link with the name Zip, make sure it is the non-thread-safe file.
After download create a folder in C:\webserver\ with name php73 and unzip the files into it. Go to the file C:\webserver\php73\php.ini-production and change into C:\webserver\php73\php.ini. Open the php.ini and search for extension dir directive and change to the properly locate of EXT folder, make sure that you enter the full path like this extension_dir = « C:\webserver\php73\ext ». Now is time to activate the php modules, for this task you need to uncomment the following lines:
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_mbstring.dll
; driver for PostgreSQL
extension=php_pdo_pgsql.dll
; driver for SQLite
extension=php_pdo_sqlite.dll
; driver for PostgreSQL
extension=php_pgsql.dll
; driver for SQLite3
extension=php_sqlite3.dll
After the activation of the php extensions, in the same file change the upload values from default value to 15M and will stay like upload_max_filesize = 15M. Please, do the same for post_max_size and change from default value to post_max_size = 15M and save the changes in the file. Before you close this file, create a folder with the name sessions in C:\webserver and add the following path:
; The path can be defined as:
;
session.save_path = "C:\webserver\sessions"
;
Add the PHP to your Windows System Path allowing to you call the apache directly in the cmd. For this task, you hold the Windows key and press Pause. Then, click in Advanced System Settings and then in Environment Variables. The next step is to append (not replace!) the path ;C:\webserver\php-7.3 to the Path variable (double-click in « Path » line). After this step, close cmd , reopen cmd and check PHP is correctly declare in the System path using cmd and typing php -m You will check now the Apache configuration with httpd -S.
Créez un dossier avec le nom lizmap dans C:/webserver et dans le C:/webserver/lizmap, ajoutez un fichier avec l’extension PHP et enregistrez avec ce code à l’intérieur du fichier:
<?php phpinfo(); ?>
Redémarrez Apache en ligne de commande avec: httpd -k restart et voyez si tout va bien. Si OUI, ouvrez le navigateur et tapez http://localhost/index.php et apparaîtra la page des propriétés PHP, nous supposons que vous installez correctement le PHP.
Installation de QGIS Serveur
Rendez vous à http://www.qgis.org et téléchargez le fichier Osgeo4W Network installer (64 bit) (par ex. http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe) et exécutez l’installateur. Choisissez les options suivantes:
Installation avancée ;
Installation depuis internet ;
Root Directory C:\OSGeo4W64 et install for all users;
Conserver les valeurs par défaut de Local Package Directory et Start Menu Name;
Ne configurez pas le proxy si ce n’est pas nécessaire;
Choose a download site (e.g. https://download.osgeo.org );
Sélectionné les paquets : Commandline_Utilities/gdal, Desktop/Qgis full , Web/Qgis server, lib/fcgi ensuite Next (À des fins de stabilité nous utilisons la version QGIS LTR)
Accept to get packages to meet dependencies : Next then Wait for the download to be completed and Agree to all licenses.
Note
Ce processus peut être long (~ 1 heure).
After the installation we need to configure QGIS Server to be accessible as fcgi, so you need to modify the previous file of virtual hosts in the directory C:\webserver\Apache24\conf\extra\httpd-vhosts.conf to have this content:
<VirtualHost *:80>
Include conf/extra/php73.conf
ServerName localhost # name of the server, in this case is localhost
DocumentRoot "C:/webserver/lizmap/" #Path to the root document Directory
<Directory "C:/webserver/lizmap">
Options -Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Require all granted
</Directory>
# Added QGIS Server Folder
Alias /qgis/ "C:/OSGeo4W64/apps/qgis-ltr/bin/"
<Directory "C:/OSGeo4W64/apps/qgis-ltr/bin/">
SetHandler fcgid-script
Options +ExecCGI
AllowOverride All
Require all granted
</Directory>
CustomLog "logs/lizmap-access.log" common
ErrorLog "logs/lizmap-error.log"
<IfModule mod_fcgid.c>
RewriteEngine on
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
#Parameters for maximum requests and timeout connections of fgci module
<IfModule fcgid_module>
FcgidMaxRequestLen 51200000
FcgidConnectTimeout 60
</IfModule>
</VirtualHost>
After the changes restart apache, type in command line the instruction:
httpd -k restart
Now it’s time to test the QGIS Server and see if is accessible in fcgi typing in the browser the following link: http://localhost/qgis/qgis_mapserv.fcgi.exe and if everything is right you will receive the following response:
<ServiceExceptionReport version="1.3.0">
ServiceException code="OperationNotSupported">Please check the value of the REQUEST parameter</ServiceException>
</ServiceExceptionReport>
Preparing the home of Lizmap Web Client
Is usefull to have 2 environments, one for production and other for preproduction (or master to test new features), for this action you will need to create the folders C:\webserver\lizmap\prod\ and C:\webserver\lizmap\preprod\ and change the Apache VirtualHost configuration file.
First, go to 3Liz Github repository tags and get the last version in ZIP format. For example, you can use Lizmap-web-client 3.3.4 for prod folder.
Each environment will have a version in parallel. For example: release_3_3 and master. For that you need to unzip in C:\webserver\lizmap\prod the release_3_3 version and C:\webserver\lizmap\preprod the master version. Then you can create a directory where you will put the tile cache for production environment C:\webserver\cache\prod and for master environment C:\webserver\cache\preprod. After create the cache folders, modify the virtual host to point to the www folders of lizmap web client application for each environment. Go to the file C:\webserver\Apache24\conf\extra\httpd-vhosts.conf and change to the following configuration:
# example configuration in httpd-vhosts.conf
<VirtualHost *:80>
Include conf/extra/php73.conf
ServerName localhost
# Lizmap Production
# Version 3_3
Alias /webgis/ "C:/webserver/lizmap/prod/release_3_3/lizmap/www/"
<Directory "C:/webserver/lizmap/prod/release_3_3/lizmap/www">
Options -Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Require all granted
</Directory>
# Lizmap Pre-production (master)
# Version master
Alias /preprod/ "C:/webserver/lizmap/preprod/master/lizmap/www/"
<Directory "C:/webserver/lizmap/preprod/master/lizmap/www">
Options -Indexes +FollowSymLinks +ExecCGI
AllowOverride All
Require all granted
</Directory>
Alias /qgis/ "C:/OSGeo4W64/apps/qgis-ltr/bin/"
<Directory "C:/OSGeo4W64/apps/qgis-ltr/bin/">
SetHandler fcgid-script
Options +ExecCGI
AllowOverride All
Require all granted
</Directory>
CustomLog "logs/lizmap-access.log" common
ErrorLog "logs/lizmap-error.log"
# ABP: needed for authentication in Lizmap
<IfModule mod_fcgid.c>
RewriteEngine on
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
<IfModule fcgid_module>
FcgidMaxRequestLen 51200000
FcgidConnectTimeout 60
</IfModule>
</VirtualHost>
After the replacement save the file and restart Apache with the command line instruction:
httpd -k restart
In case of lizmap version >= 3.0, you must use some scripts to install it properly (see https://github.com/3liz/lizmap-web-client/blob/master/INSTALL.md ). Open the command line (cmd.exe) and write the next instructions:
REM Production folder
cd C:\webserver\lizmap\prod\release_3_3\
cd lizmap\var\config
copy lizmapConfig.ini.php.dist lizmapConfig.ini.php
copy localconfig.ini.php.dist localconfig.ini.php
copy profiles.ini.php.dist profiles.ini.php
cd ..\..\..
REM PreProd (Master) folder
cd C:\webserver\lizmap\preprod\master\
cd lizmap\var\config
copy lizmapConfig.ini.php.dist lizmapConfig.ini.php
copy localconfig.ini.php.dist localconfig.ini.php
copy profiles.ini.php.dist profiles.ini.php
cd ..\..\..
Au cas où vous voudriez activer le répertoire des démos dans les deux environnements, avant l’installation vous devez ajouter localconfig.ini.php
dans les deux environnements le code suivant :
[modules]
lizmap.installparam=demo
Utilisation de PostgreSQL en tant que base de données d’administration (Optionnel)
Note
Pré-requis : installation de PostgreSQL/PostGIS
Par défaut, quand vous installez Lizmap Web Client, cela créera une base de de données Sqlite où seront stockés entre autres les informations comme les utilisateurs, les permissions.
Imaginez que vous êtes un administrateur SIG et vous voulez lier les références de l’utilisateur et mot de passe de Lizmap aux références de l’utilisateur et mot de passe de PostgreSQL.
For that before of LWC installation you need to change the file profiles.ini.php in the folder of both environments in the folder C:\webserver\lizmap\prod\release_3_3\lizmap\var\config (Production Folder) and C:\webserver\lizmap\preprod\master\lizmap\var\config (PreProduction Folder) with the following lines:
default=jauth
jacl2_profile=jauth
Ajoutez ; pour désactiver la base sqlite.
;[jdb:jauth]
;driver=sqlite3
;database="var:db/jauth.db"
;[jdb:lizlog]
;driver=sqlite3
;database="var:db/logs.db"
; when you have charset issues, enable force_encoding so the connection will be
; made with the charset indicated in jelix config
;force_encoding = on
; with the following parameter, you can specify a table prefix which will be
; applied to DAOs automatically. For manual jDb requests, please use method
; jDbConnection::prefixTable().
;table_prefix =
Supprimez ; et remplissez avec les accès PostgreSQL :
;Example of different driver (e.g PostgreSQL)
[jdb:jauth]
driver="pgsql"
database="name_of_database"
host="localhost"
user="Admin_user_postgreSQL"
password="put_here_the_password"
[jdb:lizlog]
driver="pgsql"
database="name_of_database"
host="localhost"
user="Admin_user_postgreSQL"
password="put_here_the_password"
; Example for pdo (eg. MySQL):
;driver=pdo
;dsn=mysql:host=your_host;dbname=name_of_database
;user=
;password=
After all your previous changes you are ready to launch the installer of lizmap for both environments in the command line (cmd):
REM Production Lizmap
cd C:\webserver\lizmap\prod\release_3_3\
php lizmap\install\installer.php
REM PreProduction Lizmap
cd C:\webserver\lizmap\prod\master\
php lizmap\install\installer.php
Configuration du panneau d’administration Lizmap
[PROD] Production Environment ( webgis )
After the correct installation owith the installer, go to http://localhost/webgis/index.php and you should see the Lizmap application home page with the demo project Montpellier - Transport. Now it’s time to configure the Lizmap Admin Panel, go to http://localhost/webgis/admin.php and do the login with:
user=admin;
password=admin;
Then for security proposes change the admin password, for example: lizmap_12345. If it makes sense, you can delete the users lizadmin and logintranet. You can do the same for groups, in this case delete group Intranet Demo Group and Lizadmin group.
Go to Lizmap configuration menu > Delete the « intranet » repository (at the bottom). Then you need to change the URL WMS Server, go to Lizmap configuration menu / Edit the Services form and change the WMS Server URL from: http://127.0.0.1/cgi-bin/qgis_mapserv.fcgi to http://localhost/qgis/qgis_mapserv.fcgi.exe After that, also change the cache directory from C:\Windows\Temp\ to: C:\webserver\cache\prod\ and save this configuration.
Maintenant vérifiez que le projet de démo Montpellier fonctionne: http://localhost/webgis/index.php/view/map/?repository=montpellier&project=montpellier
[PREPROD] Pré-production Environment ( preprod )
After the correct installation with the installer, go to http://localhost/preprod/index.php and you should see the Lizmap application home page with the demo project Montpellier - Transport. Now it’s time to configure the Lizmap Admin Panel, go to http://localhost/preprod/admin.php and do the login with:
user=admin;
password=admin;
Then for security proposes change the admin password, for example: lizmap_12345. If it makes sense, you can delete the users lizadmin and logintranet. You can do the same for groups, in this case delete group Intranet Demo Group and Lizadmin group.
Go to Lizmap configuration menu > Delete the « intranet » repository (at the bottom). Then you need to change the URL WMS Server, go to Lizmap configuration menu > Edit the Services form and change the WMS Server URL from: http://127.0.0.1/cgi-bin/qgis_mapserv.fcgi to http://localhost/qgis/qgis_mapserv.fcgi.exe After that, also change the cache directory from C:\Windows\Temp\ to: C:\webserver\cache\preprod\ and save this configuration.
Now check the Montpellier demo project is working: http://localhost/preprod/index.php/view/map/?repository=montpellier&project=montpellier
Configuration des répertoires Lizmap
You need to create a Lizmap directory architecture for organization porposes. Create the following directories via a *.bat file ( Please Check line ends are correct, you can open using notepad, notepad++):
REM common folder for both environments
mkdir C:\webserver\data\common\
REM common folder to publish SVG and images files in QGIS Server
mkdir C:\webserver\data\document\
REM directory of prod data
mkdir C:\webserver\data\prod\
REM common folder between rep in production environment
mkdir C:\webserver\data\prod\common\
mkdir C:\webserver\data\prod\rep1\
mkdir C:\webserver\data\prod\rep1\media\
mkdir C:\webserver\data\prod\rep1\media\js\
mkdir C:\webserver\data\prod\rep2\
mkdir C:\webserver\data\prod\rep2\media\
mkdir C:\webserver\data\prod\rep2\media\js\
REM directory of preprod data
mkdir C:\webserver\data\preprod\
REM common folder between rep in preprod (master) environment
mkdir C:\webserver\data\preprod\common\
mkdir C:\webserver\data\preprod\rep1\
mkdir C:\webserver\data\preprod\rep1\media\
mkdir C:\webserver\data\preprod\rep1\media\js\
mkdir C:\webserver\data\preprod\rep2\
mkdir C:\webserver\data\preprod\rep2\media\
mkdir C:\webserver\data\preprod\rep2\media\js\
Maintenant nous devons avoir accès au dossier C:\webserver\data\prod et ses sous-dossiers, ainsi l’administrateur SIG peut envoyer les fichiers projet Qgis, le fichier de configuration Lizmap pour chaque projet, les données SIG dans ces dossiers et d’autres documents. Aller dans le panneau d’administration Lizmap à l’adresse “http://localhost.admin.php” et créer le nouveau répertoire. Suivez les étapes :
Configuration Lizmap / Créer un nouveau répertoire (bouton en bas de la page)
id = rep1
label = Un nom pour le dépôt (vous pourrez le changer plus tard)
path = /webserver/data/prod/rep1/
Note
IMPORTANT POUR LE CHEMIN DU DÉPÔT, NE PAS UTILISER : C:\webserver\data\prod\rep1
In Apache you need to Add a vhost to publish SVG and images files via HTTP this will avoid the bug in QGIS Server under Windows which cannot display SVG icon when you have a relative path. Previous your create a folder C:\webserver\data\document\ and now is necessary to modify the file C:\webserver\Apache24\conf\extra\httpd-vhosts.conf, adding the following directory:
#Add this configuration before of the two environments directories.
Alias /document/ "C:/webserver/data/document/"
<Directory "C:/webserver/Data/document">
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
After this step save and restart Apache. Please check if you can add svg file in a folder, for example C:\webserver\Data\document\svg\my_icon.svg and then access it via http://localhost/webgis/document/svg/my_icon.svg and use it as the SVG path in the style properties of a vector layer.
Configuration du serveur Filezilla
This configuration only applies if your using a remote server.
Now you will configure a FTP to have a remote access and deploy in a easy way into the server the qgis projects and their project elements. First you need to download server FTP. Then install the default configuration in the server.
Note
Ne pas oublier « d’exécuter avec les droits d’administrateur »
Spécifiez le port : 14147
Open the FileZilla Server Interface trough Windows Menu > All programs > FileZilla Server > FileZilla Server Interface and click OK to connect (no password required yet).
Modify some options via Menu Edit > Settings and change IP Filter if needed : to filter only some IP, use « * » in the first block, the add the mask in the second block.
Passive mode settings > Use following IP : write your public IP and change port range : 5500-5700.
Logging: Enable logging to file, and limit log file size to 500 KB.
SSL/TLS settings : Enable FTP over SSL/TLS && Generate new certificate into C:\webserver\cert\ftp_certificate.crt && Allow explicit FTP over TLS && Disallow plain unencrypted FTP && Leave port 990.
Autoban - Activé le avec les valeurs par défaut.
Create user: Edit > Users - button Add user= lizmap_user and pass= choose_a_password
Shared folder (Access to PROD and PREPROD Environment): Add C:\webserver\lizmap - Give all rights by checking checkboxes for Files and Directories.
Vous pouvez ajouter un filtre d’IP ici également si besoin.
After the remote configuration, in the workstation of the GIS manager you can reproduce the structure of folders to be exactly of the remote to help the management of the folder. After that, is necessary install a FTP client see Prérequis section. Another thing, is it’s necessary a client certificate produced by the remote in the GIS manager. After that try to connect with: Server = Remote IP. Use Passive mode AND check IPV6.
Note
Vous pouvez voir ce tutoriel : https://forum.hardware.fr/hfr/WindowsSoftware/Tutoriels/filezilla-serveur-securise-sujet_300273_1.htm