Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / share / doc / apache2 / examples / | server ip : 172.67.156.115 your ip : 108.162.241.221 H O M E |
Filename | /usr/share/doc/apache2/examples/setup-instance |
Size | 1.11 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 10:07 |
Last modified | 26-Nov-2018 20:08 |
Last accessed | 07-Jul-2025 04:41 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#!/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/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
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/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