enable_strict_transport_security_apache_virtual_host
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
enable_strict_transport_security_apache_virtual_host [2023/06/24 16:59] – created wikiadmin | enable_strict_transport_security_apache_virtual_host [2023/06/24 17:14] (current) – wikiadmin | ||
---|---|---|---|
Line 18: | Line 18: | ||
This example configuration will make all subdomains only accessible via HTTPS. If you have subdomains not accessible via HTTPS, remove includeSubDomains. | This example configuration will make all subdomains only accessible via HTTPS. If you have subdomains not accessible via HTTPS, remove includeSubDomains. | ||
- | IMPORTANT: | + | **IMPORTANT: |
+ | |||
+ | ===== Here’s how to enable mod_headers in Apache Ubuntu / Debian ===== | ||
+ | |||
+ | 1. Install mod_headers | ||
+ | If you want to install Apache module such as mod_headers, | ||
+ | |||
+ | < | ||
+ | $ sudo a2enmod < | ||
+ | < | ||
+ | |||
+ | Open terminal and run the following command. | ||
+ | |||
+ | < | ||
+ | $ sudo a2enmod headers | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | $ sudo a2enmod headers | ||
+ | </ | ||
+ | |||
+ | Result: | ||
+ | |||
+ | < | ||
+ | Enabling module headers. | ||
+ | To activate the new configuration, | ||
+ | systemctl restart apache2 | ||
+ | $ | ||
+ | </ | ||
+ | |||
+ | 2. Restart Apache web server for changes to take effect | ||
+ | |||
+ | < | ||
+ | $ sudo systemctl restart apache2 | ||
+ | </ | ||
+ | |||
+ | OR | ||
+ | |||
+ | < | ||
+ | $ sudo service apache2 restart | ||
+ | </ | ||
+ | |||
+ | 3. Check if mod_headers is working. | ||
+ | |||
+ | < | ||
+ | $ apachectl -M | headers | ||
+ | </ | ||
+ | |||
+ | OR | ||
+ | |||
+ | < | ||
+ | $ apache2ctl -M | grep headers | ||
+ | </ | ||
+ | |||
+ | If you see the following output, it means mod_headers is enabled and working. | ||
+ | |||
+ | < | ||
+ | $ headers_module (shared) | ||
+ | </ | ||
+ | |||
+ | 4. Disable mod_headers. | ||
+ | If you want to disable/ | ||
+ | |||
+ | < | ||
+ | $ sudo a2dismod < | ||
+ | </ | ||
+ | |||
+ | To disable/ | ||
+ | |||
+ | < | ||
+ | $ sudo a2dismod headers | ||
+ | </ | ||
+ | |||
+ | Restart Apache web server to apply changes. | ||
- | Let's see how to enable headers module using a2modenable |
enable_strict_transport_security_apache_virtual_host.1687625951.txt.gz · Last modified: 2023/06/24 16:59 by wikiadmin