[Pkg-apache-commits] r1145 - in /trunk/apache2: NEWS README.multiple-instances apache2.2-common.apache2.init apache2.2-common.examples apache2ctl changelog config-dir/sites-available/default config-dir/sites-available/default-ssl rules secondary-init-script setup-instance

sf at alioth.debian.org sf at alioth.debian.org
Sun Feb 7 15:09:13 UTC 2010


Author: sf
Date: Sun Feb  7 15:09:12 2010
New Revision: 1145

URL: http://svn.debian.org/wsvn/pkg-apache/?sc=1&rev=1145
Log:
- Provide example script to setup additional instance.
- Improve documentation, add NEWS entry.
- Various fixes.

Added:
    trunk/apache2/apache2.2-common.examples
    trunk/apache2/secondary-init-script
    trunk/apache2/setup-instance
Modified:
    trunk/apache2/NEWS
    trunk/apache2/README.multiple-instances
    trunk/apache2/apache2.2-common.apache2.init
    trunk/apache2/apache2ctl
    trunk/apache2/changelog
    trunk/apache2/config-dir/sites-available/default
    trunk/apache2/config-dir/sites-available/default-ssl
    trunk/apache2/rules

Modified: trunk/apache2/NEWS
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/NEWS?rev=1145&op=diff
==============================================================================
--- trunk/apache2/NEWS (original)
+++ trunk/apache2/NEWS Sun Feb  7 15:09:12 2010
@@ -1,3 +1,14 @@
+apache2 (2.2.14-6) unstable; urgency=low
+
+  * Apache now uses the environment variables APACHE_RUN_DIR, APACHE_LOCK_DIR,
+    and APACHE_LOG_DIR in the default configuration.  If you have modified
+    /etc/apache2/envvars, make sure that these variables are set and exported.
+  * There is now some support for running multiple instances of Apache on the
+    same machine. See the documentation in /usr/share/doc/apache2.2-common for
+    details.
+
+ -- Stefan Fritsch <sf at debian.org>  Sun, 07 Feb 2010 13:56:59 +0100
+
 apache2 (2.2.13-2) unstable; urgency=high
 
   * The new support for TLS Server Name Indication added in 2.2.12 causes

Modified: trunk/apache2/README.multiple-instances
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/README.multiple-instances?rev=1145&op=diff
==============================================================================
--- trunk/apache2/README.multiple-instances (original)
+++ trunk/apache2/README.multiple-instances Sun Feb  7 15:09:12 2010
@@ -1,35 +1,33 @@
+Setup
+=====
+
 The scripts apache2ctl, a2enmod, a2ensite, ... and the init script have some
 support for handling multiple instances of apache2 running on the same machine.
 
-The basic idea is to copy /etc/apache2 to /etc/apache2-xxx:
+The basic idea is to copy /etc/apache2 to /etc/apache2-xxx. An example script
+that demonstrates what else needs to be done can be found in
+/usr/share/doc/apache2.2-common/examples/setup-instance. Use with:
 
-# the SUFFIX must not contain spaces or shell meta characters
-SUFFIX=xxx
-# copy configuration
-cp -a /etc/apache2 /etc/apache2-$SUFFIX
-# symlink skripts
-ln -s apache2 /etc/init.d/apache2-$SUFFIX
-for a in a2enmod a2dismod a2ensite a2dissite apache2ctl ; do
-	ln -s /usr/sbin/$a /usr/local/sbin/$a-$SUFFIX
-done
-# setup log dir and logrotate
-cp -a /etc/logrotate.d/apache2 /etc/logrotate.d/apache2-$SUFFIX
-perl -p -i -e s,apache2,apache2-$SUFFIX,g /etc/logrotate.d/apache2-$SUFFIX
-mkdir /var/log/apache2-$SUFFIX
-chmod 750 /var/log/apache2-$SUFFIX
-chown root:adm /var/log/apache2-$SUFFIX
+	sh /usr/share/doc/apache2.2-common/examples/setup-instance xxx
 
