HOW TO MANAGE SUB-DIRECTORY PERMISSIONS IN APACHE
May 13, 2019 / by Marco / Categories : Business, Technology, WebsitesIf you want to set permissions for subdirectories e.g restrict public access to /home/folder1/ but allow access to /home/folder1/folder2 then this is one way of doing it:
NOTE: I’m using VestaCP, an open source control panel for web hosting so these steps may not work for you
Copy and the default.stpl and default.tpl files in /usr/local/vesta/data/templates/web/httpd/ e.g default-modified.stpl (I decided to do this since the https.conf file gets rewritten every time I modify the website config via the VestaCP dashboard)
Edit the copied files and add the following:
<Directory %docroot%/home/folder1> Order deny,allow deny from all allow from x.x.x.x </Directory> <Directory %docroot%/home/folder1/folder2/> Allow from all </Directory>
Restart the httpd service using
service httpd restart
Test by accessing the two folders using a public IP address (e.g from your mobile phone) and the other from the static IP address x.x.x.x
OTHER ARTICLES YOU MAY LIKE
USING THIS AI TOO BOOST YOUR SOCIAL MEDIA GAME
A strong social media presence is essential for individuals and businesses alike. With the ever-growing number of users on various platforms, it can be daunting to stand out and create engaging content that captivates your audience. That’s where Marky comes in – a revolutionary tool that harnesses the power of artificial intelligence to help you […]
read moreHOW TO USE KATALIST AI TO CREATE AWESOME STORYBOARDS
Creating a compelling and visually appealing storyboard is crucial for any creative project, whether it’s a film, television show, or advertisement. However, the traditional process of storyboarding can be time-consuming and labor-intensive. That’s where Katalist AI comes in. This innovative tool combines the power of artificial intelligence with the creativity of human input to revolutionize […]
read more