Integrated Lets Encrypt into all sites.
--- a/deb/apache-register-2048.bash Sun May 07 12:48:30 2023 +0300
+++ b/deb/apache-register-2048.bash Sun May 07 13:04:33 2023 +0300
@@ -20,7 +20,7 @@
</VirtualHost>
<IfModule mod_ssl.c>
- <VirtualHost 2048.defun.work:443>
+ <VirtualHost $d.defun.work:443>
DocumentRoot /srv/www/$d
ServerName $d.defun.work
--- 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
--- a/deb/apache-register-cooking.bash Sun May 07 12:48:30 2023 +0300
+++ b/deb/apache-register-cooking.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
--- a/deb/apache-register-gadict.bash Sun May 07 12:48:30 2023 +0300
+++ b/deb/apache-register-gadict.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
--- a/deb/apache-register-hg.bash Sun May 07 12:48:30 2023 +0300
+++ b/deb/apache-register-hg.bash Sun May 07 13:04:33 2023 +0300
@@ -40,6 +40,7 @@
cat <<EOF >/etc/apache2/sites-available/hg.conf
<VirtualHost hg.defun.work:*>
DocumentRoot /srv/hg
+ ServerName hg.defun.work
ScriptAliasMatch ^/(.*) /srv/hg/hgweb.cgi/\$1
@@ -50,8 +51,23 @@
AddHandler cgi-script .cgi
</Directory>
</VirtualHost>
+
+<IfModule mod_ssl.c>
+ <VirtualHost hg.defun.work:443>
+ DocumentRoot /srv/hg
+ ServerName hg.defun.work
+
+ ScriptAliasMatch ^/(.*) /srv/hg/hgweb.cgi/\$1
+
+ <Directory "/srv/hg/">
+ Options +ExecCGI
+ Require all granted
+ AllowOverride None
+ AddHandler cgi-script .cgi
+ </Directory>
+ </VirtualHost>
+</IfModule>
EOF
a2ensite hg
-systemctl reload apache2
-
+service apache2 reload
--- a/deb/apache-register-resume.bash Sun May 07 12:48:30 2023 +0300
+++ b/deb/apache-register-resume.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
--- a/deb/apache-register-stat.bash Sun May 07 12:48:30 2023 +0300
+++ b/deb/apache-register-stat.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
--- a/deb/apache-register-test.bash Sun May 07 12:48:30 2023 +0300
+++ b/deb/apache-register-test.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
--- a/deb/apache-register-tips.bash Sun May 07 12:48:30 2023 +0300
+++ b/deb/apache-register-tips.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
--- a/deb/apache-register-welcome.bash Sun May 07 12:48:30 2023 +0300
+++ b/deb/apache-register-welcome.bash Sun May 07 13:04:33 2023 +0300
@@ -12,12 +12,28 @@
cat <<EOF >/etc/apache2/sites-available/$d.conf
<VirtualHost defun.work:*>
DocumentRoot /srv/www/$d
+ ServerName defun.work
<Directory "/srv/www/$d/">
Require all granted
</Directory>
</VirtualHost>
+
+<IfModule mod_ssl.c>
+ <VirtualHost defun.work:443>
+ DocumentRoot /srv/www/$d
+ ServerName 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