-
-Adjust the configuration in /etc/apache2-xxx, especially 'Listen' in ports.conf.
+Adjust the configuration in /etc/apache2-xxx, especially the listen ports in
+ports.conf and in the virtual host directives in
+/etc/apache2-xxx/sites-enabled/*.
 
 You can then use a2enmod-xxx, /etc/init.d/apache2-xxx, ... as usual, and they
 will affect the new instance of apache2.
 
 To start the new apache2 instance on boot, use
-- if you use dependency based boot sequence (the default)
+- if you use dependency based boot sequence (the default):
+  If you don't have ssl keys with passphrases, you may want to set
+  'X-Interactive: false' in /etc/init.d/apache2-xxx to reduce boot time.
+  Then execute:
 	insserv apache2-xxx
 - otherwise:
 	ln -s ../init.d/apache2-xxx /etc/rc2.d/S80apache2-xxx
+
+To make 'apache2ctl-xxx status' work, you need to set APACHE_STATUSURL in
+/etc/apache2-xxx/envvars.
 
 
 Upgrades
@@ -49,6 +47,13 @@
   An advanced scheme may be for every /etc/apache2* dir to be a separate git
   repository so that you can easily pull/push changes from one dir to another.
  
+
+Package removal
+===============
+
+The Apache 2 package will only remove the default configuration files and
+directories.
+
 
 Configuration
 =============
@@ -89,6 +94,6 @@
 MPMs
 ====
 
-You can use different MPMs for different instances by setting APACHE_HTTP to
+You can use different MPMs for different instances by setting APACHE_HTTPD to
 one of /usr/lib/apache2/mpm-*/apache2. Note that some modules like mod_php only
 work with the non-threaded MPMs (prefork, itk).

Modified: trunk/apache2/apache2.2-common.apache2.init
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/apache2.2-common.apache2.init?rev=1145&op=diff
==============================================================================
--- trunk/apache2/apache2.2-common.apache2.init (original)
+++ trunk/apache2/apache2.2-common.apache2.init Sun Feb  7 15:09:12 2010
@@ -12,7 +12,11 @@
 set -e
 
 if [ -n "$APACHE_CONFDIR" ] ; then
-	DIR_SUFFIX=
+	if [ "${APACHE_CONFDIR##/etc/apache2-}" != "$APACHE_CONFDIR}" ] ; then
+		DIR_SUFFIX="${APACHE_CONFDIR##/etc/apache2-}"
+	else
+		DIR_SUFFIX=
+	fi
 elif [ "${0##*/apache2-}" != "$0" ] ; then
 	DIR_SUFFIX="-${0##*/apache2-}"
 	APACHE_CONFDIR=/etc/apache2$DIR_SUFFIX
@@ -253,7 +257,7 @@
 	status)
 		PID=$(pidof_apache) || true
 		if [ -n "$PID" ]; then
-			echo "Apache2 is running (pid $PID)."
+			echo "Apache2$DIR_SUFFIX is running (pid $PID)."
 			exit 0
 		else
 			echo "Apache2$DIR_SUFFIX is NOT running."

Added: trunk/apache2/apache2.2-common.examples
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/apache2.2-common.examples?rev=1145&op=file
==============================================================================
--- trunk/apache2/apache2.2-common.examples (added)
+++ trunk/apache2/apache2.2-common.examples Sun Feb  7 15:09:12 2010
@@ -1,0 +1,2 @@
+debian/setup-instance
+debian/secondary-init-script

Modified: trunk/apache2/apache2ctl
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/apache2ctl?rev=1145&op=diff
==============================================================================
--- trunk/apache2/apache2ctl (original)
+++ trunk/apache2/apache2ctl Sun Feb  7 15:09:12 2010
@@ -44,8 +44,8 @@
 #
 # main configuration directory
 if test -z "$APACHE_CONFDIR" ; then
