この情報は、Apache 2.0.54をもとに作成しています。
Apacheのバージョン情報やOSの種類の表示の有無を設定できます。 バージョンを知ることでできることもあるので、ちょっとしたセキュリティ確保にもなります。
ServerTokens ProductOnly
http://サーバ名/index.html又はhttp://サーバ名/にアクセスした時のサーバ上のディレクトリを指定します。 私の場合、一般ユーザでホームページを管理したいため変更しています。
DocumentRootを変更した場合、Directoryディレクティブも忘れずに変更します。
# # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/home/webadmin/public_html"
http://サーバ名/等ファイルを指定しない状態でアクセスした際、Apacheがいくつかのファイルを 自動的に検索するように指定します。
複数のファイルを指定するには、ファイル名をスペースで区切って指定します。
DirectoryIndex index.html index.htm index.shtml index.cgi index.php
Directoryディレクティブにパスを指定することで、ディレクトリ単位にルールを設定することができます。
<Directory /home/webadmin/public_html/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all # This directive allows us to have apache2's default start page # in /apache2-default/, but still have / go to the right place RedirectMatch ^/$ /apache2-default/ </Directory>
リンク切れ等エラーのときに表示するページを指定することができます。
エラーコードとファイルを指定します。
ErrorDocument 500 http://foo.example.com/cgi-bin/tester ErrorDocument 404 /cgi-bin/bad_urls.pl ErrorDocument 401 /subscription_info.html ErrorDocument 403 "Sorry can't allow you access today"
スクリプトの配置先を変更することができます。
ScriptAlias /cgi-bin/ /home/webadmin/cgi-bin/
http://サーバ名/cgi-bin/foo へのリクエストに対してサーバは スクリプト /home/webadmin/cgi-bin/foo を実行します。
Copyright 1997-2010 BBB All rights reserved.