Apache2.4では2.2で使っていたOrder allow,deny
などの記述が変更され、新しい書き方になったみたいです。ということで、その書き方を調べてみました。
アクセス制限の書き方
mod_authz_coreを使ったアクセス制限の書き方
全てのアクセスを許可する
<Directory "/admin">
Require all granted
</Directory>
従来の書き方
<Directory "/admin">
Order allow,deny
Allow from all
</Directory>
全てのアクセスを拒否する
<Directory "/admin">
Require all denied
</Directory>
従来の書き方
<Directory "/admin">
Order allow,deny
Deny from all
</Directory>
特定のIPのみアクセスを許可する
<Directory "/admin">
Require ip 123.456.789.012
</Directory>
従来の書き方
<Directory "/admin">
Order deny,allow
Deny from all
Allow from 123.456.789.012
</Directory>
特定の環境変数がある場合のみアクセスを許可する
<Directory "/admin">
Require env value
</Directory>
従来の書き方
<Directory "/admin">
Order deny,allow
Deny from all
Allow from env=value
</Directory>
リンク
mod_authz_core – Apache HTTP Server Version 2.4
http://httpd.apache.org/docs/current/mod/mod_authz_core.html
Upgrading to 2.4 from 2.2 – Apache HTTP Server Version 2.4
http://httpd.apache.org/docs/2.4/upgrading.html