deb/apache-register-blog.bash
changeset 21 52f40bd9e114
parent 14 719ced1ac5c3
child 31 461eed8e7463
--- a/deb/apache-register-blog.bash	Sun May 07 12:48:30 2023 +0300
+++ b/deb/apache-register-blog.bash	Sun May 07 13:04:33 2023 +0300
@@ -11,13 +11,29 @@
 
 cat <<EOF >/etc/apache2/sites-available/$d.conf
 <VirtualHost $d.defun.work:*>
-	DocumentRoot /srv/www/$d
+    DocumentRoot /srv/www/$d
+    ServerName $d.defun.work
 
     <Directory "/srv/www/$d/">
         Require all granted
     </Directory>
 </VirtualHost>
+
+<IfModule mod_ssl.c>
+  <VirtualHost $d.defun.work:443>
+	DocumentRoot /srv/www/$d
+    ServerName $d.defun.work
+
+    <Directory "/srv/www/$d/">
+        Require all granted
+    </Directory>
+
+    SSLCertificateFile /etc/letsencrypt/live/defun.work/fullchain.pem
+    SSLCertificateKeyFile /etc/letsencrypt/live/defun.work/privkey.pem
+    Include /etc/letsencrypt/options-ssl-apache.conf
+  </VirtualHost>
+</IfModule>
 EOF
 
 a2ensite $d
-service apache2 restart
+service apache2 reload