Skip to content

MapServer and Apache

Warning

This page is currently in a draft form.

Overview

At its heart MapServer is a command-line application that can be accessed through a web server.

The Apache web server is used by the workshop Docker image.

Apache has a configuration file. The Docker image uses a start-up script.

MapServer uses the mod_fcgid module, which is an Apache module that provides FastCGI support.

FcgidMaxRequestsPerProcess ${MAX_REQUESTS_PER_PROCESS}
FcgidMinProcessesPerClass ${MIN_PROCESSES}
FcgidMaxProcessesPerClass ${MAX_PROCESSES}
FcgidBusyTimeout ${BUSY_TIMEOUT}
FcgidIdleTimeout ${IDLE_TIMEOUT}
FcgidIOTimeout ${IO_TIMEOUT}

These are all documented on the reference page.

These all have defaults in the Docker file, but can be overridden using Docker environment variables.

ENV MS_DEBUGLEVEL=0 \
    MS_ERRORFILE=stderr \
    MAPSERVER_CONFIG_FILE=/etc/mapserver.conf \
    MAPSERVER_BASE_PATH= \
    MAX_REQUESTS_PER_PROCESS=1000 \
    MIN_PROCESSES=1 \
    MAX_PROCESSES=5 \
    BUSY_TIMEOUT=300 \
    IDLE_TIMEOUT=300 \

All requests to the server are mapped to mapserv_wrapper - a small wrapper script.

ScriptAliasMatch "^${MAPSERVER_BASE_PATH}/(.*)" /usr/local/bin/mapserv_wrapper/$1
ScriptAliasMatch "^${MAPSERVER_BASE_PATH}" /usr/local/bin/mapserv_wrapper

Restarting Apache:

docker restart mapserver

Other Web Servers