6
echo usage: $0 '<suffix>'
10
# the SUFFIX must not contain spaces or shell meta characters
13
if [ -e /etc/apache2-$SUFFIX ] ; then
14
echo ERROR: /etc/apache2-$SUFFIX already exists
18
echo Setting up /etc/apache2-$SUFFIX ...
19
cp -a /etc/apache2 /etc/apache2-$SUFFIX
21
echo Setting up /etc/init.d/apache2-$SUFFIX ...
22
cp /usr/share/doc/apache2.2-common/examples/secondary-init-script /etc/init.d/apache2-$SUFFIX
23
# adjust service name (this prevents us from using a simple symlink)
24
perl -p -i -e s,XXX,$SUFFIX, /etc/init.d/apache2-$SUFFIX
25
chmod 755 /etc/init.d/apache2-$SUFFIX
27
echo -n Setting up symlinks:
28
for a in a2enmod a2dismod a2ensite a2dissite apache2ctl ; do
30
ln -s /usr/sbin/$a /usr/local/sbin/$a-$SUFFIX
34
echo Setting up /etc/logrotate.d/apache2-$SUFFIX and /var/log/apache2-$SUFFIX ...
35
cp -a /etc/logrotate.d/apache2 /etc/logrotate.d/apache2-$SUFFIX
36
perl -p -i -e s,apache2,apache2-$SUFFIX,g /etc/logrotate.d/apache2-$SUFFIX
37
mkdir /var/log/apache2-$SUFFIX
38
chmod 750 /var/log/apache2-$SUFFIX
39
chown root:adm /var/log/apache2-$SUFFIX