1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
#!/bin/sh -e
if [ ! -e /etc/apache/conf ]
then
ln -s . /etc/apache/conf
fi
if [ ! -e /etc/apache/mime.types ]
then
ln -s ../mime.types /etc/apache/mime.types
fi
if [ "$1" != configure ]
then
exit 0
fi
chmod -R go=rX /usr/lib/apache /usr/doc/apache
update-rc.d apache defaults 91 20 > /dev/null
if [ -e /etc/suid.conf -a -x /usr/sbin/suidregister ]
then
suidregister -s apache /usr/bin/htpasswd root root 755
suidregister -s apache /usr/lib/apache/suexec root root 755
fi
if [ -d /etc/httpd ]
then
echo "Directory /etc/httpd is way obsolete, and should be removed."
fi
if [ -d /usr/lib/httpd/cgi-bin ]
then
echo "Copying CGI files to /usr/lib/cgi-bin."
cp -ia /usr/lib/httpd/cgi-bin/* /usr/lib/cgi-bin || true
fi
if [ -d /usr/lib/httpd ]
then
echo "Directory /usr/lib/httpd is now obsolete, and should be removed."
echo "(Icons are in /usr/share/apache/icons, CGI in /usr/lib/cgi-bin.)"
echo
fi
if [ -d /var/log/apache-httpd ]
then
echo
echo 'Copying log files to their new location...'
(cd /var/log/apache-httpd; tar cf - .) |
(cd /var/log/apache; tar xpf -) && rm -rf /var/log/apache-httpd
(cd /var/log/apache; for f in `find . \( -name \*access_log\* -o \
-name \*error_log\* \) -print`; do
new=`echo $f | sed 's,_log$,.log,'`;
if [ "$new" != "$f" -a -f "$new" ]
then
tmpl=$TMPDIR/`basename $new`.$$
cat "$f" "$new" >$tmpl && mv -f "$tmpl" "$new" && rm -f "$f"
else
mv -f $f "`echo $f | sed 's,_log,.log,'`";
fi; done)
fi
if [ -d /etc/httpd -o /var/log/apache-httpd -o -d /usr/lib/httpd ]
then
echo
fi
if grep assert-perl /usr/sbin/apacheconfig > /dev/null 2>&1 \
&& /usr/sbin/apacheconfig --assert-perl > /dev/null 2>&1
then
if ! /usr/sbin/apacheconfig --update
then
echo
echo -n "Configuration failed! "
echo "Run \"apacheconfig\" to try this again later."
echo
fi
else
echo
echo ERROR: apacheconfig could not be run. It may be the wrong
echo version, or perl may not be fully configured yet. When
echo fixed, run \"dpkg --configure apache\" or \"apacheconfig\".
echo
echo -n "Press Enter to continue: "
read
echo
exit 1;
fi
cat <<EOF
Apache can be reconfigured at any time with the "apacheconfig" command.
EOF
exit 0
|