| | 39 | * '''使用例''' (サーバへのアクセスはデフォルトで禁止、/tracへのアクセスは許可。但し、GET以外は禁止) |
| | 40 | {{{ |
| | 41 | <Directory /> |
| | 42 | Options FollowSymLinks |
| | 43 | AllowOverride None |
| | 44 | Order Deny,Allow |
| | 45 | Deny from all |
| | 46 | </Directory> |
| | 47 | |
| | 48 | ScriptAlias /trac /usr/share/trac/cgi-bin/trac.fcgi |
| | 49 | <Location /trac> |
| | 50 | <LimitExcept GET> |
| | 51 | Deny from all |
| | 52 | </LimitExcept> |
| | 53 | </Location> |
| | 54 | }}} |
| | 55 | * 省略されているOrderディレクティブ(デフォルトの「Order Deny,Allow」)は、<LimitExcept>の範囲ではなく、外の<Location>以下に適用されていると考えるのが妥当 |
| | 56 | * 設定の失敗例として、以下のように設定するとGETではないPOSTメソッド等も制限されなくなり、期待する動作(GET以外のメソッドを403にする)を取らなくなる |
| | 57 | {{{ |
| | 58 | <Directory /> |
| | 59 | Options FollowSymLinks |
| | 60 | AllowOverride None |
| | 61 | Order Deny,Allow |
| | 62 | Deny from all |
| | 63 | </Directory> |
| | 64 | |
| | 65 | ScriptAlias /trac /usr/share/trac/cgi-bin/trac.fcgi |
| | 66 | <Location /trac> |
| | 67 | Allow from all |
| | 68 | <LimitExcept GET> |
| | 69 | Deny from all |
| | 70 | </LimitExcept> |
| | 71 | </Location> |
| | 72 | }}} |
| | 73 | * <Location>全体で「Deny from all => Allow from all」の順で適用され、結果として全てのメソッドが制限されなくなっていると思われる |