Protecting directories and files with Apache

If you have Apache directories that you want only certain IP to be able to access.  Say you have a management interface that you only want employees to have access to.

Once you have properly put the fowling code into
/etc/apache2/sites-available/default

and you are not comming from one of the allowed IP you will be greated with a page that says.

Forbidden

You don’t have permission to access /directory/onwebserver/index.php on this server.

Otherwise the normal web page will show up.


order deny,allow
deny from all
allow from 10.10.0.100 192.168.77.44