Modified carnet.conf. Added debian/config and debian/templates
authorDragan Dosen <bane@nekkar.carnet.hr>
Thu, 3 Apr 2008 19:59:39 +0000 (21:59 +0200)
committerDragan Dosen <bane@nekkar.carnet.hr>
Thu, 3 Apr 2008 19:59:39 +0000 (21:59 +0200)
files.

carnet.conf
debian/config [new file with mode: 0755]
debian/templates [new file with mode: 0644]

index c938b6b..eab9aeb 100644 (file)
@@ -1,3 +1,9 @@
+## Begin - Generated by CARNet package apache2-cn
+#
+#  REMOVE this whole block if you DON'T WANT apache2-cn
+#  to edit your configuration file.
+#
+## End - Generated by CARNet package apache2-cn
 <IfModule mod_mime.c>
     AddDefaultCharset off
 
@@ -9,9 +15,6 @@
 </IfModule>
 
 <IfModule mod_dir.c>
-    DirectoryIndex index.html index.htm index.cgi index.pl index.php index.xhtml
+    DirectoryIndex index.php index.html index.htm index.cgi index.pl index.xhtml
 </IfModule>
 
-<IfModule mod_ssl.c>
-    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
-</IfModule>
diff --git a/debian/config b/debian/config
new file mode 100755 (executable)
index 0000000..24d86fc
--- /dev/null
@@ -0,0 +1,118 @@
+#!/bin/sh
+
+set -e
+
+# Load debconf
+. /usr/share/debconf/confmodule
+
+CONFOLD="/etc/apache/httpd.conf"
+CONFDIR="/etc/apache2"
+CONF="$CONFDIR/apache2.conf"
+HOST=$(hostname)
+DOMAIN=$(hostname -d)
+
+# Check for existing SSL VirtualHosts.
+has_listen_ssl=0
+
+if [ -d "$CONFDIR/conf.d" ] && [ -n "$(ls $CONFDIR/conf.d)" ]; then
+        listen_ssl_mask=$CONFDIR/conf.d/*
+fi
+if [ -d "$CONFDIR/sites-enabled" ] && [ -n "$(ls $CONFDIR/sites-enabled)" ]; then
+        listen_ssl_mask=$listen_ssl_mask" "$CONFDIR/sites-enabled/*
+fi
+
+for file in $CONF $listen_ssl_mask; do
+    if [ -f "$file" ]; then
+        if egrep -iq '^[[:space:]]*<VirtualHost .*443[[:space:]]*>' $file; then
+           has_listen_ssl=1
+           break
+       fi
+    fi
+done
+
+if [ $has_listen_ssl -eq 1 ]; then
+
+       # SSL configuration already exists - no need for SSL certificates.    
+       db_set apache2-cn/sslcf "X" || true
+       db_set apache2-cn/sslckf "X" || true
+       db_set apache2-cn/sslccf "X" || true
+
+else
+    
+       # SSL certificates?
+       #
+       SSLCF=1
+       while [ $SSLCF -eq 1 ]; do
+
+           # SSL certificate file input.
+           db_input critical apache2-cn/sslcf || true
+           db_go || true
+           
+           db_get apache2-cn/sslcf || true
+           
+           if [ -n "$RET" ]; then
+
+               if [ -f "$RET" ]; then
+               
+                   # SSL certificate file exists.
+                   SSLCF=0
+                   
+                   SSLCKF=1
+                   while [ $SSLCKF -eq 1 ]; do
+                   
+                       # SSL certificate key file input.
+                       db_input critical apache2-cn/sslckf || true
+                       db_go || true
+               
+                       db_get apache2-cn/sslckf || true
+               
+                       if [ -n "$RET" ]; then
+                       
+                           if [ -f "$RET" ]; then
+                       
+                               # SSL certificate key file exists.    
+                               SSLCKF=0
+                               
+                               SSLCCF=1
+                               while [ $SSLCCF -eq 1 ]; do
+                               
+                                   # SSL certificate chain file input.
+                                   db_input critical apache2-cn/sslccf || true
+                                   db_go || true
+                                   
+                                   db_get apache2-cn/sslccf || true
+                                   
+                                   if [ -n "$RET" ]; then
+                                           
+                                       if [ -f "$RET" ]; then
+                                       
+                                           # SSL certificate chain file exists.
+                                           SSLCCF=0
+                                       fi
+                                   else
+                                       SSLCCF=0
+                                   fi
+                               done
+                           fi
+                       fi
+                   done
+               fi
+           else
+           
+               # No SSL certificates specified.
+               db_set apache2-cn/sslcf "" || true
+               db_set apache2-cn/sslckf "" || true
+               db_set apache2-cn/sslccf "" || true
+               
+               SSLCF=0
+           fi
+       done
+fi
+
+# Use WWW VirtualHost?
+db_subst apache2-cn/wwwhost stroj_domena "${HOST}.${DOMAIN}"
+db_subst apache2-cn/wwwhost www_domena "www.${DOMAIN}"
+db_input critical apache2-cn/wwwhost || true
+db_go || true
+
+exit 0
diff --git a/debian/templates b/debian/templates
new file mode 100644 (file)
index 0000000..c893ff8
--- /dev/null
@@ -0,0 +1,38 @@
+Template: apache2-cn/sslcf
+Type: string
+Description: SSL Certificate:
+ Upisite lokaciju vec postojeceg SSL certifikata. U slucaju da nemate
+ SSL certifikate, ostavite ovo polje praznim - ne morate nista upisivati.
+ Instalacija ce automatski generirati SSL certifikat i obaviti konfiguraciju
+ Vaseg Apache2 web servera.
+ .
+ Primjer: /etc/ssl/certs/apache2.pem
+
+Template: apache2-cn/sslckf
+Type: string
+Description: SSL Certificate Key:
+ Upisite lokaciju vec postojece datoteke koja sadrzi SSL kljuc.
+ .
+ Primjer: /etc/ssl/private/apache2.key
+
+Template: apache2-cn/sslccf
+Type: string
+Description: SSL Certificate Chain:
+ Upisite lokaciju vec postojece SSL chain datoteke. U slucaju da nemate
+ SSL chain datoteku, ostavite ovo polje praznim.
+ .
+ Primjer: /etc/ssl/certs/sureserverEDU.pem
+
+Template: apache2-cn/wwwhost
+Type: boolean
+Description: Dodati WWW VirtualHost u konfiguraciju web servera?
+ Zelite li da Apache2 web server posluzuje i web stranice s adresom oblika
+ ${www_domena}? U slucaju DA to zelite, Apache2 web server ce
+ posluzivati web stranice na adresama:
+ .
+ http://${stroj_domena}/, https://${www_domena}, te https://${www_domena} (SSL).
+ .
+ Ukoliko to NE zelite, Apache2 server ce posluzivati stranice na adresama:
+ .
+ http://${stroj_domena} i https://${stroj_domena}.