backup_done=0
need_restart=0
-apache2_sslcert=0
apache2_sslcf=
apache2_sslckf=
apache2_sslccf=
cp_echo "CN: Enabling SSL port (443) for Apache2 web server."
out=$(mktemp ${PORTCONF}.XXXXXX)
+ temp_files="${temp_files} ${out}"
if [ -f "$PORTCONF" ]; then
cp $PORTCONF $out
chmod 644 $PORTCONF
need_restart=1
- temp_files="${temp_files} ${out}"
fi
}
# Apache2 SSL certificate.
#
-has_listen_ssl=0
-
if [ -d "$CONFDIR/conf.d" ] && [ -n "$(ls $CONFDIR/conf.d)" ]; then
listen_ssl_mask=$CONFDIR/conf.d/*
fi
if [ -f "$file" ]; then
if egrep -iq '^[[:space:]]*<VirtualHost .*443[[:space:]]*>' $file; then
has_listen_ssl=1
- apache2_sslcert=1
break
fi
fi
done
-if [ $apache2_sslcert -eq 0 ]; then
+if [ $has_listen_ssl -eq 0 ]; then
db_get apache2-cn/sslcf || true
apache2_sslcf="$RET"
# Add VirtualHost for SSL?
#
-if [ $apache2_sslcert -eq 0 ]; then
+if [ $has_listen_ssl -eq 0 ]; then
if [ -f "$CONFDIR/sites-available/ssl" ]; then
cp_backup_conffile -d $BACKUPDIR -p $CONFDIR/sites-available/ssl
# Check SSL certificates location for VirtualHosts.
#
-if [ $apache2_sslcert -eq 0 ]; then
+if [ $has_listen_ssl -eq 0 ]; then
chk_conf_tag "${CONFDIR}/sites-available/ssl"
if [ $RET -eq 0 ] && [ -n "$apache2_sslcf" ]; then
# SSLCertificateChainFile
if [ -n "$apache2_sslccf" ]; then
- cp_check_and_sed "^# SSLCertificateChainFile \/etc\/ssl\/certs/cert-chain\.pem" \
- "s#\# SSLCertificateChainFile /etc/ssl/certs/cert-chain.pem#SSLCertificateChainFile $apache2_sslccf #g" \
+ cp_check_and_sed "^[[:space:]]*# SSLCertificateChainFile \/etc\/ssl\/certs\/(sureserverEDU|cert-chain)\.pem" \
+ "s#\# SSLCertificateChainFile /etc/ssl/certs/\(sureserverEDU\|cert-chain\).pem#SSLCertificateChainFile $apache2_sslccf #g" \
$SSLTMP || true
fi