Click to See Complete Forum and Search --> : Restricting Website Access to Local Network


grimlock
10-05-2002, 10:34 AM
I am setting up a portal with support information for our school using Geeklog on RedHat 8.0 using Apache. I don't want the outside world to have access to the site, only the local network/domain (public class C). Can I specify an IP range to allow? Or do I need to do something else.

If so how exactly?

Thanks,

I'm turning into a linux junkie...

bdl
10-05-2002, 11:52 AM
You can do this in any of several ways..you may want to use all the access control methods shown just for the sake of extra security.

Disallow the web server from having access to the outside world, put it on a private class 'C' address, for example.
Use a hardware firewall or IPTABLES firewall script to block all access to port 80 / 8080 or any other ports you may be serving web services to. For the latter I'd recommend gShield (http://muse.linuxmafia.org/gshield.html).
Use access methods in Apache (probably the easiest and most versatile method of blocking access) with the 'Limit' option. An example is shown below. You can limit service to only the IP's you specify.


Using AllowOverride, Limit, Order and the two keywords Deny and Allow you can deny access to all but a specific list of addresses you choose.

<Directory />
AllowOverride Limit
Order Deny, Allow
Deny from all
Allow from 192.168.1.0/255.255.255.0
</Directory>

Now, the above is simply an example of what can be done to block out all traffic from everyone except those clients on the local private network. Please read over the Apache documentation and I'm sure you'll see how easy it is to use this method.

Links:
Apache Doc - AllowOverride (http://httpd.apache.org/docs/mod/core.html#allowoverride)
Apache Doc - Deny Syntax (http://httpd.apache.org/docs/mod/mod_access.html#deny)
Apache Doc - Allow Syntax (http://httpd.apache.org/docs/mod/mod_access.html#allow)