3
if [ "$1" != "configure" ]; then
7
# Source Debconf confmodule.
8
#. /usr/share/debconf/confmodule
12
# An ugly hack, I know, but a necessarily ugly hack.
13
#This desperately needs debconf, soon.
14
if [ ! -f /etc/apache2/ports.conf ]; then
15
echo "# 0 = start on boot; 1 = don't start on boot" > /etc/default/apache2
16
NO_AF_INET=`$NETSTAT -lnt 2>&1 | grep 'no support for .AF INET (tcp)'` || true
17
NO_PORT_80=`$NETSTAT -lnt | awk '{print $4}' | grep ':80$'` || true
18
if [ -n "$NO_AF_INET" -o -n "$NO_PORT_80" ]; then
19
echo "NO_START=1" >> /etc/default/apache2
20
echo "Listen 80" >> /etc/apache2/ports.conf
21
if [ -n "$NO_AF_INET" ]; then
22
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."
24
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."
26
echo "NO_START=0" >> /etc/default/apache2
27
echo "Listen 80" >> /etc/apache2/ports.conf
28
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."
32
# check for 2.2 kernels and set up the scoreboard.
33
if [ `uname -r|grep "^2.2"` ]; then
34
printf "#This is required for 2.2 kernels\nScoreboardFile /var/log/apache2/apache2_scoreboard\n" > /etc/apache2/conf.d/scoreboard
37
# Make self-signed certificate
38
#if [ ! -f /etc/apache2/ssl/apache.pem ]
40
# /usr/sbin/make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem
44
if [ ! -e /etc/apache2/httpd.conf ]; then
45
cat >/etc/apache2/httpd.conf <<EOF
46
# This is here for backwards compatability reasons and to support
47
# installing 3rd party modules directly via apxs2, rather than
48
# through the /etc/apache2/mods-{available,enabled} mechanism.
50
#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so
54
#set up default site and dummy error and access logs
55
if [ "$2" = "<unknown>" -o -z "$2" ]; then
56
if [ ! -L /etc/apache2/sites-enabled/000-default -a \
57
! -f /etc/apache2/sites-enabled/000-default ]; then
58
ln -s /etc/apache2/sites-available/default /etc/apache2/sites-enabled/000-default
60
touch /var/log/apache2/error.log /var/log/apache2/access.log
61
chown root:adm /var/log/apache2/error.log /var/log/apache2/access.log
62
chmod 0640 /var/log/apache2/error.log /var/log/apache2/access.log
63
if [ ! -f /etc/apache2/conf.d/charset ]; then
64
echo "AddDefaultCharset UTF-8" > /etc/apache2/conf.d/charset
68
#auto enable mod_userdir on upgrades and new installs, otherwise things will B-R-EAK
69
if dpkg --compare-versions "$2" lt 2.0.50-1; then