6 . /usr/share/debconf/confmodule
8 CONFOLD="/etc/apache/httpd.conf"
10 CONF="$CONFDIR/apache2.conf"
14 # Check for existing SSL VirtualHosts.
17 if [ -d "$CONFDIR/conf.d" ] && [ -n "$(ls $CONFDIR/conf.d)" ]; then
18 listen_ssl_mask=$CONFDIR/conf.d/*
20 if [ -d "$CONFDIR/sites-enabled" ] && [ -n "$(ls $CONFDIR/sites-enabled)" ]; then
21 listen_ssl_mask=$listen_ssl_mask" "$CONFDIR/sites-enabled/*
24 for file in $CONF $listen_ssl_mask; do
25 if [ -f "$file" ]; then
26 if egrep -iq '^[[:space:]]*<VirtualHost .*443[[:space:]]*>' $file; then
33 if [ $has_listen_ssl -eq 1 ]; then
35 # SSL configuration already exists - no need for SSL certificates.
36 db_set apache2-cn/sslcf "X" || true
37 db_set apache2-cn/sslckf "X" || true
38 db_set apache2-cn/sslccf "X" || true
45 while [ $SSLCF -eq 1 ]; do
47 # SSL certificate file input.
48 db_input critical apache2-cn/sslcf || true
51 db_get apache2-cn/sslcf || true
53 if [ -n "$RET" ]; then
55 if [ -f "$RET" ]; then
57 # SSL certificate file exists.
61 while [ $SSLCKF -eq 1 ]; do
63 # SSL certificate key file input.
64 db_input critical apache2-cn/sslckf || true
67 db_get apache2-cn/sslckf || true
69 if [ -n "$RET" ]; then
71 if [ -f "$RET" ]; then
73 # SSL certificate key file exists.
77 while [ $SSLCCF -eq 1 ]; do
79 # SSL certificate chain file input.
80 db_input critical apache2-cn/sslccf || true
83 db_get apache2-cn/sslccf || true
85 if [ -n "$RET" ]; then
87 if [ -f "$RET" ]; then
89 # SSL certificate chain file exists.
102 # No SSL certificates specified.
103 db_set apache2-cn/sslcf "" || true
104 db_set apache2-cn/sslckf "" || true
105 db_set apache2-cn/sslccf "" || true
112 # Use WWW VirtualHost?
113 db_subst apache2-cn/wwwhost stroj_domena "${HOST}.${DOMAIN}"
114 db_subst apache2-cn/wwwhost www_domena "www.${DOMAIN}"
115 db_input critical apache2-cn/wwwhost || true