CentOS5でApacheの初期403エラーページを無効にする方法

CentOS5でApacheyumインストールした場合、
デフォルト設定の403エラー画面が、下記の画像のように
Apache 2 Test Page powered by CentOS」となっている。

これが非常に目障りなので、消す(無効にする)方法をメモ。


まず、「ErrorDocument 403」として設定されていると思い
httpd.conf」を調べて見たけど、そのような記述が一切無い。


そこでgrep検索を掛けてみたところ
「/error/noindex.html」というファイルが上記のページみたいなので
このファイル名を指定しているファイルを検索してみた。


すると、「/etc/httpd/conf.d/welcome.conf」がそれにあたるようだ。


ファイルを削除するのは気が引けたので、
このファイルの記述を全てコメントアウトにしておいた。

※ちなみに上記の該当箇所は
「ErrorDocument 403 /error/noindex.html」になる。

vi /etc/httpd/conf.d/welcome.conf

	#
	# This configuration file enables the default "Welcome"
	# page if there is no default index page present for
	# the root URL.  To disable the Welcome page, comment
	# out all the lines below.
	#
	#
	#    Options -Indexes
	#    ErrorDocument 403 /error/noindex.html
	#


これで、Apacheを再起動すれば、
「403 Forbidden」という見覚えのあるページに切り替わる。