diff options
| author | Stefan Fritsch <sf@debian.org> | 2010-02-07 15:09:12 +0000 |
|---|---|---|
| committer | Stefan Fritsch <sf@sfritsch.de> | 2012-01-02 10:37:06 +0100 |
| commit | 41c4ead5ea9d02c98917057f510e166b4a0e26ae (patch) | |
| tree | d8fbdf6623fe06f46dbe9433f2165fee566e4f8b /debian/setup-instance | |
| parent | 3dd9f0264f9934a1602d8537e59dfcbb190236bc (diff) | |
| download | apache2-41c4ead5ea9d02c98917057f510e166b4a0e26ae.tar.gz | |
- Provide example script to setup additional instance.
- Improve documentation, add NEWS entry.
- Various fixes.
git-svn-id: svn+ssh://svn.debian.org/svn/pkg-apache/trunk/apache2@1145 01b336ce-410b-0410-9a02-a0e7f243c266
Diffstat (limited to 'debian/setup-instance')
| -rw-r--r-- | debian/setup-instance | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/debian/setup-instance b/debian/setup-instance new file mode 100644 index 00000000..e91ddb1f --- /dev/null +++ b/debian/setup-instance @@ -0,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 |
