LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-08-2015, 05:44 AM   #1
Hopsahejsa
LQ Newbie
 
Registered: Aug 2014
Distribution: CentOS 7
Posts: 21

Rep: Reputation: 0
Apache 2.4 Require local not working


Hi,

I am using:

<RequireAll>
Require local
Require host tester.example.com
</RequireAll>

The tester is allowed to connect but localhost not.
Btw: is there any order I should honor?

Let say I put:

Require ip 192.168.1
Require all denied
Require ip 192.168.2

Will both networks 1 and 2 work?

Thanks...
 
Old 05-08-2015, 02:13 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
if you are using
Quote:
Require host tester.example.com
you have a problem

that needs to be replaced with the real address
 
1 members found this post helpful.
Old 05-09-2015, 02:11 AM   #3
Hopsahejsa
LQ Newbie
 
Registered: Aug 2014
Distribution: CentOS 7
Posts: 21

Original Poster
Rep: Reputation: 0
Hi John,
thanks for your reply.

If I use:

Code:
<RequireAll>
Require local
Require ip 192.168.1.15
</RequireAll>
It is still the same. Only if I comment out #Require ip 192.168.1.15 it is working locally.

Does order play any role here in <RequireAll> stanza? But Require local is first anyway.
Why should not Require host work?
 
Old 05-09-2015, 07:44 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
I think it is working... until overridden by the require ip.
From http://httpd.apache.org/docs/current...thz_core.html:
Code:
When multiple Require directives are used in a single configuration section and
are not contained in another authorization directive like <RequireAll>, they are
implicitly contained within a <RequireAny> directive. Thus the first one to
authorize a user authorizes the entire request, and subsequent Require directives
are ignored.
I think you want to replace the <RequireAll> with <RequireAny>.
 
2 members found this post helpful.
Old 05-09-2015, 10:02 AM   #5
Hopsahejsa
LQ Newbie
 
Registered: Aug 2014
Distribution: CentOS 7
Posts: 21

Original Poster
Rep: Reputation: 0
Thanks jpollard. You pointed me into the right direction.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does Apache require the same thing twice? resetreset Linux - Networking 1 04-02-2012 12:09 PM
Apache: Require password for certain IPs? Spetnik Linux - Server 3 02-20-2010 04:56 PM
Apache Auth: Using Require User and Require Group newmanium2001 Linux - Software 1 08-25-2009 02:39 PM
apache active directory require group.. zerocool22 Linux - Server 0 05-06-2008 03:38 AM
Apache require authentication according to client's ip Radicalm16 Linux - Server 2 01-19-2007 08:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration