Restrict access based on IP address to selected directories

<Directory /var/www/html/admin/> Order allow,deny Allow from Allow from myip </Directory> 

Allow from - do I need this line? Is this the best way and correct at all to put it in end of file in /etc/apache2/apache2.conf?


You should enter the IP address which you want to restrict instead of to the folder specified <Directory /var/www/html/admin/>, without that line how will you restrict the access to the directory?

Also make sure you restart httpd service by following command

/etc/init.d/httpd restart

Category: apache 2.2 Time: 2016-07-30 Views: 3

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.186 (s). 12 q(s)