6 . /usr/share/debconf/confmodule
9 CONF="$CONFDIR/apache2.conf"
14 # Check for existing SSL VirtualHosts.
18 if [ -d "$CONFDIR/conf.d" ] && [ -n "$(ls $CONFDIR/conf.d)" ]; then
19 listen_ssl_mask=$CONFDIR/conf.d/*
21 if [ -d "$CONFDIR/sites-enabled" ] && [ -n "$(ls $CONFDIR/sites-enabled)" ]; then
22 listen_ssl_mask=$listen_ssl_mask" "$CONFDIR/sites-enabled/*
25 for file in $CONF $listen_ssl_mask; do
26 if [ -f "$file" ]; then
27 if egrep -iq '^[[:space:]]*<VirtualHost .*443[[:space:]]*>' $file; then
37 if [ $has_listen_ssl -eq 1 ]; then
39 # SSL configuration already exists - no need for SSL certificates.
40 db_set apache2-cn/sslcf "" || true
41 db_set apache2-cn/sslckf "" || true
42 db_set apache2-cn/sslccf "" || true
46 # SSL certificates information..
48 while [ $SSLCF -eq 1 ]; do
50 # SSL certificate file input.
51 db_input critical apache2-cn/sslcf || true
54 db_get apache2-cn/sslcf || true
56 if [ -n "$RET" ]; then
58 if [ -f "$RET" ]; then
60 # SSL certificate file exists.
64 while [ $SSLCKF -eq 1 ]; do
66 # SSL certificate key file input.
67 db_input critical apache2-cn/sslckf || true
70 db_get apache2-cn/sslckf || true
72 if [ -n "$RET" ]; then
74 if [ -f "$RET" ]; then
76 # SSL certificate key file exists.
80 while [ $SSLCCF -eq 1 ]; do
82 # SSL certificate chain file input.
83 db_input critical apache2-cn/sslccf || true
86 db_get apache2-cn/sslccf || true
88 if [ -n "$RET" ]; then
90 if [ -f "$RET" ]; then
92 # SSL certificate chain file exists.
105 # No SSL certificates specified.
106 db_set apache2-cn/sslcf "" || true
107 db_set apache2-cn/sslckf "" || true
108 db_set apache2-cn/sslccf "" || true
116 # Use WWW VirtualHost?
118 db_subst apache2-cn/wwwhost stroj_domena "${HOST}.${DOMAIN}"
119 db_subst apache2-cn/wwwhost www_domena "www.${DOMAIN}"
120 db_input critical apache2-cn/wwwhost || true