Securing Your Linux Web Server Folder Access By IP

Go down

Securing Your Linux Web Server Folder Access By IP Empty 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
jamied_uk
jamied_uk
Admin

Posts : 2472
Join date : 2010-05-09
Age : 36
Location : UK

http://address-shortner.co.uk

Back to top Go down

Back to top


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