Advertisement
Justman10000

Apache2 - Config

May 6th, 2022
17
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <VirtualHost *:80>
  2. ServerName <your_domain>
  3.  
  4. ErrorLog ${APACHE_LOG_DIR}/error.log
  5. CustomLog ${APACHE_LOG_DIR}/access.log combined
  6.  
  7. RewriteEngine on
  8. RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
  9. </VirtualHost>
  10.  
  11. <VirtualHost *:443>
  12. ServerName <your_domain>
  13. DocumentRoot /var/www/html
  14.  
  15. SSLEngine On
  16. SSLCertificateFile /etc/letsencrypt/live/<your_domain>/cert.pem
  17. SSLCertificateKeyFile /etc/letsencrypt/live/<your_domain>/privkey.pem
  18. SSLCertificateChainFile /etc/letsencrypt/live/<your_domain>/fullchain.pem
  19.  
  20. ErrorLog ${APACHE_LOG_DIR}/error.log
  21. CustomLog ${APACHE_LOG_DIR}/access.log combined
  22.  
  23. <Directory /var/www/html>
  24. AllowOverride All
  25. Require all granted
  26. </Directory
  27. </VirtualHost>
Advertisement
RAW Paste Data Copied
Advertisement