[Linux] Restricting folder access using httpd.conf

Writing time : 2016-07-12 00:55:14

Restricting folder access using httpd.conf

If you want to restrict access to phpMyAdmin or the administrator folder to a specific IP, add Directory settings to httpd.conf.

vi /etc/httpd/conf/httpd.conf  

The setting below means that only xxx.xxx.xxx.xxx is allowed for the IP accessing the /var/www/phpMyAdmin folder.

If you access the folder from an IP that has not been set up, an error occurs.

<Directory "/var/www/phpMyAdmin">  
Options FollowSymLinks Multiviews  
AllowOverride None  
Order deny,allow  
Deny from all  
Allow from xxx.xxx.xxx.xxx  

If you want to allow multiple IPs at the same time, you can use multiple lines of Allow from as shown below.

Allow from  
Allow from  
Allow from  

Refer to the link below for a detailed description of the setting that allows multiple IPs at the same time.


Previous post

Other posts in the category