On Apache2, I have a VirtualHost with a number of <Directory>
directives/sections containing multiple access control statements
i.e.
<Directory /foo>
Order Deny,Allow
Deny from all
Allow from ...
Allow from ...
...
</Directory>
...
Is there a way to specify the access control at a higher level (above <Directory>
)? Or should I be using macros?
Thanks in advance!
If I understand your question, you're looking for a way to apply a set of allow/deny restrictions to a set of directories that may not share a common parent.
You can place all your allow/deny directives into a separate file (call it, say,
/etc/httpd/conf.d/accesslist
, or whatever makes sense in your distribution), and then using theInclude
directory to include those rules where appropriate:But if your directories all share a common configuration, you can use something like
mod_macro
to create a reusable template with variable substitution.