Modified debian/config - first time install and dpkg-reconfigure.
authorDragan Dosen <bane@nekkar.carnet.hr>
Sun, 6 Apr 2008 21:57:32 +0000 (23:57 +0200)
committerDragan Dosen <bane@nekkar.carnet.hr>
Sun, 6 Apr 2008 21:58:56 +0000 (23:58 +0200)
Modified debian/postinst - detect apache2-cn/sarge configuration
files for VirtualHosts.

debian/changelog
debian/config
debian/postinst

index 1cac587..c8d5c2b 100644 (file)
@@ -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 <ddosen@ffzg.hr>  Wed,  2 Apr 2008 12:37:00 +0200
 
index e430173..6574486 100755 (executable)
@@ -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)
index d2a994f..335fabb 100755 (executable)
@@ -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