: Question about my public_HTML folder permissions I have a shared hosting account that uses cPanel and I think su_php. By default, the permissions for my public_HTML directory are set to 750,
I have a shared hosting account that uses cPanel and I think su_php. By default, the permissions for my public_HTML directory are set to 750, which allows my site and all folders/files inside public_HTML to be viewable by anyone who visits the site. I'm assuming this is because su_php allows the server to run as my user, thus being able to process php, read files, etc, and serve them to site viewers; rendering any permissions for "other" unnecessary.
But if I set the permissions of any folders within the public_HTML directory to 750 (instead of 755) and I try to visit a page inside that folder, the browser gives me a 403. I'm having trouble understanding why my public_HTML folder can be set to 750, but folders inside it need to be set to 755. If anyone could help me out with this, I'd really appreciate it!
More posts by @Kristi941
2 Comments
Sorted by latest first Latest Oldest Best
W3D, you are correct. This comes down to the fact that public_HTML is owned by the group "nobody," of which Apache is a member. Directories and files that I create are part of my own group, and not of the group "nobody." So while Apache is accessing the public_HTML folder, it is a part of that folder's group, hence the need for only 750 permission (which is optimal also because it keeps other users on the same server from being able to view and access my public_HTML folder). But once Apache reaches a directory or file I've created, Apache is no longer a part of it's group. To that directory or file, Apache is actually only qualified as "other." Hence, the need for those directories and files to be set to 755.
Thank you guys for your replies. I can't upvote yet or I would.
You can access files and folders within the public_HTML because they are not inheriting the 750 rule. Depending on your setup sometimes a child permission can overrule that of a parent, which I'm guessing is the case.
SOURCE: STACK OVERFLOW
0755 = User:rwx Group:r-x World:r-x
0750 = User:rwx Group:r-x World:--- (i.e. World: no access)
r = read
w = write
x = execute (traverse for directories)
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.