-   Linux - Server (
-   -   Set permissions to allow php/apache to write files. (

BeaverusIV 03-07-2012 08:44 PM

Set permissions to allow php/apache to write files.
I have a server box that won't let me write files through the website. I can access fine from SFTP.

I believe it is the apache user who needs write permission?

I tried adding apache into the admin group but it didn't work.

What permissions/groups do I need to set?

Gah, usually I know a bit more about a problem, so if you need anymore info I can grab it.

anomie 03-08-2012 01:01 PM

What sort of permissions does the "admin" group have on your system? That doesn't sound like a group you want to have the "apache" user in.

I'd create a new group that is specifically used for this purpose (updating directories that are served up by Apache). You can name it something like "wwrite", and put the "apache" user and your sftp user in it.

Ownership and permissions on such a directory could be set with:

# chown root:wwrite directory_here

# chmod 2770 directory_here

BeaverusIV 03-08-2012 03:05 PM

Thanks it has worked, although I made it 2775 so users can access the site without login.

All times are GMT -5. The time now is 10:59 PM.