QGIS Server¶
Mappin needs a WMS server for rendering map images / tiles.
We recommend using QGIS Server which will be installed in this section.
Mappin is also capable of obtaining WMS images / tiles from GeoServer. If you intend to use an existing GeoServer installation instead of QGIS Server then skip the rest of this section.
Obtaining Software¶
Download Apache 2.4.x Win64 from the link below:
- Also download vc_redist_x64 from the same page
- Also download mod_fcgid-2.3.10-win64-VS16.zip from the same page
Installing Apache¶
- Run the vc_redist_x64 installer.
- Extract the
Apache24
folder from the zip file (httpd-2.4.41-win64-VS16.zip) to the root of theC:
drive so you now have a folder atC:\Apache24
- Locate
mod_fcgid.so
from mod_fcgid-2.3.10-win64-VS16.zip and extract it toC:\Apache24\modules
Next we’ll configure Apache to work with QGIS Server.
- Edit
C:\Apache24\conf\httpd.conf
Change
Listen 80
toListen 8080
This will cause Apache to listen on port 8080 (port 80 will be used by Mappin).
Change
ErrorLog "logs/error.log"
toErrorLog "|bin/rotatelogs.exe -l logs/error.%Y.%m.%d.log 86400"
Change
CustomLog "logs/access.log" common
toCustomLog "|bin/rotatelogs.exe -l logs/access.%Y.%m.%d.log 86400" common
Add the following line at the end of the file:
Include conf/extra/qgis.conf
- Download qgis.conf and save it to
C:\Apache24\conf\extra\qgis.conf
- To maximise performance, we recommend setting FcgidMaxProcesses within qgis.conf (last line) to one less than the number of physical processor cores on the server.
- Next create (and start) the Apache service:
Open a command prompt as Administrator
Run these commands:
cd C:\Apache24\bin httpd.exe -k install sc start Apache2.4
Apache has now been configured. Next we need to install QGIS Server.
Warning
QGIS Server writes verbose logs (under C:\Apache24\logs
).
To ensure that logs do not fill up your disk, we recommend you:
- Enable filesystem-level compression (the Compress contents to save disk space option) on this folder
- Run the included script
rotate-qgis-server-logs.bat
as a nightly scheduled task
The script mentioned in the latter point is located at %MAPPIN_HOME%\bin
where %MAPPIN_HOME%
is your Mappin installation directory. It stops Apache, renames the day’s QGIS Server log based on the date and removes any log files older than one year. Adjust the script according to your needs.
Installing QGIS Server¶
We’ll use the OSGeo4W installer to install QGIS Server.
Download the OSGeo4W Network Installer (64 bit) using the link below:
- Run it, choosing:
- Advanced install
- Install from internet
- Default root directory (
C:\OSGeo4W64
)- Install for all users
- You may need to fiddle with proxy server settings if you’re on a restrictive network
- Select these packages:
web/qgis-ltr-server
(latest version)
- Click Next, opting to download and install any suggested dependencies
QGIS server should now be installed and the OSGeo4W installer can be used to upgrade it (and its dependencies) in the future.
Offline installation of QGIS Server¶
You’ll notice that QGIS Server uses an online installer, installing from the internet.
The installer can also be used to download selected packages and their dependencies from the internet and store them in its Local Package Directory. If you need to perform an offline installation, we recommend using the Download Without Installing option to download all files you need to the Local Package Directory. It’s worth setting the Local Package Directory to something sensible like C:\OSGeo4WPackages
so it can be easily transferred to another computer. When performing an offline install, select the Install from Local Directory option during installation.