configure SSL properly, that is, only if a certificate is provided

This commit is contained in:
Antoine Beaupré 2008-10-07 18:28:39 +00:00
parent 72328a9f4b
commit c39d6991bf
1 changed files with 16 additions and 11 deletions

View File

@ -210,17 +210,22 @@ if [ -x /usr/sbin/apache2 ]; then
a2enmod $php a2enmod $php
s="apache2" s="apache2"
fi fi
if ! grep '^Listen.*443$' /etc/apache2/ports.conf; then if [ -e /etc/alternc/apache.pem ]; then
echo "Listen 443" >> /etc/apache2/ports.conf if ! grep '^Listen.*443$' /etc/apache2/ports.conf; then
s="apache2" echo "Listen 443" >> /etc/apache2/ports.conf
fi s="apache2"
if [ ! -h /etc/apache2/mods-enabled/ssl.load ] ; then fi
a2enmod ssl if [ ! -h /etc/apache2/mods-enabled/ssl.load ] ; then
s="apache2" a2enmod ssl
fi s="apache2"
if [ ! -h /etc/apache2/conf.d/alternc-ssl.conf ] && [ -e /etc/apache2/conf.d/ ]; then fi
ln -sf /etc/alternc/apache-ssl.conf /etc/apache2/conf.d/alternc-ssl.conf if [ ! -h /etc/apache2/conf.d/alternc-ssl.conf ] && [ -e /etc/apache2/conf.d/ ]; then
s="apache2" ln -sf /etc/alternc/apache-ssl.conf /etc/apache2/conf.d/alternc-ssl.conf
s="apache2"
fi
else
echo "SSL not configured"
echo "create a certificate in /etc/alternc/apache.pem and rerun alternc.install"
fi fi
if [ ! -h /etc/apache2/conf.d/alternc.conf ] && [ -e /etc/apache2/conf.d/ ]; then if [ ! -h /etc/apache2/conf.d/alternc.conf ] && [ -e /etc/apache2/conf.d/ ]; then
ln -sf /etc/alternc/apache2.conf /etc/apache2/conf.d/alternc.conf ln -sf /etc/alternc/apache2.conf /etc/apache2/conf.d/alternc.conf