From 4e93316a1006dec0523ce2e169a6c31b78808d57 Mon Sep 17 00:00:00 2001 From: Dragan Dosen Date: Sun, 6 Apr 2008 23:57:32 +0200 Subject: [PATCH] Modified debian/config - first time install and dpkg-reconfigure. Modified debian/postinst - detect apache2-cn/sarge configuration files for VirtualHosts. --- debian/changelog | 18 +++++++++++++++++- debian/config | 13 +++++++++++++ debian/postinst | 16 ++++++++++------ 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1cac587..c8d5c2b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,22 @@ apache2-cn (2.2-3) stable; urgency=low - * TODO.... + * Detekcija apache2-cn/sarge konfiguracije (rijeseno: #3160). + * Dodani debian/config i debian/templates - korisnik je upitan + za SSL certifikate i WWW VirtualHost, koristi se debconf. + * Podesavanje postavki (SSL i VirtualHost-ovi) odvija se samo + kod prve instalacije paketa ili u slucaju da se pokrene + dpkg-reconfigure. + * Stare AOSI postavke (/etc/apache2/conf.d/aosi-www.conf i + /etc/apache2/conf.d/aosi.conf) se brisu, u slucaju da postoje. + * Provjera dozvola za svaku generiranu konfiguracijsku datoteku + (file access permissions, chmod 644). + * Deaktivacija monit konfiguracije za Apache web server + (/etc/monit.d/apache1.conf), a zatim restart monit servisa. + * Ponekad se zna dogoditi da se Apache web server ne zaustavi + dovoljno brzo - u tom se slucaju Apache web server zaustavlja + na silu. + * Automatsko prepravljanje CustomLog i ErrorLog postavki - staza + /var/log/apache/ se postavlja u /var/log/apache2/. -- Dragan Dosen Wed, 2 Apr 2008 12:37:00 +0200 diff --git a/debian/config b/debian/config index e430173..6574486 100755 --- a/debian/config +++ b/debian/config @@ -5,6 +5,19 @@ set -e # Load debconf . /usr/share/debconf/confmodule +if [ "$1" != reconfigure ]; then + + apache2_done=1 + + db_fget apache2-cn/wwwhost seen + if [ "$RET" != "true" ]; then + apache2_done=0 + fi + + test $apache2_done -eq 1 && exit 0 +fi + + CONFDIR="/etc/apache2" CONF="$CONFDIR/apache2.conf" HOST=$(hostname) diff --git a/debian/postinst b/debian/postinst index d2a994f..335fabb 100755 --- a/debian/postinst +++ b/debian/postinst @@ -478,8 +478,11 @@ fi # Add VirtualHosts. # -db_get apache2-cn/wwwhost || true -if [ "$RET" = "true" ]; then +db_fget apache2-cn/wwwhost seen +if [ "$RET" != "true" ]; then + + db_get apache2-cn/wwwhost || true + if [ "$RET" = "true" ]; then # Add WWW VirtualHost. if [ -f "$CONFDIR/sites-available/$FQDN" ]; then @@ -500,7 +503,7 @@ if [ "$RET" = "true" ]; then install_vhost default www.$DOMAIN www.$DOMAIN need_restart=1 fi -else + else # No WWW VirtualHost. if [ -f "$CONFDIR/sites-available/$FQDN" ]; then @@ -512,6 +515,7 @@ else install_vhost -nvh -d -r $FQDN default $FQDN 000-$FQDN need_restart=1 fi + fi fi @@ -555,9 +559,9 @@ if [ $apache2_sslcert -eq 0 ]; then # SSLCertificateChainFile if [ -n "$apache2_sslccf" ]; then - cp_check_and_sed "^# SSLCertificateChainFile \/etc\/ssl\/certs/sureserverEDU\.pem" \ - "s#\# SSLCertificateChainFile /etc/ssl/certs/sureserverEDU.pem#SSLCertificateChainFile $apache2_sslccf #g" \ - $SSLTMP || true + cp_check_and_sed "^# SSLCertificateChainFile \/etc\/ssl\/certs/sureserverEDU\.pem" \ + "s#\# SSLCertificateChainFile /etc/ssl/certs/sureserverEDU.pem#SSLCertificateChainFile $apache2_sslccf #g" \ + $SSLTMP || true fi cp_mv $SSLTMP ${CONFDIR}/sites-available/ssl -- 1.7.10.4