How do I serve only internal intranet requests for a site with Apache?

Posted by purpletonic on Server Fault See other posts from Server Fault or by purpletonic
Published on 2010-05-26T10:57:20Z Indexed on 2010/05/26 11:02 UTC
Read the original article Hit count: 450

I have an externally facing web server on our domain that we use for testing multiple sites. I have a site on this server that I want only people from within our intranet to view. How do I prevent requests originating from outside the intranet from seeing this website?

I tried the following in my apache config file, but I get a 403 error.

<Directory />  
  Options FollowSymLinks  
  Order Deny,Allow
  Allow from domain.com 
  Allow from 10.0.0.0/10.255.255.255
  Deny from All
  AllowOverride None
</Directory>
<Directory /var/www/sitename/public>
  Options Indexes FollowSymLinks MultiViews
  Order Deny,Allow
  Allow from domain.com 
  Allow from 10.0.0.0/10.255.255.255
  Deny from All
  AllowOverride None
</Directory>

© Server Fault or respective owner

Related posts about apache2

Related posts about ubuntu-server