|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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:
|
|
#2
|
|||
|
|||
|
>> 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. |
|
#3
|
||||
|
||||
|
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. |
|
#4
|
|||
|
|||
|
>> 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. |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > access question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|