I'm trying to satisfy the following requirements (in Apache HTTPD 2.2):
- If the HTTP method is anything but HEAD, POST, or GET do not allow access, regardless of any of the following.
- If the user is internal, allow access without the basic authentication challenge.
- If the user is external, challenge with basic authentication, and allow in if they have good credentials.
This is one of the many things I've tried, but none of the things I've tried achieved all three of the requirements:
<Directory /path/to/wwwroot>
Options FollowSymLinks
AllowOverride FileInfo
# Basic Authentication
AuthType Basic
AuthName "Enter your site username and password."
AuthUserFile /path/to/stage.passwords
AuthGroupFile /path/to/stage.groups
Require group stageusers
# there's more logic for this variable in the real virtual_host.
# for this simplified example, manually set (using the following)
# or unset (using !internal_user).
SetEnv internal_user
Order deny,allow
Deny from all
Allow from env=internal_user
<LimitExcept HEAD POST GET>
Deny from all
</LimitExcept>
Satisfy all
</Directory>
I've read the docs on Satisfy, Limit, LimitExcept, Order, and basic authentication, but I'm having trouble putting the pieces together.
What's a viable way to do this?