User Tools

Site Tools


apache

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
apache [2021/09/22 18:46]
admin
apache [2021/09/22 19:18] (current)
admin [Example Virtual Host]
Line 2: Line 2:
  
 ==== Example Virtual Host ===== ==== Example Virtual Host =====
-This should be created in ''/​etc/​apache2/​sites-available/'':​+This should be created in ''/​etc/​apache2/​sites-available/​opensource.glasgow.social.conf'':​
 <​code>​ <​code>​
 <​VirtualHost *:80> <​VirtualHost *:80>
Line 11: Line 11:
  
         ErrorLog ${APACHE_LOG_DIR}/​opensource.glasgow.social-error.log         ErrorLog ${APACHE_LOG_DIR}/​opensource.glasgow.social-error.log
-        CustomLog ${APACHE_LOG_DIR}/​opensource.glasg0w.social-access.log combined+        CustomLog ${APACHE_LOG_DIR}/​opensource.glasgow.social-access.log combined
  
 </​VirtualHost>​ </​VirtualHost>​
 +</​code>​
 +
 +It can then be enabled with:
 +
 +<code bash>
 +cd /​etc/​apache2/​sites-available/​
 +sudo a2ensite glasgow.opensource.social
 +</​code>​
 +
 +Now we can use certbot to generate Let's Encrypt certificates and get SSL working on this new domain:
 +
 +<code bash>
 +sudo apt install certbot
 +sudo certbot
 +</​code>​
 +
 +It'll ask you which domain you want to generate a certificate for.  You can add the following line to the apache config (just under ServerName) if you want to also get the www. version of the site working:
 +
 +<​code>​
 +     ​ServerAlias www.opensource.glasgow.social
 </​code>​ </​code>​
apache.1632332765.txt.gz ยท Last modified: 2021/09/22 18:46 by admin