The Apache Haus Forum

Advanced search  

News:

Welcome to Apache Haus Distribution Forum

Sorry Guest, you are banned from posting and sending personal messages on this forum.
Error: S4296
This ban is not set to expire.
Pages: [1]   Go Down

Author Topic: Convert rules from 2.2 to 2.4  (Read 7206 times)

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 586
Convert rules from 2.2 to 2.4
« on: July 09, 2011, 02:24:53 PM »

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

Before it was

Code: [Select]
Order Allow,Deny
Allow from all
Deny from 212.100.100.100

The one I tried is
Code: [Select]
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?
Logged

Gregg

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 849
Re: Convert rules from 2.2 to 2.4
« Reply #1 on: July 09, 2011, 09:51:01 PM »

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
Logged

mario

  • Administrator
  • Member Elite
  • *****
  • Offline Offline
  • Posts: 586
Re: Convert rules from 2.2 to 2.4
« Reply #2 on: July 09, 2011, 10:32:47 PM »

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

Code: [Select]
<RequireAll>
Require all granted
Require not ip 212.100.100.100
</RequireAll>

This is nearly the same as with the Allow / Deny stuff.
Logged
Pages: [1]   Go Up
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13