-	if test "${0##*apache2-}" != "$0" ; then
-		APACHE_CONFDIR="/etc/apache2-${0##*apache2-}"
+	if test "${0##*apache2ctl-}" != "$0" ; then
+		APACHE_CONFDIR="/etc/apache2-${0##*apache2ctl-}"
 	else
 		APACHE_CONFDIR=/etc/apache2
 	fi
@@ -147,5 +147,8 @@
     ERROR=$?
 esac
 
+if [ "$ERROR" != 0 ] ; then
+	echo Action \'"$@"\' failed.
+	echo The Apache error log may have more information.
+fi
 exit $ERROR
-

Modified: trunk/apache2/changelog
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/changelog?rev=1145&op=diff
==============================================================================
--- trunk/apache2/changelog (original)
+++ trunk/apache2/changelog Sun Feb  7 15:09:12 2010
@@ -1,6 +1,5 @@
 apache2 (2.2.14-6) UNRELEASED; urgency=low
 
-  * Move ab and logresolve from /usr/sbin to /usr/bin. Closes: #351450, #564061
   * Use environment variables APACHE_RUN_DIR, APACHE_LOCK_DIR, and
     APACHE_LOG_DIR in the default configuration. If you have modified
     /etc/apache2/envvars, make sure that these variables are set and exported.
@@ -9,6 +8,7 @@
     Closes: #353450
   * Set default compiled-in ServerRoot to /etc/apache2 and make paths in
     apache2.conf relative to ServerRoot.
