Skip to content

Commit

Permalink
Fix the QGIS server landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Oct 11, 2021
1 parent a93af91 commit ea22184
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ RUN ccache --show-stats
FROM builder as builder-server

RUN ninja install
RUN rm -rf /usr/local/share/qgis/i18n/

FROM builder as builder-desktop

Expand Down Expand Up @@ -146,14 +147,9 @@ RUN a2enmod fcgid headers status && \
ln --symbolic /etc/qgisserver /project

# A few tunable variables for QGIS
ENV QGIS_SERVER_LOG_LEVEL=0 \
QGIS_SERVER_LOG_STDERR=1 \
PGSERVICEFILE=/etc/qgisserver/pg_service.conf \
QGIS_PROJECT_FILE=/etc/qgisserver/project.qgs \
ENV QGIS_SERVER_LOG_STDERR=1 \
QGIS_CUSTOM_CONFIG_PATH=/tmp \
MAX_CACHE_LAYERS="" \
QGIS_PLUGINPATH=/var/www/plugins \
QGIS_AUTH_DB_DIR_PATH=/etc/qgisserver/ \
FCGID_MAX_REQUESTS_PER_PROCESS=1000 \
FCGID_MIN_PROCESSES=1 \
FCGID_MAX_PROCESSES=5 \
Expand All @@ -164,7 +160,7 @@ ENV QGIS_SERVER_LOG_LEVEL=0 \

COPY --from=builder-server /usr/local/bin /usr/local/bin/
COPY --from=builder-server /usr/local/lib /usr/local/lib/
COPY --from=builder-server /usr/local/share/qgis/python /usr/local/share/qgis/python/
COPY --from=builder-server /usr/local/share/qgis /usr/local/share/qgis
COPY runtime /

RUN adduser www-data root && \
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ http://localhost:8380/?SERVICE=WMS&REQUEST=GetCapabilities

You can use the following variables (`-e` option in `docker run`):

- `QGIS_SERVER_LOG_LEVEL`: The debug level for the logs (`0`=max debug, `3`=no debug logs)
- `PGSERVICEFILE`: If you want to change the default of `/etc/qgisserver/pg_service.conf`
- `QGIS_PROJECT_FILE`: If you want to change the default of `/etc/qgisserver/project.qgs`
- `QGIS_CATCH_SEGV`: Set to `1` if you want stacktraces in the logs in case of segmentation faults.
- `FCGID_MAX_REQUESTS_PER_PROCESS`: The number of requests a QGIS server will serve before being restarted by apache
- `FCGID_MIN_PROCESSES`: The minimum number of fcgi processes to keep (defaults to `1`)
Expand All @@ -33,7 +30,7 @@ You can use the following variables (`-e` option in `docker run`):
`| grep -vi _SERVICE_ | grep -vi _TCP | grep -vi _UDP | grep -vi _PORT` to remove the default
Kubernetes environment variables (default in an empty string)

[See also QGIS server documentation](https://docs.qgis.org/3.16/en/docs/server_manual/config.html?highlight=environment#environment-variables)
[See also QGIS server documentation](https://docs.qgis.org/latest/en/docs/server_manual/config.html?highlight=environment#environment-variables)

Fonts present in the `/etc/qgisserver/fonts` directory will be installed and thus usable by QGIS.

Expand All @@ -44,3 +41,15 @@ If you want to edit a project file, you can run the client from a Linux machine
```bash
docker run --rm -ti --env=DISPLAY=unix${DISPLAY} --volume=/tmp/.X11-unix:/tmp/.X11-unix --volume=${HOME}:${HOME} camptocamp/qgis-server:master-desktop
```

## Changelog

### QGIS 3.22

We removed the default values for the following environment variables to better fit with the QGIS documentation:

- `QGIS_SERVER_LOG_LEVEL`, was `0`
- `QGIS_PROJECT_FILE`, was `/etc/qgisserver/project.qgs`
- `MAX_CACHE_LAYERS`, was `""`
- `QGIS_AUTH_DB_DIR_PATH`, was `/etc/qgisserver/`
- `PGSERVICEFILE`, was `/etc/qgisserver/pg_service.conf`
3 changes: 3 additions & 0 deletions acceptance_tests/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ services:
environment:
QGIS_SERVER_LOG_LEVEL: '0'
QGIS_CATCH_SEGV: '1'
QGIS_PROJECT_FILE: /etc/qgisserver/project.qgs
QGIS_AUTH_DB_DIR_PATH: /etc/qgisserver/
PGSERVICEFILE: /etc/qgisserver/pg_service.conf
links:
- db
# ports:
Expand Down

0 comments on commit ea22184

Please sign in to comment.