diff options
Diffstat (limited to 'debian')
-rw-r--r-- | debian/apache2.2-common.init.d | 7 | ||||
-rw-r--r-- | debian/apache2.2-common.postinst | 28 | ||||
-rw-r--r-- | debian/apache2.2-common.postrm | 15 | ||||
-rw-r--r-- | debian/apache2.2-common.preinst | 12 | ||||
-rw-r--r-- | debian/changelog | 10 | ||||
-rw-r--r-- | debian/config-dir/conf.d/charset | 6 | ||||
-rw-r--r-- | debian/config-dir/ports.conf | 5 |
7 files changed, 51 insertions, 32 deletions
diff --git a/debian/apache2.2-common.init.d b/debian/apache2.2-common.init.d index fc920113..d7216cc2 100644 --- a/debian/apache2.2-common.init.d +++ b/debian/apache2.2-common.init.d @@ -9,9 +9,6 @@ ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin" #echo "You haven't enabled any sites yet, so I'm not starting apache2." && \ #echo "To add and enable a host, use addhost and enhost." && exit 0 -#edit /etc/default/apache2 to change this. -NO_START=0 - set -e if [ -x /usr/sbin/apache2 ] ; then HAVE_APACHE2=1 @@ -24,10 +21,6 @@ fi test -f /etc/default/rcS && . /etc/default/rcS test -f /etc/default/apache2 && . /etc/default/apache2 -if [ "$NO_START" != "0" -a "$1" != "stop" ]; then - log_warning_msg "Not starting apache2 - edit /etc/default/apache2 and change NO_START to be 0."; - exit 0; -fi APACHE2="$ENV /usr/sbin/apache2" APACHE2CTL="$ENV /usr/sbin/apache2ctl" 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 diff --git a/debian/apache2.2-common.postrm b/debian/apache2.2-common.postrm index b6c45d89..8d32dc6e 100644 --- a/debian/apache2.2-common.postrm +++ b/debian/apache2.2-common.postrm @@ -4,9 +4,6 @@ set -e if [ "$1" = purge ] ; then rm -f /etc/apache2/httpd.conf \ - /etc/apache2/ports.conf \ - /etc/apache2/conf.d/charset \ - /etc/default/apache2 \ /var/cache/apache2/reload \ /var/log/apache2/access.log* \ /var/log/apache2/error.log* @@ -32,4 +29,16 @@ if [ "$1" = purge ] ; then fi +restore_conffile() { + if [ -e $1.dpkg-apache2.2-common.old ] ; then + mv $1.dpkg-apache2.2-common.old $1 + fi +} + +if [ "$1" = abort-upgrade ] ; then + restore_conffile /etc/default/apache2 + restore_conffile /etc/apache2/ports.conf + restore_conffile /etc/apache2/conf.d/charset +fi + #DEBHELPER# diff --git a/debian/apache2.2-common.preinst b/debian/apache2.2-common.preinst index 9cdcbc25..e6898098 100644 --- a/debian/apache2.2-common.preinst +++ b/debian/apache2.2-common.preinst @@ -17,4 +17,16 @@ fi # YAY, MORE EVILNESS rm -f /var/lib/dpkg/info/apache2-common.postrm +mv_conffile() { + if [ "`md5sum $1 2>/dev/null | cut -d ' ' -f 1`" = "$2" ] ; then + mv $1 $1.dpkg-apache2.2-common.old + fi +} + +if [ "$2" ] && dpkg --compare-versions "$2" lt 2.2.4-2; then + mv_conffile /etc/default/apache2 9ac83f9132b78c3aa6dd4d7a583bf476 + mv_conffile /etc/apache2/ports.conf d5fcefc335117f400d451de47efeca87 + mv_conffile /etc/apache2/conf.d/charset 641239a7d2d172856cb1413a47d2e142 +fi + #DEBHELPER# diff --git a/debian/changelog b/debian/changelog index 5ce384d1..b01ab161 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +apache2 (2.2.4-2) unstable; urgency=low + + * Remove the NO_START kludge. Now you have to use rc*.d symlinks to disable + apache2. + * Disable AddDefaultCharset by default + * Make ports.conf, conf.d/charset, and /etc/default/apache2 conffiles + managed by dpkg + + -- Stefan Fritsch <sf@debian.org> Tue, 03 Jul 2007 21:23:40 +0200 + apache2 (2.2.4-1) unstable; urgency=medium [ Stefan Fritsch ] diff --git a/debian/config-dir/conf.d/charset b/debian/config-dir/conf.d/charset new file mode 100644 index 00000000..e95cf7b5 --- /dev/null +++ b/debian/config-dir/conf.d/charset @@ -0,0 +1,6 @@ +# Read the documentation before enabling AddDefaultCharset. +# In general, it is only a good idea if you know that all your files +# have this encoding. It will override any encoding given in the file +# in meta http-equiv or xml encoding tags. + +#AddDefaultCharset UTF-8 diff --git a/debian/config-dir/ports.conf b/debian/config-dir/ports.conf new file mode 100644 index 00000000..6aedd9a5 --- /dev/null +++ b/debian/config-dir/ports.conf @@ -0,0 +1,5 @@ +Listen 80 + +<IfModule mod_ssl.c> + Listen 443 +</IfModule> |