-# Reload Apache2 web server
-if [ -x /etc/init.d/apache2 ]; then
- /etc/init.d/apache2 reload || true
+mv_conffile /etc/apache2/conf.d/$PKG.conf \
+ /etc/apache2/conf-available/$PKG.conf
+
+if [ -f "$WCONF" ]; then
+
+ # Backup first.
+ if cp_check_and_backup "$WCONF"; then
+ cp_echo "CN: Old $WCONF saved as /var/backups/$WCONFBAK.bak."
+ fi
+
+ # Check for OutputDir
+ temp=`awk 'tolower($1) == "outputdir" { print $2; }' $WCONF | tail -n 1`
+ if [ "$temp" != "$WDIR" ]; then
+ cp_echo "CN: Found custom OutputDir value: $temp"
+ db_set webalizer/directory "$temp" || true
+ customized=1
+ fi
+
+ # Check for ReportTitle
+ temp=`awk 'tolower($1) == "reporttitle" { for(i=2; i<NF; i++) \
+ printf("%s ", tolower($i)); print tolower($(NF)) }' $WCONF | tail -n 1`
+ if [ "$temp" = "$oldreporttitle" ]; then
+ temp_re="^[[:space:]]*ReportTitle[[:space:]]*${oldreporttitle}$"
+ cp_check_and_sed "." \
+ "s/$temp_re/ReportTitle ${reporttitle}/I" \
+ "$WCONF" || true
+ db_set webalizer/doc_title "$reporttitle" || true
+ fi
+else
+ cp_echo "CN: Configuration file $WCONF is missing."
+ customized=1