表題の件について。先日のエントリの続きみたいな感じ。
■ 環境
- httpd 2.4.23
- Docker for Mac 1.12.3
- Mac OSX El Capitan
■ ServerSignature
core – Apache HTTP サーバ バージョン 2.4
http://httpd.apache.org/docs/2.4/mod/core.html#serversignature
これが消せるのはどこになるのか、を確認する。
デフォルトは”off“のようである。
$ curl -s --dump-header - localhost:8000/test
HTTP/1.1 404 Not Found
Date: Thu, 24 Nov 2016 13:58:16 GMT
Server: Apache
Content-Length: 263
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 /test was not found on this server.</p>
$
続いて設定ファイルを変更する。
ServerSignature on
この設定ファイルにて下記のようにコンテナを起動する。
$ docker run -ti --rm --name httpd -p 8000:80 -v `pwd`/httpd.conf:/usr/local/apache2/conf/httpd.conf httpd
アクセスする。
$ curl -s --dump-header - localhost:8000/test
HTTP/1.1 404 Not Found
Date: Thu, 24 Nov 2016 13:58:16 GMT
Server: Apache
Content-Length: 263
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 /test was not found on this server.</p>
<hr>
<address>Apache Server at localhost Port 8000</address>
</body></html>
$
下部に情報が表示された。
以上。