Apacheの情報を隠す
外部から Apache の情報を知られるのを防ぐ。
httpd-default.conf を有効にする。(コメントアウトを外す)
# cd /usr/local/etc/apache22/ # vi httpd.conf #Include etc/apache22/extra/httpd-default.conf ↓ Include etc/apache22/extra/httpd-default.conf
httpd-default.conf を書き換える。
# cd /usr/local/etc/apache22/extra/ # vi httpd-default.conf ServerTokens Full ↓ ServerTokens Prod ←変更(サーバーの情報を隠す) ServerSignature On ↓ ServerSignature Off ←変更(Apacheのバージョン情報を隠す)# /usr/local/etc/rc.d/apache22 restart# /usr/local/etc/rc.d/apache22 reload
TRACE メソッドを無効にする
Apache のセキュリティを向上させるため TRACE メソッドを無効にする。
設定前
# telnet localhost 80 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. TRACE / HTTP/1.0 ←TRACE コマンド HTTP/1.1 200 OK ←受付OK Date: Sun, 01 Jan 20xx HH:MM:SS GMT Server: Apache Connection: close Content-Type: message/http TRACE / HTTP/1.0 Connection closed by foreign host.
設定追加
# cd /usr/local/etc/apache22/Includes/ # vi httpd-secure.conf TraceEnable Off# /usr/local/etc/rc.d/apache22 restart# /usr/local/etc/rc.d/apache22 reload