Securing Your Linux Web Server Folder Access By IP

View previous topic View next topic Go down

Securing Your Linux Web Server Folder Access By IP

Post by jamied_uk on 25th April 2016, 15:28

Code:
sudo gedit /etc/apache2/apache2.conf



Locate directory section (for example/var/www/sub/payroll) and set it as follows:
Code:

<Directory /var/www/html/payroll/>
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 192.168.0.5
    Allow from 127.0.1.1
    Allow from 127.0.0.1
</Directory>

Another Example


Code:
<Directory /var/www/html/phpmyadmin/>
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 192.168.1.10
    Allow from 127.0.1.1
    Allow from 127.0.0.1
</Directory>




Now Restart Apache Server

Code:
sudo service apache2 restart
avatar
jamied_uk
Admin

Posts : 2280
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum