How do I give apache access to folders not owned by it?

Red Squirrel

No Lifer
May 24, 2003
70,155
13,566
126
www.anyf.ca
I installed a UT3 server and for security I want to run it as a different user, I want to give access to the folder to download maps manually. Problem is, the files are owned by that user/group and I want it to stay that way. I just keep getting "forbidden" errors when I try to access it via web, probably because the files arn't owned by apache. I even put a file and chmodded it 777 just to test and I still get the error. It's about time I maybe learn ACLs, as I will probably need them for this. What would be a good tutorial for that? I can't seem to find much online.

I tried adding apache to the ut3server group, but it did not work, so there must be more to it. Or is there a command I need to issue to refresh the group list? I can't recall last time I had to do that so not sure if it works instantly or if something has to be done.
 

mv2devnull

Golden Member
Apr 13, 2010
1,526
160
106
Login (shell) creates the session context and group membership is part of the context. Restarting apache service effectively logs out and logs in again.

Have you tried becoming the apache user? Can you access the files as that user?

Does the apache configuration set limits on what the http-server process can see?

Is there selinux in use?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
You also have to check the permissions on all of the parent directories as well, if apache can't chdir into them it will fail even if it can open the file with the full path IIRC.
 

Red Squirrel

No Lifer
May 24, 2003
70,155
13,566
126
www.anyf.ca
You also have to check the permissions on all of the parent directories as well, if apache can't chdir into them it will fail even if it can open the file with the full path IIRC.

Turned out it was this. I was comparing permissions with another folder that was a similar setup, but missed checking the very root of the home directory, the actual home directory folder was 700 so I put it 770 and it worked.

SElinux is disabled. That's the first thing that came to mind also, it tends to cause weird issues like that. One of these days I should probably learn how to actually use SElinux instead of just disabling it.