Limiting Access to a directory from apache based on IP Address

I figured I would post this, as it could be use full in the future. This is an example of how to limit access to a web enabled directory in apache by ip address. There are a number of great web based tools for linux, but it is important to lock them down. Add this to your apatche.conf file, or which ever config file you have already included with apache. For example I added this to the apache.conf file that phpmyadmin installs in “/etc/phpmyadmin/”

<Directory “/etc/phpmyadmin/”>
           AllowOverride All
            Order deny,allow 
            Deny from all  
            Allow from 127 
            Allow from 192.168.0.62 
            # office
            Allow from 64.220.17.205 
</Directory>
Advertisements

About Paul Cardelli, CISSP
Cyber Security Analyst, and computer guru

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: