+## 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
</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>
--- /dev/null
+#!/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
--- /dev/null
+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}.
+