@@ -5,26 +5,46 @@ if [ -e /etc/qgisserver/fonts/ ]; then
5
5
fc-cache --really-force --system-only
6
6
fi
7
7
8
- # save the environment to be able to restore it in the FCGI daemon (used
9
- # in /usr/local/bin/qgis_mapsev_wrapper) for the startup code.
10
- # shellcheck disable=SC2086
11
- ${GET_ENV} ${FILTER_ENV} | sed -e ' s/^\([^=]*\)=.*/PassEnv \1/' > /tmp/pass-env
12
-
13
- # Save the list of variables to be passed along with the FCGI requests (used in
14
- # /etc/apache2/conf-enabled/qgis.conf).
15
- # shellcheck disable=SC2086
16
- ${GET_ENV} ${FILTER_ENV} | sed -e ' s/.\+/export "\0"/' > /tmp/init-env
17
-
18
- if [ " ${UID} " == 0 ]; then
19
- echo " Switching listen port to 80"
20
- cd /tmp
21
- sed -i -e ' s/<VirtualHost \*:8080>/<VirtualHost *:80>/' /etc/apache2/sites-available/000-default.conf
22
- sed -i -e ' s/Listen 8080$/Listen 80/' /etc/apache2/ports.conf
23
- fi
8
+ if [[ " ${SERVER} " == spawn-fcgi ]]; then
9
+ echo " Starting with spawn-fcgi"
10
+ # Save the environment to be able to restore it in the FCGI daemon (used in /usr/local/bin/qgis-mapserv-wrapper)
11
+ # shellcheck disable=SC2086
12
+ ${GET_ENV} ${FILTER_ENV} | sed -e ' s/.\+/export "\0"/' > /tmp/init-env
13
+ if [[ " ${LIGHTTPD_FASTCGI_SOCKET} " == " " ]]; then
14
+ exec /usr/bin/spawn-fcgi -p " ${LIGHTTPD_FASTCGI_PORT} " -n -- /usr/local/bin/qgis-mapserv-wrapper
15
+ else
16
+ exec /usr/bin/spawn-fcgi -s " ${LIGHTTPD_FASTCGI_SOCKET} " -n -- /usr/local/bin/qgis-mapserv-wrapper
17
+ fi
18
+ else
19
+ if [[ " ${SERVER} " == lighttpd ]]; then
20
+ echo " Starting lighttpd"
21
+ lighttpd -tt -f " ${LIGHTTPD_CONF} "
22
+ exec /usr/sbin/lighttpd -D -f " ${LIGHTTPD_CONF} "
23
+ else
24
+ echo " Starting with apache2"
25
+
26
+ # save the environment to be able to restore it in the FCGI daemon (used
27
+ # in /usr/local/bin/qgis-mapserv-wrapper) for the startup code.
28
+ # shellcheck disable=SC2086
29
+ ${GET_ENV} ${FILTER_ENV} | sed -e ' s/^\([^=]*\)=.*/PassEnv \1/' > /tmp/pass-env
30
+
31
+ # Save the list of variables to be passed along with the FCGI requests (used in
32
+ # /etc/apache2/conf-enabled/qgis.conf).
33
+ # shellcheck disable=SC2086
34
+ ${GET_ENV} ${FILTER_ENV} | sed -e ' s/.\+/export "\0"/' > /tmp/init-env
24
35
25
- trap ' echo "caught a SIGTERM"; kill -TERM $PID2; wait $PID2; kill -TERM $PID1; wait $PID1' TERM
26
- trap ' ' WINCH
36
+ if [[ " ${UID} " == 0 ]]; then
37
+ echo " Switching listen port to 80"
38
+ cd /tmp
39
+ sed -i -e ' s/<VirtualHost \*:8080>/<VirtualHost *:80>/' /etc/apache2/sites-available/000-default.conf
40
+ sed -i -e ' s/Listen 8080$/Listen 80/' /etc/apache2/ports.conf
41
+ fi
27
42
28
- rm -f " ${APACHE_PID_FILE} "
43
+ trap ' echo "caught a SIGTERM"; kill -TERM $PID2; wait $PID2; kill -TERM $PID1; wait $PID1' TERM
44
+ trap ' ' WINCH
29
45
30
- exec apache2 -DFOREGROUND
46
+ rm -f " ${APACHE_PID_FILE} "
47
+
48
+ exec apache2 -DFOREGROUND
49
+ fi
50
+ fi
0 commit comments