3

I am very new to this area, so please bear with me. :)

Right now I am running an Apache HTTP server on my setup, a very basic configuration. The website hosted on it is accessible from anywhere, and I want to limit the access to a specific IP address range.

I've looked into this and I found that one Apache module called mod_authz_host handles this.

http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html

The problem is, I haven't managed to find documentation that explains well how to actually do the stuff. How do I actually make sure only a certain range of IP addresses can access my site/server?

The machine is running Ubuntu Server 10.10, the web files are stored in /var/www/, the apache2 daemon has its stuff stored in /etc/apache2/ and /usr/lib/apache2/modules/*. Thanks in advance, and sorry if this is a stupid question!

1 Answer 1

4

You just need to customise the following part in your apache2 config file: /etc/apache2/sites-enabled/000-default (if you are using the default configuration).

<Directory /var/www/>
   Options Indexes FollowSymLinks MultiViews
   AllowOverride None
   Order allow,deny
   allow from 192.168.0.0/24
</Directory>

For example, this will allow only the subnet 192.168.0.0/24 to access your web server.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .