diff options
Diffstat (limited to 'debian/apache2.2-common.postinst')
-rw-r--r-- | debian/apache2.2-common.postinst | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/debian/apache2.2-common.postinst b/debian/apache2.2-common.postinst index 1f5b3f43..16fd0ec4 100644 --- a/debian/apache2.2-common.postinst +++ b/debian/apache2.2-common.postinst @@ -23,7 +23,8 @@ mod_is_enabled() { # apache2.2-common, we have to be more devious. if [ -n "$2" ]; then UPGRADE=from_2_2 -elif [ -e /etc/apache2/ports.conf ] || +elif [ -e /etc/apache2/ports.conf.dpkg-apache2.2-common.old ] || + [ -e /etc/apache2/ports.conf ] || [ -n "$(ls /etc/apache2/sites-enabled/)" ]; then UPGRADE=from_2_0 else @@ -31,24 +32,6 @@ else fi -if [ ! -f /etc/apache2/ports.conf ]; then - echo "# 0 = start on boot; 1 = don't start on boot" > /etc/default/apache2 - NO_AF_INET=`$NETSTAT -lnt 2>&1 | grep 'no support for .AF INET (tcp)'` || true - NO_PORT_80=`$NETSTAT -lnt | awk '{print $4}' | grep ':80$'` || true - if [ -n "$NO_AF_INET" -o -n "$NO_PORT_80" ]; then - echo "NO_START=1" >> /etc/default/apache2 - echo "Listen 80" >> /etc/apache2/ports.conf - if [ -n "$NO_AF_INET" ]; then - 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." - fi - 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." - else - echo "NO_START=0" >> /etc/default/apache2 - echo "Listen 80" >> /etc/apache2/ports.conf - 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." - fi -fi - #set up default site and dummy error and access logs if [ $UPGRADE = new_install ]; then @@ -59,9 +42,6 @@ if [ $UPGRADE = new_install ]; then touch /var/log/apache2/error.log /var/log/apache2/access.log chown root:adm /var/log/apache2/error.log /var/log/apache2/access.log chmod 0640 /var/log/apache2/error.log /var/log/apache2/access.log - if [ ! -f /etc/apache2/conf.d/charset ]; then - echo "AddDefaultCharset UTF-8" > /etc/apache2/conf.d/charset - fi fi # Note, this line catches new installs as well as upgrades @@ -102,4 +82,8 @@ if [ $UPGRADE = from_2_0 ]; then fi fi +rm -f /etc/apache2/ports.conf.dpkg-apache2.2-common.old +rm -f /etc/default/apache2.dpkg-apache2.2-common.old +rm -f /etc/apache2/conf.d/charset.dpkg-apache2.2-common.old + exit 0 |