Install Config Wiki

All about installing, configuring and troubleshooting

User Tools

Site Tools


enable_strict_transport_security_apache_virtual_host

Differences

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

Link to this comparison view

Next revision
Previous revision
enable_strict_transport_security_apache_virtual_host [2023/06/24 16:59] – created wikiadminenable_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.  Consider how this would affect integration with OnlyOffice Document Server hosted on a subdomain of the NextCloud domain, unless the subdomain is added to or included in the LetsEncrypt SSL certificate. This example configuration will make all subdomains only accessible via HTTPS. If you have subdomains not accessible via HTTPS, remove includeSubDomains.  Consider how this would affect integration with OnlyOffice Document Server hosted on a subdomain of the NextCloud domain, unless the subdomain is added to or included in the LetsEncrypt SSL certificate.
  
-IMPORTANT:  This requires the mod_headers extension in Apache.+**IMPORTANT:  This requires the mod_headers extension in Apache.** 
 + 
 +===== 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, you need to issue the a2enmod command 
 + 
 +<code> 
 +$ sudo a2enmod <module_name> 
 +<code> 
 + 
 +Open terminal and run the following command. 
 + 
 +<code> 
 +$ sudo a2enmod headers 
 +</code> 
 + 
 +<code> 
 +$ sudo a2enmod headers 
 +</code> 
 + 
 +Result: 
 + 
 +<code> 
 +Enabling module headers. 
 +To activate the new configuration, you need to run: 
 +  systemctl restart apache2 
 +
 +</code> 
 + 
 +2. Restart Apache web server for changes to take effect 
 + 
 +<code> 
 +$ sudo systemctl restart apache2 
 +</code> 
 + 
 +OR 
 + 
 +<code> 
 +$ sudo service apache2 restart 
 +</code> 
 + 
 +3. Check if mod_headers is working.  You can easily check if mod_headers is enabled by running the following command 
 + 
 +<code> 
 +$ apachectl -M | headers 
 +</code> 
 + 
 +OR 
 + 
 +<code> 
 +$ apache2ctl -M | grep headers 
 +</code> 
 + 
 +If you see the following output, it means mod_headers is enabled and working. 
 + 
 +<code> 
 +$ headers_module (shared) 
 +</code> 
 + 
 +4. Disable mod_headers. 
 +If you want to disable/uninstall Apache module such as mod_headers, you need to issue the a2dismod command 
 + 
 +<code> 
 +$ sudo a2dismod <module_name> 
 +</code> 
 + 
 +To disable/uninstall mod_headers run the following command. 
 + 
 +<code> 
 +$ sudo a2dismod headers 
 +</code> 
 + 
 +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