LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Set permissions to allow php/apache to write files. (http://www.linuxquestions.org/questions/linux-server-73/set-permissions-to-allow-php-apache-to-write-files-933333/)

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:
Code:

# 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 06:13 AM.