1. yum install mod_ssl -y
  2. mkdir /etc/httpd/ssl
  1. <VirtualHost 10.10.10.19:80>
  2. DocumentRoot /var/www/html/nextcloud/
  3. ServerName fp.sppp.net
  4. Redirect permanent / https://fp.sppp.net:2013/
  5. <Directory /var/www/html/nextcloud/>
  6. Require all granted
  7. AllowOverride All
  8. Options FollowSymLinks MultiViews
  9. <IfModule mod_dav.c>
  10. Dav off
  11. </IfModule>
  12. </Directory>
  13. </VirtualHost>
  14. <VirtualHost 10.10.10.19:443>
  15. DocumentRoot /var/www/html/nextcloud/
  16. ServerName fp.sppp.net
  17. SSLEngine on
  18. ProtocolsHonorOrder On
  19. Protocols h2 h2c http/1.1
  20. SSLCertificateFile /etc/httpd/ssl/4294403_fp.sppp.net_public.crt
  21. SSLCertificateKeyFile /etc/httpd/ssl/4294403_fp.sppp.net.key
  22. SSLCertificateChainFile /etc/httpd/ssl/4294403_fp.sppp.net_chain.crt
  23. <Directory /var/www/html/nextcloud/>
  24. Require all granted
  25. AllowOverride All
  26. Options FollowSymLinks MultiViews
  27. <IfModule mod_dav.c>
  28. Dav off
  29. </IfModule>
  30. <IfModule mod_headers.c>
  31. Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
  32. Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"
  33. </IfModule>
  34. </Directory>
  35. </VirtualHost>

隐藏apache版本号

编辑httpd.conf,末尾添加以下两行:

  1. ServerTokens Prod
  2. ServerSignature off

隐藏php版本号

  1. 搜索“php.ini”(find / -name php.ini
  2. 编辑php.ini 找到expose_php = On这行
  3. expose_php = On改为expose_php = Off

    更安全的conf