以下是利用Apache配置增强网站安全性的关键措施:
ServerTokens Prod 和 ServerSignature Off,隐藏Apache版本及操作系统信息。Require 指令限制IP访问,禁止非必要IP段。Options -Indexes。FilesMatch 拒绝访问 .htaccess 等文件。mod_ssl),配置HTTPS并强制跳转HTTP到HTTPS。mod_security 防护SQL注入、XSS等攻击。mod_evasive 防御DDoS攻击。LimitRequestBody。PUT、DELETE 等非必要方法。参考来源: