今度はaccess.confを設定する。access.confはサーバ全体のアクセス制御に関して記述したファイルである。なお、この設定のいくつかは後で変更も可能である(5.cgiについて、6.アクセス制限参照)。
# <Directory /var/www> <Directory /home/kouhou> # This may also be "None", "All", or any combination of "Indexes", # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews". # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you (or at least, not yet). Options Indexes FollowSymLinks # This controls which options the .htaccess files in directories can # override. Can also be "All", or any combination of "Options", "FileInfo", # "AuthConfig", and "Limit" AllowOverride None # Controls who can get stuff from this server. order allow,deny allow from all </Directory>
# <Directory /usr/lib/cgi-bin> <Directory /home/cgi-bin> AllowOverride AuthConfig Limit Option ExecCGI FollowSymLinks IncludesNoExec </Directory>
# <Location /server-status> # SetHandler server-status # order deny,allow # deny from all # allow from .your_domain.com # </Location>
# <Location /server-info> # SetHandler server-info # order deny,allow # deny from all # allow from .your_domain.com # </Location>
# <Location /cgi-bin/phf*> # deny from all # ErrorDocument 403 http://phf.apache.org/phf_abuse_log.cgi # </Location>
<Directory /usr/doc> Options Indexes FollowSymLinks AllowOverride None order allow,deny allow from all </Directory>
# <location /throttle-info> # SetHandler throttle-info # </location>
<DirectoryMatch ^/home/.*/public_html> Options SymLinksIfOwnerMatch Indexes AllowOverride None </DirectoryMatch>
<Directory /home/*/public_html> Options SymLinksIfOwnerMatch Indexes AllowOverride FileInfo Indexes Limit </Directory>
オプションは有効にするサーバのオプションを指定。
All:MultiViewを除くすべて。 ExecCGI:CGIプログラムの実行許可。 FollowSymLink:シンボリックリンクに従う。 Includes:SSIの許可。 IncludesNoExec:SSIは許可、CGIの#execと#includeは禁止。 Indexes:ディレクトリアクセスのリクエスト時、 そのディレクトリに index.htmlなどのディレクトリインデックスファイルが存在しない場合、 ディレクトリファイルリストの自動作成を許可。 MultiViews:マルチビューのサーチを許可(例えば、.../Fileのリクエスト時に このファイルが存在しない場合、サーバは.../File.*をサーチ)。 None:すべて禁止。
AllowOverrideは、ディレクトリ別のアクセス制御をaccess.confのデフォルト設定にオーバライドさせる。
All:すべて許可。 AuthConfig:ユーザ認証に関するDirectiveの使用許可。 FileInfo:ドキュメントタイプを制御するDirective(AddEncoding、 AddLanguage、AddTypeなど)の使用を許可。 Indexes:ディレクトリインデックスを制御するDirective(AddDescription、 AddIcon、AddIconByEncodingなど)の使用許可。 Limit:ホストアクセスの制御に関するDirective(allow、deny、order) の使用許可。 None:すべて禁止。 Options:Options(XBitHack)のDirectiveが使用可。このページのトップへ