+  * Move ab and logresolve from /usr/sbin to /usr/bin. Closes: #351450, #564061
   * Fix symlinks in apache2-dbg package. Closes: #567076
   * Fix mod_cache CacheIgnoreURLSessionIdentifiers handling. Closes: #556383
   * Add new init script action graceful-stop (LP: #456381)

Modified: trunk/apache2/config-dir/sites-available/default
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/config-dir/sites-available/default?rev=1145&op=diff
==============================================================================
--- trunk/apache2/config-dir/sites-available/default (original)
+++ trunk/apache2/config-dir/sites-available/default Sun Feb  7 15:09:12 2010
@@ -21,13 +21,13 @@
 		Allow from all
 	</Directory>
 
-	ErrorLog /var/log/apache2/error.log
+	ErrorLog ${APACHE_LOG_DIR}/error.log
 
 	# Possible values include: debug, info, notice, warn, error, crit,
 	# alert, emerg.
 	LogLevel warn
 
-	CustomLog /var/log/apache2/access.log combined
+	CustomLog ${APACHE_LOG_DIR}/access.log combined
 
     Alias /doc/ "/usr/share/doc/"
     <Directory "/usr/share/doc/">

Modified: trunk/apache2/config-dir/sites-available/default-ssl
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/config-dir/sites-available/default-ssl?rev=1145&op=diff
==============================================================================
--- trunk/apache2/config-dir/sites-available/default-ssl (original)
+++ trunk/apache2/config-dir/sites-available/default-ssl Sun Feb  7 15:09:12 2010
@@ -22,13 +22,13 @@
 		Allow from all
 	</Directory>
 
-	ErrorLog /var/log/apache2/error.log
+	ErrorLog ${APACHE_LOG_DIR}/error.log
 
 	# Possible values include: debug, info, notice, warn, error, crit,
 	# alert, emerg.
 	LogLevel warn
 
-	CustomLog /var/log/apache2/ssl_access.log combined
+	CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
 
 	Alias /doc/ "/usr/share/doc/"
 	<Directory "/usr/share/doc/">

Modified: trunk/apache2/rules
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/rules?rev=1145&op=diff
==============================================================================
--- trunk/apache2/rules (original)
+++ trunk/apache2/rules Sun Feb  7 15:09:12 2010
@@ -263,8 +263,9 @@
 		find debian/$$pkg/ -name .svn -exec rm -rf {} + ; \
 	done
 
-	dh_installdocs debian/README.backtrace -papache2.2-common -papache2.2-bin
-	dh_installdocs debian/README.backtrace -Napache2.2-common -Napache2.2-bin
+	dh_installdocs debian/README.backtrace -papache2.2-bin
+	dh_installdocs debian/README.backtrace debian/README.multiple-instances -papache2.2-common
+	dh_installdocs -Napache2.2-common -Napache2.2-bin
 	cp debian/README.Debian debian/apache2-doc/usr/share/doc/apache2-doc/
 	dh_installman
 	dh_bugfiles
@@ -299,6 +300,7 @@
 	rm -rf debian/apache2-dbg/usr/share/doc/apache2-dbg
 	ln -s apache2.2-bin debian/apache2-dbg/usr/share/doc/apache2-dbg
 	dh_link
+	dh_installexamples
 	dh_compress
 	dh_fixperms -Xsuexec
 	chown -R www-data:www-data debian/apache2.2-common/var/cache/apache2

Added: trunk/apache2/secondary-init-script
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/secondary-init-script?rev=1145&op=file
==============================================================================
--- trunk/apache2/secondary-init-script (added)
+++ trunk/apache2/secondary-init-script Sun Feb  7 15:09:12 2010
@@ -1,0 +1,19 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          apache2-XXX
+# Required-Start:    $local_fs $remote_fs $network $syslog
+# Required-Stop:     $local_fs $remote_fs $network $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# X-Interactive:     true
+# Short-Description: Start/stop apache2 web server (config /etc/apache2-XXX)
+### END INIT INFO
+
+set -e
+
+#
+# this init script can be installed as /etc/init.d/apache2-XXX
+#
+
+# source original init script to keep $0 and other arguments
+. /etc/init.d/apache2

Added: trunk/apache2/setup-instance
URL: http://svn.debian.org/wsvn/pkg-apache/trunk/apache2/setup-instance?rev=1145&op=file
==============================================================================
--- trunk/apache2/setup-instance (added)
+++ trunk/apache2/setup-instance Sun Feb  7 15:09:12 2010
@@ -1,0 +1,39 @@
+#!/bin/sh
+
+set -eu
+
+if [ $# != 1 ] ; then
+	echo usage: $0 '<suffix>'
+	exit 1
+fi
+
+# the SUFFIX must not contain spaces or shell meta characters
+SUFFIX=$1
+
+if [ -e /etc/apache2-$SUFFIX ] ; then
+	echo ERROR: /etc/apache2-$SUFFIX already exists
+	exit 2
+fi
+
+echo Setting up /etc/apache2-$SUFFIX ...
+cp -a /etc/apache2 /etc/apache2-$SUFFIX
+
+echo Setting up /etc/init.d/apache2-$SUFFIX ...
+cp /usr/share/doc/apache2.2-common/examples/secondary-init-script /etc/init.d/apache2-$SUFFIX
+# adjust service name (this prevents us from using a simple symlink)
+perl -p -i -e s,XXX,$SUFFIX, /etc/init.d/apache2-$SUFFIX
+chmod 755 /etc/init.d/apache2-$SUFFIX
+
+echo -n Setting up symlinks: 
+for a in a2enmod a2dismod a2ensite a2dissite apache2ctl ; do
+	echo -n " $a-$SUFFIX"
+	ln -s /usr/sbin/$a /usr/local/sbin/$a-$SUFFIX
+done
+echo
+
+echo Setting up /etc/logrotate.d/apache2-$SUFFIX and /var/log/apache2-$SUFFIX ...
+cp -a /etc/logrotate.d/apache2 /etc/logrotate.d/apache2-$SUFFIX
+perl -p -i -e s,apache2,apache2-$SUFFIX,g /etc/logrotate.d/apache2-$SUFFIX
+mkdir /var/log/apache2-$SUFFIX
+chmod 750 /var/log/apache2-$SUFFIX
+chown root:adm /var/log/apache2-$SUFFIX




More information about the Pkg-apache-commits mailing list