Restrict access based on IP address to selected directories

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

Allow from 192.168.1.0/24 - 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?

Replay

You should enter the IP address which you want to restrict instead of 192.168.1.0/24 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: 2

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

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