聲明:安全無絕對,以下建議可顯著降低風險,請依環境評估效能影響,自行承擔風險。
ServerSignature OffServerTokens ProdServer: Apache,不洩露版本、OS、模組清單。User apacheGroup apachenobody 導致橫向攻擊。<Directory />Order Deny,AllowDeny from allOptions NoneAllowOverride None</Directory><Directory /web>Order Allow,DenyAllow from all</Directory>Options -IndexesOptions -IncludesOptions -ExecCGI(若不使用 CGI)Options -FollowSymLinksOptions None 或 Options -ExecCGI -FollowSymLinks -IndexesAllowOverride None.httpdoverride)並封鎖所有 .ht* 檔案下載:AccessFileName .httpdoverride<Files ~ "^\.ht">Order allow,denyDeny from allSatisfy All</Files>httpd.conf,在 LoadModule 行前加 # 註解。常見可停用:mod_imap, mod_include, mod_info, mod_userdir, mod_status, mod_cgi, mod_autoindexgrep LoadModule httpd.conf