Apacheのバージョンを隠す
下記のコマンドを打っていただきたい。
# telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
a
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
<hr>
<address>Apache/2.1.0 (Linux/SUSE) Server at linux.site Port 80</address>
</body></html>
Connection closed by foreign host.
どうでしょうか?予想に反してApacheのバージョンやOSが表示されていないでしょうか?
このような情報を第三者から見られる状態にしておくことはあまり良いことではありません。
クラッカーなどが脆弱性のあるバージョンの Apache を調べるのに使うこともあるからです。
表示をさせないようにするには下記ファイルを書き換えてください。
#vi /etc/sysconfig/apahe2
210行目あたり
APACHE_SERVERSIGNATURE="off" offに設定
271行目あたり
APACHE_SERVERTOKENS="ProductOnly" ProductOnly"に設定
そしてApacheの再起動
# /etc/init.d/apache2 restart
Syntax OK
Shutting down httpd2 (waiting for all children to terminate) done
Starting httpd2 (prefork) done
もう一度下記のコマンドを打ってみる。
# telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
a
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /
on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
Connection closed by foreign host.
ApacheのバージョンやOSが表示されていなかったらOKです。
Copyright © openSUSEでHomeServer All Rights Reserved.