summaryrefslogtreecommitdiff
path: root/www/apache24/files/pkg-install.in
blob: ab856f5d988aae77acaefdd623765f16b86d3788 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh

# Note:
# We have to use grep or wc after awk, else
# there is no usable ret value that can be
# used for further processing

HTTPD_CONF="%%ETCDIR%%/httpd.conf"
MPM_FALLBACK="%%ETCDIR%%/modules.d/%%MPMF%%"

_log_msg(){
	/usr/bin/logger -p local0.notice -s -t apache24 "$1"
}

_check_deprecated(){
if [ -r ${HTTPD_CONF} ]; then
	/usr/bin/awk '/^LoadModule[[:blank:]]+mpm_(event|prefork|worker)_module/ {print $2}' ${HTTPD_CONF} | /usr/bin/grep -q '^mpm_'
	if [ $? -ne 0 ]; then
		_log_msg "==================================================="
		_log_msg "WARNING!"
		_log_msg " No apache MPM module is activated in httpd.conf,"
		_log_msg " mpm_prefork will be activated as fall back"
		_log_msg ""
		_log_msg " Please follow the instructions in"
		_log_msg "  ${MPM_FALLBACK}"
		_log_msg "==================================================="

cat > ${MPM_FALLBACK} << _EOF
# ==================================================================
# Note:
# www/apache24 build changed from static MPM to modular MPM loading!
#
# This file was installed as fall back, since no activated MPM
# was detected in the existing httpd.conf.
#
# Please merge additions from httpd.conf.sample into your httpd.conf!
#
# After activating one of the mpm_modules in httpd.conf it is save
# to deactivate the "LoadModule" line in this file.
#
# In case mod_(php|perl|python|...) modules from the official FreeBSD
# package repo are installed please use the mpm_prefork module, else
# feel free to test mpm_event (preferred) or mpm_worker.
#
# For more information see:
#  http://httpd.apache.org/docs/2.4/mod/
# ==================================================================

LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so
_EOF

	fi # $? -ne 0
else
	echo ${HTTPD_CONF} not readable
fi
}

# run only if build with modular MPM
if [ "$2" = "POST-INSTALL" ]; then
	%%MPM_FALLBACK_CHECK%%_check_deprecated
fi