LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-19-2006, 05:06 PM   #1
linuxChique
LQ Newbie
 
Registered: Apr 2003
Location: Huntsville, AL
Distribution: mandrake
Posts: 4

Rep: Reputation: 0
Apache can't write files despite permissions/ownership


I've got a perl CGI script that writes data to a flatfile. Works fine on any web server, except the one I'm running on my PC. Apache runs as "apache," files are owned by apache, and I've tried every combination of permissions including 644, 664, 666. The apache user on my system has a shell, so I logged in as apache and I'm able to write to the file just fine on a shell, but Apache is not able to do so through the webserver.

perl v5.8.6, Apache 2.054.

error_log shows nothing, access_log shows http code 200 accesses, with no other useful information. STDERR for the perl "open" command gives "permission denied," but the perl "if(-w "filename")" which tests if the file is writeable by the effective uid/gid returns true.

Is there a known issue relating to this? This is boggling my mind.
 
Old 02-19-2006, 08:24 PM   #2
shaunw
Member
 
Registered: Dec 2005
Posts: 77

Rep: Reputation: 15
Smile Writing files

I have perl cgi scripts which write to flat files in the
cgi-bin directory so I don't understand why you are having
a problem. Try creating a blank file and setting its
permissions to writeable by all other users. Then use
append mode in your scipt to write to it.
If you are still having problems post the script.
 
Old 02-20-2006, 10:08 AM   #3
linuxChique
LQ Newbie
 
Registered: Apr 2003
Location: Huntsville, AL
Distribution: mandrake
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by shaunw
I have perl cgi scripts which write to flat files in the
cgi-bin directory so I don't understand why you are having
a problem. Try creating a blank file and setting its
permissions to writeable by all other users. Then use
append mode in your scipt to write to it.
If you are still having problems post the script.
Shaun,

As my post above states, I have already done that. The problem was that I had SELinux enabled in Fedora. Disabling it allowed Apache to write to the file.
 
  


Reply


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
how to configure apache to write files with special permissions maltune Linux - Software 0 08-03-2005 10:16 AM
changing permissions and ownership on many files and folders Cinematography Linux - General 4 08-01-2005 03:20 AM
change ownership on files written by apache/php to maintain effective quotas untoldone Linux - Software 2 01-14-2005 07:18 PM
Apache/Samba file permissions/ownership seedsca Linux - Networking 0 03-28-2004 09:07 PM
write permissions / ownership bynaar Slackware 15 08-08-2002 04:25 AM


All times are GMT -5. The time now is 09:00 PM.

Main Menu
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