How to Restrict Specific Files in Apache?
In this tutorial i will show you how to enable a directory in Apache and yet restrict certain files browsing.
Enable Folder in Apache
To enable a folder in Apache you need to edit the HTTPD conf or create a new conf file like following:
Enable the Directory
Require all granted # to allow all
Deny Specific File
Here I will be using the <files> Apache directive for this task.
Deny from all
The restart the Apache service:
Then restart the httpd service by running below command
service httpd restart
In RHEL 7.0
systemctle start httpd