469,612 Members | 2,576 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,612 developers. It's quick & easy.

Baffling apache fopen/fputs permissions issue (not the typical question)

I have a new server RHE4 and I am having an issue I have never had before and it's kind of urgent.

Running Apache 2.0 I need the web server to have writable access and getting denied - I'm pretty sure my users/groups/permissions/etc are all good.

Apache is running as user apache group ftpusers.
server root for default server is at the top /export/home
chowned to apache and grped to ftpusers recursively.
Even so with permissions -777 on the whole tree I get permission denied. This simple script shows the error - this is a vhost under root in apache but again - the entire tree is currently set to 777 (obviously this will change when I figure out WTF)

This is a very basic script - lives at /export/home/sites/2point0/TPO-IP/html/simpletest.html chmod 777 owner apache group ftpusers.
Expand|Select|Wrap|Line Numbers
  1. .. if($_REQUEST['submit']){
  2.     $handle = fopen($_SERVER['DOCUMENT_ROOT']."/testfile.txt","w+");
  3.     fputs($handle,"test this out");
  4.     fclose($handle);
  5. }
  6. ..
http://2point0media.com/simpletest.html

Warning: fopen(/export/home/sites/2point0/TPO-IP/html/testfile.txt): failed to open stream: Permission denied in /export/home/sites/2point0/TPO-IP/html/simpletest.html on line 2


Thanks to any and all - I searched for a while for a similar situation - mainly the posts are people having users and groups mismatched - helP!
Jun 13 '07 #1
3 2886
Motoma
3,237 Expert 2GB
Do you have SELinux enabled? I am not a big fan of it, it tends to alter the traditional way that Linux deals with security by adding another layer.

Get back and let us know.
Jun 13 '07 #2
Sure enough - it's enabled - I was unfamiliar with that. Turned it of and I am good to go.

I can't thank you enough - seriously - you are my hero right now and I appreciate it beyond explanation! I knew I was about as knowledgable at least as the tier 2 people at my hosting place and they were spinning me in circles.

Thanks for the simple tip that saved my day!!!!!!
Jun 13 '07 #3
Motoma
3,237 Expert 2GB
Sure enough - it's enabled - I was unfamiliar with that. Turned it of and I am good to go.

I can't thank you enough - seriously - you are my hero right now and I appreciate it beyond explanation! I knew I was about as knowledgable at least as the tier 2 people at my hosting place and they were spinning me in circles.

Thanks for the simple tip that saved my day!!!!!!
Hey! Your post made my day! I'm glad you got everything working out. Come back any time you have a problem.
Jun 13 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by JDJones | last post: by
5 posts views Thread by Shaoyong Wang | last post: by
3 posts views Thread by theouimets | last post: by
12 posts views Thread by Bill | last post: by
2 posts views Thread by gruddo | last post: by
14 posts views Thread by Aaron Couts | last post: by
28 posts views Thread by Sathyaish | last post: by
16 posts views Thread by Hans Fredrik Nordhaug | last post: by
Jacotheron
3 posts views Thread by Jacotheron | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.