Apache 2.2 to 2.4 Change in access control

AussieDave

24 years & still going!
Joined
Nov 28, 2013
Messages
4,991
Reaction score
3,532
These days instead of developing a site locally using xampp on my PC, I instead setup the domain, point it to my server, and deny access from everyone, other than my static ip. I also use this method when sites are live, to keep everyone out (other than myself) from certain directories. EG - wp-admin.

However, just discovered that with the update to Apache 2.4, the old method:

order deny,allow
deny from all
allow from xxx.xxx.xxx.xxx

Has been updated to a new syntax, and the aforementioned is not working anymore. Hence, some of my security sheilds are down.

The Apache help pages have examples, but can't seem to get my head around converting the above (old) syntax to the new, and require Apache 2.4 syntax.

Does anyone know how the above should be formated for Apache 2.4?

Thanks :)
 
Last edited:

AussieDave

24 years & still going!
Joined
Nov 28, 2013
Messages
4,991
Reaction score
3,532
After literally d#cking around ALL day, the solution is as follows:

Old Apache Syntax:
order deny,allow
deny from all
allow from xxx.xxx.xxx.xxx

New (onwards)Apache 2.4 Syntax:
Require ip xxx.xxx.xxx.xxx

https://httpd.apache.org/docs/2.4/upgrading.html

Maybe this will help someone caught up with this, and save you a cr#p load of wasted time :)
 

jopaa

Affiliate Guard Dog Member
Joined
Jun 3, 2011
Messages
681
Reaction score
198
Thanks for letting us know.

"Require ip" will replace "allow from" but I still don't understand how to deny an IP range. Do you have any clue?

Thanks
 
Top