-
Notifications
You must be signed in to change notification settings - Fork 0
/
apacheconfigs
49 lines (35 loc) · 1.29 KB
/
apacheconfigs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#Making webpage visible when apache blocks urls
<Directory /var/www/>
Order Allow,Deny
Allow from all
AllowOverride all
Header set Access-Control-Allow-Origin "*"
</Directory>
#Certbot
-- sudo apt-get install certbot python-certbot-apache
-- sudo add-apt-repository ppa:certbot/certbot
-- sudo apt install python-certbot-apache
-- sudo certbot --apache -d example.com
OR
-- sudo certbot --apache -d example.com -d www.example.com
#Set Cronjob
-- crontab -l
-- * */12 * * * certbot renew
#Edit /etc/apache2/sites-available/000-default-le-ssl.conf
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# Below are added by Certbot doing the Renewal phase
ServerName tutorials.angani.co
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/tutorials.angani.co/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/tutorials.angani.co/privkey.pem
</VirtualHost>
*** IMPORTANT ***
-- Ensure that the DocumentRoot is /var/www/html OTHERWISE it will claim it cannot find the document
-- systemctl restart apache2
#CERTBOT FOR NGINX
-- sudo apt-get install certbot python-certbot-nginx
-- sudo certbot --nginx