From c39d6991bfa4658524071acfedb0e9c99a938f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Tue, 7 Oct 2008 18:28:39 +0000 Subject: [PATCH] configure SSL properly, that is, only if a certificate is provided --- install/alternc.install | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/install/alternc.install b/install/alternc.install index edffe8a4..9b095c9b 100644 --- a/install/alternc.install +++ b/install/alternc.install @@ -210,17 +210,22 @@ if [ -x /usr/sbin/apache2 ]; then a2enmod $php s="apache2" fi - if ! grep '^Listen.*443$' /etc/apache2/ports.conf; then - echo "Listen 443" >> /etc/apache2/ports.conf - s="apache2" - fi - if [ ! -h /etc/apache2/mods-enabled/ssl.load ] ; then - a2enmod ssl - s="apache2" - fi - if [ ! -h /etc/apache2/conf.d/alternc-ssl.conf ] && [ -e /etc/apache2/conf.d/ ]; then - ln -sf /etc/alternc/apache-ssl.conf /etc/apache2/conf.d/alternc-ssl.conf - s="apache2" + if [ -e /etc/alternc/apache.pem ]; then + if ! grep '^Listen.*443$' /etc/apache2/ports.conf; then + echo "Listen 443" >> /etc/apache2/ports.conf + s="apache2" + fi + if [ ! -h /etc/apache2/mods-enabled/ssl.load ] ; then + a2enmod ssl + s="apache2" + fi + if [ ! -h /etc/apache2/conf.d/alternc-ssl.conf ] && [ -e /etc/apache2/conf.d/ ]; then + 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 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