# vi /usr/local/etc/apache24/httpd.conf
找到 ServerTokens 關鍵字
如果沒有的話,自己加一行

ServerTokens 有以下幾個選項,如果不願意暴露太多資訊,建議設定成 Prod

ServerTokens Full (or not specified)
Server sends (e.g.): Server: Apache/2.4.2 (Unix) PHP/4.2.2 MyMod/1.2

ServerTokens Prod[uctOnly]
Server sends (e.g.): Server: Apache

ServerTokens Major
Server sends (e.g.): Server: Apache/2

ServerTokens Minor
Server sends (e.g.): Server: Apache/2.4

ServerTokens Min[imal]
Server sends (e.g.): Server: Apache/2.4.2

ServerTokens OS
Server sends (e.g.): Server: Apache/2.4.2 (Unix)

最後重啟 apache 服務

可以用 curl -I http://server/ 測試看看是否生效

參考資訊: https://httpd.apache.org/docs/2.4/mod/core.html

undefined

arrow
arrow
    文章標籤
    apache
    全站熱搜

    helloworld 發表在 痞客邦 留言(0) 人氣()