Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi everyone,
I just added a symlink inside /var/www that points to a folder inside my home.
Code:
php -> /home/gacanepa/Proyectos/PHP/
Then I set recursive 750 permissions to /home/gacanepa/Proyectos/PHP/ so that myself and everyone in my group would be able to read its contents.
Next step, I added user www-data (which supposedly is the user that runs apache2) to my group, and made sure it was added correctly.
That being said, I cannot open any file inside /home/gacanepa/Proyectos/PHP/ using a web browser because it returns a 403 Forbidden message.
Then I changed the permissions to 755 and it worked like a charm.
What I do not understand is why the 750 permissions would not work if www-data was added to my group, and why I had to give r+x permissions to others in order for it to work.
Any ideas will be more than welcome. Thanks in advance.
So what group is the apache web server running under?
The server itself does not handle multi-groups - it only has one entry.
I assume, since this is Debian, that apache is running under the www-data group, with user www-data, but I may be wrong though - or probably I have a misunderstanding of how apache actually serves web pages.
No. It is fine if apache is running with group www-data...
Now every file you want apache to access must also be group www-data. And any intervening directory (such as /home/gacanepa/Proyecto), must also allow access - either through group, or other. That would mean that /home (usually is rx-rx-rx, which allows other, but it might not be) /home /gacanepa and /home/gacanepa/Proyecto must also be group www-data, or allow other rx,
No. It is fine if apache is running with group www-data...
Now every file you want apache to access must also be group www-data. And any intervening directory (such as /home/gacanepa/Proyecto), must also allow access - either through group, or other. That would mean that /home (usually is rx-rx-rx, which allows other, but it might not be) /home /gacanepa and /home/gacanepa/Proyecto must also be group www-data, or allow other rx,
That is why I was so confused in the first place. The following directories have permissions set to 750 (rwx for me, rx for my group, nothing for others):
As I mentioned, under these circumstances, user www-data (whose primary group is www-data) was added to my group, and still I couldn't access file.html due to Error 403.
It wasn't until I chmoded the above directories to 755 that I was finally able to read file.html. Weird, huh?
Those directories are not group www-data. Therefore the server could not traverse those directories.
Thanks! that did the trick. I changed the group of those directories and it worked like a charm. Just like I thought, it was a misunderstanding of how apache was working.
Thanks you for taking the time to teach me. I'll add to your reputation right now and mark this thread as solved .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.