-
Notifications
You must be signed in to change notification settings - Fork 0
/
09-http-configuration.sh
70 lines (58 loc) · 1.55 KB
/
09-http-configuration.sh
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
63
64
65
66
67
68
69
70
echo -n 'Checking if mod_perl is installed... '
if is_mod_perl_installed; then
print_check_result 'installed' 1
else
print_check_result 'not installed' 0
echo
echo 'Installing mod_perl...'
echo
if install_mod_perl; then
echo
print_check_result 'mod_perl installed.' 1
echo
else
echo
print_check_result 'mod_perl installation failed.' 0
echo
# TODO: Show error
exit 1
fi
fi
echo 'Checking if other required modules are enabled...'
for MODULE in deflate filter headers version; do
echo -n " • Checking for \"${MODULE}\"... "
if apachectl -M 2> /dev/null | grep "^ ${MODULE}_module " &> /dev/null; then
print_check_result 'enabled' 1
else
print_check_result 'not found' 0
echo -n " Enabling module \"${MODULE}\"..."
if enable_apache_mod ${MODULE}; then
print_check_result " enabled" 1
else
print_check_result " failed" 0
echo
# TODO: Show error
exit 1
fi
fi
done
echo
echo -n 'Adding web application configuration... '
if ln -s "${INSTALL_DIR}/scripts/apache2-httpd.include.conf" \
$(get_apache_config_dir)/zzz_otrs.conf;
then
print_check_result 'added' 1
else
print_check_result 'failed' 0
# TODO: Handle error
exit 1
fi
echo -n 'Restarting HTTP server... '
if restart_apache; then
print_check_result 'restarted' 1
else
print_check_result 'failed' 0
fi
echo
print_check_result 'HTTP server configured successfully.' 1
echo