LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 11-04-2009, 11:23 PM   #1
royhb
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Rep: Reputation: 0
permissions headache


I'm having a bit of a permissions nightmare.

I have a directory called 'data'. It's owned by user1 and it's group is 'user1'. Directory permissions are 775.

Within 'data' is a file called 'thefile'. It's permissions are 664.

On my system apache runs as user www-data.

the group 'user1' has www-data added to it.
user1:x:500:www-data

I have a php script that is owned by user1.
When I run the script from the command line logged in as user1 it works fine and it can write to 'thefile'.

When I try to invoke the script via a web browser it fails with a permission problem writing to 'thefile'. It fails even though the file has a group othat includes www-data (apache).

I know that the answer will make me feel fairly dumb but I'm over banging my head against this.

Suggestions much appreciated.
 
Old 11-04-2009, 11:59 PM   #2
eth1
Member
 
Registered: May 2008
Posts: 97

Rep: Reputation: 20
The scenario you have mentioned should work without problems. Do you have SELINUX enabled ?

Quote:
cat /etc/selinux/config
 
Old 11-05-2009, 04:40 AM   #3
royhb
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by eth1 View Post
The scenario you have mentioned should work without problems. Do you have SELINUX enabled ?
No, no SELinux, no apparmor. I'll go back over everything I've set up and see if there's some seemingly minor error.
 
Old 11-05-2009, 06:22 AM   #4
avijitp
Member
 
Registered: May 2005
Location: India
Distribution: FC11, Debian/Ubuntu, RHEL, Solaris, AIX, HP-UX
Posts: 161

Rep: Reputation: 32
Check your php.ini file. There might be some system functions that is now allowing to write to the file.
 
  


Reply



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
Minicom headache raypen Slackware 1 06-29-2006 11:42 PM
Solving my Headache Sophic Linux - Wireless Networking 6 03-29-2004 11:27 AM
Help im so new i have a headache jjh221 Linux - Newbie 3 02-11-2004 08:02 PM
CUPS headache Angelo Slackware 2 11-17-2003 10:59 AM
headache... katana Linux - General 2 08-02-2001 07:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:42 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
Open Source Consulting | Domain Registration