NaturalGIS / qgis_server_and_lizmap_on_windows

Easy install/deploy QGIS Server and Lizmap Web Client on MS Windows
16 stars 10 forks source link

Easy install/deploy QGIS Server and Lizmap Web Client on MS Windows

Credits: 3Liz, https://github.com/3liz João Gaspar, https://github.com/jonnyforestGIS

Last Tested on: QGIS Server 3.28.11 LTR + PHP 8.2 + LizMap Web Client 3.6.6

:warning:Warning for Portuguese Users:warning:: If you use the application for Cartão de Cidadão Autenticação GOV, we found a issue that breaks the QGIS and QGIS Server instalation. Please check https://github.com/amagovpt/autenticacao.gov/issues/88

The following guide assume that the user will keep the suggested installation/deploy paths. If there is the necessity to use custom installatin/deploy paths then a number of configuration files (Apache, PHP) will need to be modified. This guide also assumes that on the Windows machine being used there aren't any other programs/services running on port 80.

1) Download the OSGeo4W installer: https://download.osgeo.org/osgeo4w/v2/osgeo4w-setup.exe

2) Use the "advanced" install method. Install the packages "qgis-ltr", "qgis-ltr-server" and "fcgi", let the installer manage the installation of dependencies. Use the default installation path:

C:\OSGeo4W

osgeo1

3) Download the file https://github.com/NaturalGIS/qgis_server_and_lizmap_on_windows/archive/refs/heads/master.zip unzip it and copy the "webserver" folder inside the C: drive

image

4) Start the Apache web server by running as administrator (right click > run as administrator) the file

C:\webserver\Apache24\bin\httpd.exe

At this point you could see this message from Windows firewall: allow Apache to serve pages through it.

windows_firwall

5) As option Apache can be installed as Windows service by running (from the Windows console, launched as administrator) the following command:

C:\webserver\Apache24\bin\install-server.bat

After that Apache can be started/stopped from the Windows Services control panel or from the Windows console using the command (as administrator):

C:\webserver\Apache24\bin\start-server.bat

6) Open a browser and test if Apache works:

http://localhost

image

7) Test if PHP works:

http://localhost/info.php

image

8) Test if QGIS Server works:

http://localhost/qgis/qgis_mapserv.fcgi.exe

image

9) Test if Lizmap Web Client works:

http://localhost/lizmap36/lizmap/www/index.php

image

http://localhost/lizmap36/lizmap/www/index.php/view/map?repository=demos&project=montpellier

image

10) On a completely clean Window 10/11 machine you can get an error message about missing some library. If is the case just download and install them from the MS web site: https://www.microsoft.com/en-us/download/details.aspx?id=52685