LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-17-2007, 09:36 PM   #1
Radicalm16
Member
 
Registered: Jan 2003
Location: Venezuela
Distribution: Debian, Ubuntu
Posts: 75

Rep: Reputation: 15
Apache require authentication according to client's ip


I've got an apache web server receiving connections from the internet and from the lan.

I've been limiting access (basic authentication) to certain folders using .htaccess files.

Now I've to ask the users comming from the internet to authenticate theirselves and let local users pass through without authentication. Can somebody tell me how can I set it using directives on .htaccess files?

Something like deciding if I require a connection to give a user : password pair based on it's ip address.

I know I could achieve this using two different virtual host directives. But, is there any other way?

Thanks.
 
Old 01-18-2007, 10:07 PM   #2
osdeals
Member
 
Registered: Jul 2006
Distribution: RHEL, CentOS, PuppyLinux, SuSe, Ubuntu, Debian
Posts: 59

Rep: Reputation: 15
I have a similar setup. Select hosts are permitted access without login / pass, while all others need to authenticate. My .htaccess file reads as:
Code:
order Allow,Deny
Allow from 127.0.0.1
Allow from 1.2.3.4
Allow from 5.6.7.8
AuthType Basic
AuthUserFile /home/user/.htpasswd
AuthGroupFile /dev/null
AuthName "Protected Site"
require valid-user
Satisfy any
 
Old 01-19-2007, 08:55 AM   #3
Radicalm16
Member
 
Registered: Jan 2003
Location: Venezuela
Distribution: Debian, Ubuntu
Posts: 75

Original Poster
Rep: Reputation: 15
Thanks.

The Satisfy Any directive did the trick.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
client's IP address in server? hegdeshashi Linux - Networking 2 01-05-2006 03:15 AM
Make sendmail require authentication tcarpent Linux - Newbie 0 07-22-2005 07:54 AM
Apache Authentication AgentRn007 Linux - Software 2 03-27-2003 06:50 PM
apache authentication plisken Linux - Software 3 02-28-2003 12:00 AM
apache authentication d-rez Linux - Security 1 05-30-2002 08:13 AM

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

All times are GMT -5. The time now is 05:24 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