LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 03-07-2012, 09:44 PM   #1
BeaverusIV
Member
 
Registered: Oct 2004
Location: New Zealand
Distribution: Arch Linux 2010.05
Posts: 129

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, 02:01 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
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:
Code:
# chown root:wwrite directory_here

# chmod 2770 directory_here
 
Old 03-08-2012, 04:05 PM   #3
BeaverusIV
Member
 
Registered: Oct 2004
Location: New Zealand
Distribution: Arch Linux 2010.05
Posts: 129

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


Reply

Tags
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 03:49 AM
Unable to move or set write permissions for files taken from an mp3 player ton_vb Linux - Newbie 3 09-24-2006 04:16 AM
Apache can't write files despite permissions/ownership linuxChique Linux - Software 2 02-20-2006 11:08 AM
how to configure apache to write files with special permissions maltune Linux - Software 0 08-03-2005 11:16 AM
cannot edit file as root with write permissions set? Mishley Red Hat 4 08-05-2004 01:23 PM


All times are GMT -5. The time now is 12:38 PM.

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