summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Fritsch <sf@debian.org>2010-04-14 20:24:22 +0000
committerStefan Fritsch <sf@sfritsch.de>2012-01-02 10:37:08 +0100
commit477c5d90a8509a04270776cbd2aa6ad339a70ce3 (patch)
treea993c8c4e1a49867660f9e94bd0232185fe372d8
parent131189cca2edce82e999b1ed62b2fe6a8273cc18 (diff)
downloadapache2-477c5d90a8509a04270776cbd2aa6ad339a70ce3.tar.gz
Move definition of other_vhosts_access.log to new config file
/etc/apache2/conf.d/other-vhosts-access-log, but disable it if it has been disabled by the admin. git-svn-id: svn+ssh://svn.debian.org/svn/pkg-apache/trunk/apache2@1177 01b336ce-410b-0410-9a02-a0e7f243c266
-rw-r--r--debian/apache2.2-common.postinst9
-rw-r--r--debian/apache2.2-common.preinst11
-rw-r--r--debian/changelog3
-rw-r--r--debian/config-dir/apache2.conf5
-rw-r--r--debian/config-dir/conf.d/other-vhosts-access-log2
5 files changed, 25 insertions, 5 deletions
diff --git a/debian/apache2.2-common.postinst b/debian/apache2.2-common.postinst
index 45b081d1..e6ecb234 100644
--- a/debian/apache2.2-common.postinst
+++ b/debian/apache2.2-common.postinst
@@ -77,6 +77,15 @@ if dpkg --compare-versions "$2" lt 2.2.15-1~0; then
a2enmod -q reqtimeout
fi
+# The definition of other_vhost_access.log has been moved.
+# Disable the new definition if the admin has changed the old
+# one (as determined by preinst).
+if [ -e /etc/apache2/disable-other-vhost-access-log.dpkg-apache2.2-common ] ; then
+ echo "Disabling /etc/apache2/conf.d/other-vhosts-access-log"
+ perl -p -i -e 's/^(CustomLog.*)$/#$1/' /etc/apache2/conf.d/other-vhosts-access-log
+ rm /etc/apache2/disable-other-vhost-access-log.dpkg-apache2.2-common
+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
diff --git a/debian/apache2.2-common.preinst b/debian/apache2.2-common.preinst
index 26dc711f..8e26644c 100644
--- a/debian/apache2.2-common.preinst
+++ b/debian/apache2.2-common.preinst
@@ -14,4 +14,15 @@ if [ -n "$2" ] && dpkg --compare-versions "$2" lt 2.2.4-2; then
mv_conffile /etc/apache2/conf.d/charset 641239a7d2d172856cb1413a47d2e142
fi
+if [ -n "$2" ] && dpkg --compare-versions "$2" lt 2.2.15-4~ ; then
+ # The definition of other_vhosts_access.log has been moved from
+ # apache2.conf to conf.d/other-vhosts-access-log. If the admin has
+ # removed it from apache2.conf, mark it to be disabled in
+ # conf.d/other-vhosts-access-log in the postinst.
+ if !egrep '^ *CustomLog.*other_vhosts_access.log vhost_combined$' /etc/apache2/apache2.conf
+ then
+ touch /etc/apache2/disable-other-vhost-access-log.dpkg-apache2.2-common
+ fi
+fi
+
#DEBHELPER#
diff --git a/debian/changelog b/debian/changelog
index 0b045e2f..7989f5ba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,8 @@
apache2 (2.2.15-4) UNRELEASED; urgency=low
+ * Move definition of other_vhosts_access.log to new config file
+ /etc/apache2/conf.d/other-vhosts-access-log, but disable it
+ if it has been disabled by the admin. Closes: #576572. LP: #507616
* Simplify logrotate script. Closes: #576105
* Remove empty directory /usr/lib/debug/usr/sbin in mpm packages.
Closes: #576089
diff --git a/debian/config-dir/apache2.conf b/debian/config-dir/apache2.conf
index 9ef7e58a..1e97b4eb 100644
--- a/debian/config-dir/apache2.conf
+++ b/debian/config-dir/apache2.conf
@@ -220,11 +220,6 @@ LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
-#
-# Define an access log for VirtualHosts that don't define their own logfile
-CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined
-
-
# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.
diff --git a/debian/config-dir/conf.d/other-vhosts-access-log b/debian/config-dir/conf.d/other-vhosts-access-log
new file mode 100644
index 00000000..9f7aecd0
--- /dev/null
+++ b/debian/config-dir/conf.d/other-vhosts-access-log
@@ -0,0 +1,2 @@
+# Define an access log for VirtualHosts that don't define their own logfile
+CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined