Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 03-07-2012, 08:44 PM   #1
Registered: Oct 2004
Location: New Zealand
Distribution: Arch Linux 2010.05
Posts: 135

Rep: Reputation: 18
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.
Old 03-08-2012, 01:01 PM   #2
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
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
Old 03-08-2012, 03:05 PM   #3
Registered: Oct 2004
Location: New Zealand
Distribution: Arch Linux 2010.05
Posts: 135

Original Poster
Rep: Reputation: 18
Thanks it has worked, although I made it 2775 so users can access the site without login.


apache, centos, permissions

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't write to mounted HD, set permissions in fstab, need help LoneCanisLupus Linux - Hardware 12 02-23-2007 02:49 AM
Unable to move or set write permissions for files taken from an mp3 player ton_vb Linux - Newbie 3 09-24-2006 03:16 AM
Apache can't write files despite permissions/ownership linuxChique Linux - Software 2 02-20-2006 10:08 AM
how to configure apache to write files with special permissions maltune Linux - Software 0 08-03-2005 10:16 AM
cannot edit file as root with write permissions set? Mishley Red Hat 4 08-05-2004 12:23 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration