Forum Moderators: phranque
Deny from all
I find no relevant AllowOverride directive in apache2.conf nor its includes. ?
Thanks.
Jim
.htaccess now reads:
RewriteEngine On
RewriteRule . - [F]
Deny from all
I'm trying to use localhost subdomains, and the relevant <Directory> container now holds:
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride All Limit
Order allow,deny
allow from all
I haven't observed any changes yet; I hope it's not because I'm forgetting to mention an Achilles' heel.
If a higher-up .htaccess has this in it:
order deny,allow
allow from all
then your
Deny from all
farther down the directory tree will have no effect because the server is processing the deny lines first, then the allow lines, and "allow from all" overrides your "deny from all".
In the subdirectory you want to deny, try using this:
order allow,deny
deny from all
SteveWh: I'm a bit confused by the directives you gave at your message's end. I put "order deny,allow" in both the <Directory> tag and the .htaccess file... Still no change, and I'm restarting Apache after each modification in case that's necessary.
Thanks.
<Directory></Directory> blocks cannot go in .htaccess.
Note that the two lines I suggested were:
order allow,deny (not order deny,allow)
deny from all
The order is critically important. If you use "order deny,allow" and there is an "allow from all" anywhere that has equal precedence, none of your deny lines will ever work because "allow from all" is processed last and allows everybody.
If still doesn't work, it would seem you must have conflicting commands in a more specific section of your config files (such as <Directory></Directory> <Files></Files> etc.) that are overriding.
If you have a complicated set of directives that might be interfering with each other, this page should help sort them out: [httpd.apache.org...]
-----
When you revise httpd.conf, you need to restart the server.
When you revise .htaccess files, you don't need to restart the server.
[edited by: SteveWh at 9:52 pm (utc) on June 3, 2009]
Aha, I read the documentation for the 'order' directive earlier to get clarification, and I interpreted it as the opposite of the intended meaning. But switching them back as you had them (and as the sites-enabled file was) had no effect.
If I have conflicting directives, I can only conclude that they're in here:
# Include generic snippets of statements
Include /etc/apache2/conf.d/
ServerTokens Full
ServerSignature On
TraceEnable On
[edited by: Jesdisciple at 4:50 am (utc) on June 4, 2009]
Thanks, all!