3
if [ "$1" != "configure" ]; then
9
if [ -e /usr/sbin/apache2 ]; then
10
if [ "`dpkg-statoverride --list /usr/sbin/apache2`" = "" ]; then
11
chmod +x /usr/sbin/apache2
13
chmod `dpkg-statoverride --list /usr/sbin/apache2 | cut -f 3` /usr/sbin/apache2
17
if [ ! -f /etc/apache2/ports.conf ]; then
18
echo "# 0 = start on boot; 1 = don't start on boot" > /etc/default/apache2
19
NO_AF_INET=`$NETSTAT -lnt 2>&1 | grep 'no support for .AF INET (tcp)'` || true
20
NO_PORT_80=`$NETSTAT -lnt | awk '{print $4}' | grep ':80$'` || true
21
if [ -n "$NO_AF_INET" -o -n "$NO_PORT_80" ]; then
22
echo "NO_START=1" >> /etc/default/apache2
23
echo "Listen 80" >> /etc/apache2/ports.conf
24
if [ -n "$NO_AF_INET" ]; then
25
echo "netstat is unable to query the state of your listening TCP ports. This could be because you don't have TCP support in your kernel (unlikely), or because you do not have the /proc filesystem mounted. To be on the safe side, we're assuming that port 80 is in use."
27
echo "Setting Apache2 not to start, as something else appears to be using Port 80. To allow apache2 to start, set NO_START to 0 in /etc/default/apache2. Apache2 has been set to listen on port 80 by default, so please edit /etc/apache2/ports.conf as desired. Note that the Port directive no longer works."
29
echo "NO_START=0" >> /etc/default/apache2
30
echo "Listen 80" >> /etc/apache2/ports.conf
31
echo "Setting Apache2 to Listen on port 80. If this is not desired, please edit /etc/apache2/ports.conf as desired. Note that the Port directive no longer works."
36
#set up default site and dummy error and access logs
37
if [ "$2" = "<unknown>" -o -z "$2" ]; then
38
if [ ! -L /etc/apache2/sites-enabled/000-default -a \
39
! -f /etc/apache2/sites-enabled/000-default ]; then
40
ln -s /etc/apache2/sites-available/default /etc/apache2/sites-enabled/000-default
42
touch /var/log/apache2/error.log /var/log/apache2/access.log
43
chown root:adm /var/log/apache2/error.log /var/log/apache2/access.log
44
chmod 0640 /var/log/apache2/error.log /var/log/apache2/access.log
45
if [ ! -f /etc/apache2/conf.d/charset ]; then
46
echo "AddDefaultCharset UTF-8" > /etc/apache2/conf.d/charset
50
if [ "$2" = "<unknown>" -o -z "$2" ] || dpkg --compare-versions "$2" lt 2.2.3-3.1; then
61
# Those come from mod_auth:
64
a2enmod authz_groupfile
67
# This comes from mod_access:
70
# Module replacements from previous versions of apache2
71
if [ -L /etc/apache2/mods-enabled/imap.load ]; then
75
if [ -L /etc/apache2/mods-enabled/auth_ldap.load ]; then
81
# Make sure /var/lock/apache2 has the correct permissions
82
if [ -d /var/lock/apache2 ]; then
83
chown www-data /var/lock/apache2