#navi(../)
* ServerTokensとServerSignatureを試す [#s96c4d5a]
http.confのServerTokensに値を設定し、ServerSignatureの値を変更することによりどのような変化になるか試してみました。~
使用したOSは、CentOS5で、Apacheのバージョンは以下の通りです。
$ /usr/sbin/httpd -v
Server version: Apache/2.2.3
Server built: Feb 22 2012 10:54:25
#contents
#htmlinsertpcsp(web-top.html,web-sp.html)
* 関連資料 [#u6c76dae]
-[[Apacheのサーバ情報の表示>Apache/サーバ情報の表示・ServerTokens]]
* ServerTokensにFullを設定しServerSignature On [#cd67cad4]
以下のように設定しブラウザで404 Not FoundになるURLにアクセスしてみました。
ServerTokens Full
ServerSignature On
#ref(sig-on.gif)
#br
ServerTokensがFullの時のサーバ情報が表示されました。
* ServerTokensにFullを設定しServerSignature Off [#o2a2d48f]
ServerTokens Full
ServerSignature Off
#ref(sig-off.gif)
#br
ServerTokensがFullですが、サーバ情報は何も表示されなくなりました。~
しかし、telnetコマンドでApacheに接続してHTTPヘッダを確認したところ、以下のようにServer:が存在していました。
$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
GET /foo HTTP/1.1
HTTP/1.1 400 Bad Request
Date: Fri, 13 Apr 2012 12:53:10 GMT
Server: Apache/2.2.3 (CentOS) DAV/2
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>
Connection closed by foreign host.
* ServerTokensにFullを設定しServerSignature EMail [#z83df778]
ServerTokens Full
ServerSignature Email
#ref(sig-email.gif)
#br
ServerTokensがFullのサーバ情報が表示され、リンクが作成されています。(&color(bule){青のアンダーライン部分};)
~
これは、ServerAdminで指定したメールアドレスでmail to:が作成されています。~
以下、telnetコマンドでhttpに接続した時の出力です。~
mail to:が追加されているのがわかります。
$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
GET /foo HTTP/1.0
HTTP/1.1 404 Not Found
Date: Fri, 13 Apr 2012 12:51:17 GMT
Server: Apache/2.2.3 (CentOS) DAV/2
Content-Length: 317
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /foo was not found on this server.</p>
<hr>
<address>Apache/2.2.3 (CentOS) DAV/2 Server at <a href="mailto:root@localhost">127.0.0.1</a> Port 80</address>
</body></html>
Connection closed by foreign host.
* 参考記事 [#g4073d40]
- httpd.apache.orgへのリンク~
http://httpd.apache.org/docs/2.1/ja/mod/core.html#serversignature
#htmlinsertpcsp(web-btm.html,web-sp.html)