西数超哥博客
运维经验教程分享的博客

一段完整的apache配置代码+apache配置ssl证书代码

一段完整的apache配置代码+apache配置ssl证书代码(强制http跳转到https)

  1. <VirtualHost *:80>
  2. DocumentRoot /www/web/lib_tag/public_html
  3. ServerName lib.tag
  4. ServerAlias www.lib.gg lib.gg
  5. RewriteEngine On
  6. RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R,L]
  7. ErrorDocument 400 /errpage/400.html
  8. ErrorDocument 403 /errpage/403.html
  9. ErrorDocument 404 /errpage/404.html
  10. ErrorDocument 503 /errpage/503.html
  11. CustomLog “logs/lib.tag_access_log” common
  12. </VirtualHost>
  13. <VirtualHost *:443>
  14. SSLEngine on
  15. SSLCertificateFile conf/cert/lib.tag.crt
  16. SSLCertificateKeyFile conf/cert/lib.tag.key
  17. SSLCertificateChainFile conf/cert/bundle_lib.tag.crt
  18. SSLProtocol TLSv1 TLSv1.1 TLSv1.2
  19. SSLCipherSuite EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5
  20. DocumentRoot /www/web/lib_tag/public_html
  21. ServerName lib.tag
  22. ServerAlias www.lib.gg lib.gg
  23. ErrorDocument 400 /errpage/400.html
  24. ErrorDocument 403 /errpage/403.html
  25. ErrorDocument 404 /errpage/404.html
  26. ErrorDocument 503 /errpage/503.html
  27. CustomLog “logs/lib.tag_access_log” common
  28. </VirtualHost>
  29. <Directory /www/web/lib_tag>
  30. Options FollowSymLinks
  31. AllowOverride All
  32. Require all granted
  33. </Directory>
赞(0) 打赏
声明:本站发布的内容(图片、视频和文字)以原创、转载和分享网络内容为主,若涉及侵权请及时告知,将会在第一时间删除。本站原创内容未经允许不得转载:西数超哥 » 一段完整的apache配置代码+apache配置ssl证书代码

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