-
Notifications
You must be signed in to change notification settings - Fork 0
/
apache.txt
64 lines (32 loc) · 1.52 KB
/
apache.txt
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
sudo apt-get install apache2-ssl-dev
# /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# /etc/apache2/sites-available/default-ssl.conf
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin [email protected]
ServerName hackingyseguridad
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/ssl/certs/MyRootCA.pem
SSLCertificateKeyFile /etc/ssl/private/MyRootCA.key
SSLCertificateChainFile /etc/ssl/certs/MyRootCA.crt
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>
# Finalmente aplicamos cambios en apache2
sudo a2enmod ssl
sudo a2enmod headers
sudo a2dissite 000-default.conf
sudo a2ensite 000-default.conf
sudo systemctl restart apache2