Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 10th, 2002, 02:43 PM
jon_whitcraft's Avatar
jon_whitcraft jon_whitcraft is offline
PHP Coder
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Indianapolis, IN, USA
Posts: 367 jon_whitcraft User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 28 m 34 sec
Reputation Power: 8
Send a message via Yahoo to jon_whitcraft
access question

I want to set up apache to allow people from my inside network (192.168.x.x) to access a web site with out any problems. but i want it to also ask for a password if someone is trying to come in from the internet. is this posible???

thanks in advance..
__________________
Jon Whitcraft
Web Applications Developer :: Zend Certified Engineer
http://www.indianapolismotorspeedway.com/

Quote:
Originally said by Tyler Durden
Our fathers were our models for God. If our fathers bailed, what does that tell you about God? Listen to me. You have to consider the possibility that God does not like you. He never wanted you. In all probability, he hates you. It's not the worst thing that can happen to you. We don't need him. **** damnation, man. **** redemption. We are God's unwanted children, SO BE IT! First you have to give up. First, you have to know, not fear, that someday, you're gonna die. It's only after we've lost everything that we're free to do anything.

Reply With Quote
  #2  
Old January 10th, 2002, 03:09 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> allow people from my inside network (192.168.x.x)

When they are behind a NATd box, their IPs to Apache is always 12.34.56.78 (your Natd IP), not 192.168.x.x. Because NATd rewrite src address.
With that being said, you can allow 12.34.56.78 without access restriction.

For example:

<Directory "/www/htdocs">
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Allow from 12.34.56.78/32
AuthType Basic
AuthName "Private Area"
AuthUserFile /www/.htpasswd
Require valid-user
Satisfy any
</Directory>

NameVirtualHost 12.34.56.78
<VirtualHost 12.34.56.78>
Servername www.domain.com
DocumentRoot "/www/htdocs"
</VirtualHost>

You also can use NameVirtualHost * so Apache accepts connection from all available IPs (including 127.0.0.1 and 192.168.0.x).

You then can create a vhost for internal like so:
1) Put 192.168.0.1 internal.mydomain.com to /etc/hosts file
2) In httpd.conf:

<Directory "/www/htdocs">
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Allow from 12.34.56.78/32 192.168.0.0/24
AuthType Basic
AuthName "Private Area"
AuthUserFile /www/.htpasswd
Require valid-user
Satisfy any
</Directory>

NameVirtualHost *
<VirtualHost *>
ServerName www.domain.com
ServerAlias internal.domain.com
DocumentRoot "/www/htdocs"
</VirtualHost>

And of course, from internal, go to http://internal.domain.com instead.

Reply With Quote
  #3  
Old January 11th, 2002, 07:54 AM
jon_whitcraft's Avatar
jon_whitcraft jon_whitcraft is offline
PHP Coder
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2001
Location: Indianapolis, IN, USA
Posts: 367 jon_whitcraft User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 28 m 34 sec
Reputation Power: 8
Send a message via Yahoo to jon_whitcraft
I got this all set up in the httpd.conf file and it works fine with comuters on a 172 network in our building. but when i try it from out side it does not work. it just brings up the page like it were if we were inside the building. could the problem be that we are gonig though a pix firewall when we come into the building. Please advise

thanks in advance.

Reply With Quote
  #4  
Old January 11th, 2002, 02:08 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> it works fine with comuters on a 172 network in our building

How can you tell? Can you ping internal.domain.com? Which one did you try? Keep in mind that you need to sync the hosts file on all machines.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > access question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway