~ubuntu-branches/ubuntu/trusty/apache2/trusty

« back to all changes in this revision

Viewing changes to debian/setup-instance

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-05-05 01:28:04 UTC
  • mfrom: (14.3.15 sid)
  • Revision ID: james.westby@ubuntu.com-20100505012804-vbouq0xs3tu2vvij
Tags: 2.2.15-5ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/{control, rules}: Enable PIE hardening.
  - debian/{control, rules, apache2.2-common.ufw.profile}: Add ufw profiles.
  - debian/control: Add bzr tag and point it to our tree.
  - debian/apache2-2.common.apache2.init: Add graceful restart (LP: #456381)
  + Dropped:
    - debian/patches/206-fix-potential-memory-leaks.dpatch: No longer needed.
    - debian/patches/206-report-max-client-mpm-worker.dpatch: No longer needed.
    - debian/config-dir/apache2.conf: Merged back from debian.
    - mod-reqtimeout functionality: Merge back from debian.
    - debian/patches/204_CVE-2010-0408.dpatch: No longer needed.
    - debian/patches/205_CVE-2010-0434.dpatch: No longer needed.
    - debian/patches/203_fix-ab-segfault.dpatch: No longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
set -eu
 
4
 
 
5
if [ $# != 1 ] ; then
 
6
        echo usage: $0 '<suffix>'
 
7
        exit 1
 
8
fi
 
9
 
 
10
# the SUFFIX must not contain spaces or shell meta characters
 
11
SUFFIX=$1
 
12
 
 
13
if [ -e /etc/apache2-$SUFFIX ] ; then
 
14
        echo ERROR: /etc/apache2-$SUFFIX already exists
 
15
        exit 2
 
16
fi
 
17
 
 
18
echo Setting up /etc/apache2-$SUFFIX ...
 
19
cp -a /etc/apache2 /etc/apache2-$SUFFIX
 
20
 
 
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
 
26
 
 
27
echo -n Setting up symlinks: 
 
28
for a in a2enmod a2dismod a2ensite a2dissite apache2ctl ; do
 
29
        echo -n " $a-$SUFFIX"
 
30
        ln -s /usr/sbin/$a /usr/local/sbin/$a-$SUFFIX
 
31
done
 
32
echo
 
33
 
 
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