LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 06-26-2009, 08:00 AM   #1
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Rep: Reputation: 35
Question Help with Apache: free access from lan users and password access to wan users... how?


Hi...


Im trying to config my intranet to be accessible from inside the network (lan) without need of password and ask for a passwd for those who are viewing from Wan ....

Today my intranet can only be accessed from Lan, external access give me an Unauthorized message, I took look around, try #irc and still can get the appropriated help, I hope that someone here could help me on that...


A piece of my config:
Code:
<VirtualHost *:80>
        ServerName intranet.somehostname.com
        ServerAlias intranet2.somehostname.com

        DocumentRoot /var/www/intranet
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/intranet>
                Options Indexes FollowSymLinks MultiViews
                Order deny,allow
                deny from all
                allow from 127.0.0.0/255.0.0.0 192.168.1.0/255.255.255.0 192.168.0.0/255.255.255.0 ::1/128 200.x.x.x 200.x.x.x 200.x.x.x 200.x.x.x
                AllowOverride AuthConfig
                AuthName "Restrict Access"
                AuthType Basic
                Satisfy any
                AuthUserFile /etc/apache2/auth/httppw.db
                require valid-user
        </Directory>

best regards []s
 
Old 06-26-2009, 08:27 AM   #2
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
I did not found anything to get this in one config, but why not just split it up.

Make two virutalhosts. One with a ServerName directive of "intranet.yourside.com". Which allows access from internal
Allow from 192.168.1.0
The other virtualhost would have a ServerName directive with "external.yourside.com" and would need an authentication

The name of the directory just happens to be the same...
 
Old 06-26-2009, 11:31 AM   #3
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Original Poster
Rep: Reputation: 35
well, I have many reason to want this... my network users are made of all kind of person, most aren't so skilled others just don't ask, or doesn't understand why the address "intranet.myhost.com" doesn't load at their home... and endeed most sites used by us permit external access to their intranet with the use of a password and want to bring this functionality to our intranet.

believe in the kind of confusion to the users to understand the difference between intranet e internet and things like that ... =)


[ ]'s
 
Old 06-29-2009, 02:42 AM   #4
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by maginotjr
believe in the kind of confusion to the users to understand the difference between intranet e internet and things like that ... =)
AMEN ;=) I can realy see to that.

Okay next one. Maybe a rewrite rule could help out.
You still would need to go with the split up configuration. Just have the address the 192.168.0.0/24 people be rewriten to intranet.yousite.tld.

Another option might be to use the proxy module. Or use some enviromental variable with SetEnv if REMOTE_ADDRS=192.168.*.*

I just think you can't get this configuration in one go. But who knows. I see if the apache pages might give some more hints.
 
Old 01-01-2011, 11:08 AM   #5
Enderek
LQ Newbie
 
Registered: Mar 2008
Posts: 2

Rep: Reputation: 0
This thread was first Google result for my query searching this, so I hope saying the solution won't hurt.

Use "Satisfy Any" - that means that only one condition needs to be met, either "Allow from (IP)" or "Require ...user/group...".
 
  


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
users can access root withouh being asked for a password amer_58 Linux - Newbie 4 08-20-2005 11:56 PM
Anonymous only from LAN, Users only from WAN ! on Proftpd RINO2004 Linux - Networking 3 06-30-2004 09:05 AM
Restricting internal LAN users access otisthegbs Linux - Security 15 05-17-2004 12:38 PM
I need my LAN users to access the internet using automatic configuratin script on RH9 akohamen Linux - Networking 1 04-20-2004 03:09 PM
Public users need file access via Apache dufferin Linux - Networking 1 02-22-2004 01:01 AM

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

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