Convert rules from 2.2 to 2.4

Started by mario, July 09, 2011, 02:24:53 PM

Previous topic - Next topic

mario

I try migrate my config rules to the new 2.4 config.

Before it was


Order Allow,Deny
Allow from all
Deny from 212.100.100.100


The one I tried is

Require all granted
Require not ip 212.100.100.100


but than I get this warning
Quote
../../bin/httpd -S
Syntax error on line 9 of /opt/apache2/conf/vhosts/main.conf:
negative Require directive has no effect in <RequireAny> directive
httpd (pid 5319) already running

??? How do I make this work?

Gregg

This is the one thing I do not like as it currently stands, you can not use "not" everywhere, especially in with Require ip, I banged my head for some time trying to figure it out myself.

<RequireNone>
Require ip 212.100.100.100
</RequireNone>

I think that is what I did get working properly

see http://httpd.apache.org/docs/trunk/mod/mod_authz_core.html#require from Require and the next few below it, RequireAll/Any/None

mario

Thanks for the hint. That didn't work for me some kinda, but with some trial this works for me.


<RequireAll>
Require all granted
Require not ip 212.100.100.100
</RequireAll>


This is nearly the same as with the Allow / Deny stuff.