From de5d7e9a5aa65ec5fa2a5965f393e5672f53a93c Mon Sep 17 00:00:00 2001 From: gauthiier Date: Wed, 28 Nov 2018 10:13:04 +0100 Subject: [PATCH] vhost --- vhost-apache2/vhost.py | 9 +++++++-- vhost-apache2/vhost_tmpl | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/vhost-apache2/vhost.py b/vhost-apache2/vhost.py index 0aa1b25..711270e 100755 --- a/vhost-apache2/vhost.py +++ b/vhost-apache2/vhost.py @@ -93,8 +93,13 @@ def vhost_add(domain): # check is ssl cert exists cert = os.path.join('/etc/letsencrypt/live', domain) if not os.path.exists(cert): - print("SSL certificates do not exist for domain - " + domain) - print("Please make sure to place them in " + cert + "to allow secure https") + print("warning: SSL certificates do not exist for domain - " + domain) + print("warning: Please make sure to place them in " + cert + " to allow secure https connection to your site.") + + # mv conf file to apache + if y_n_question("Move " + vhost_file + " to /etc/apache2/sites-available/ ?"): + vhost_conf_file = os.path.join('/etc/apache2/sites-available/', domain + '.conf') + subprocess.call(['sudo', 'mv', vhost_file, vhost_conf_file]) def vhost_remove(domain): print(" removing domain — " + domain) diff --git a/vhost-apache2/vhost_tmpl b/vhost-apache2/vhost_tmpl index b7f5a49..c30aab2 100644 --- a/vhost-apache2/vhost_tmpl +++ b/vhost-apache2/vhost_tmpl @@ -23,4 +23,5 @@ SSLEngine on SSLCertificateFile /etc/letsencrypt/live/%domain?/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/%domain?/privkey.pem + SSLCertificateChainFile /etc/letsencrypt/live/%domain?/fullchain.pem \ No newline at end of file