?
Solved

httpd php permissions

Posted on 2005-03-18
7
Medium Priority
?
454 Views
Last Modified: 2008-02-26
Linux Fedora C2

I have problems getting a PHP script to write to disk. I  think it's an Apache permission problem. The script is owned by user "user66" and group "group11" so I've changed the httpd.conf file accordingly: User user66 and Group group11.  The script doesn't work, is there something else I have to check about httpd?

Thank you for your help.
0
Comment
Question by:rblampain
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 4

Assisted Solution

by:TomDavidson
TomDavidson earned 450 total points
ID: 13573192
It's probably worth checking the permissions of the directory the files are created in, is the directory writiable by user (user66) or group (group11)?
0
 

Author Comment

by:rblampain
ID: 13573885
Thanks to TomDavidson
Yes, the directories below the current directory are all 777 temporarily.
0
 
LVL 1

Assisted Solution

by:pmrussell892
pmrussell892 earned 450 total points
ID: 13579261
Do you have the directory in a directory container. EX

<Directory /path/to/script/folder>
   Order Allow, Deny
   Allow from all
</Directory>
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

Author Comment

by:rblampain
ID: 13580939
Thanks to pmrussell892
No, the /path/to/script/folder is only mentioned in the following lines in the "httpd.conf" file.  They are listed bellow after trimming of the comment lines. There is also something that puzzles me although it's probably OK:  line 10 below doesn't seem to have a matching preceding <Directory /> tag or is it nested and/or defined in some other way?

1 DocumentRoot "/home/meeting/chair"

 2 <Directory />
 3   Options FollowSymLinks
 4   AllowOverride None
 5 </Directory>

   # This should be ... DocumentRoot to.

 6 <Directory "/home/meeting/chair">
    Options Indexes FollowSymLinks
   #
   # AllowOverride controls what directives ....

 7   AllowOverride None
   #
   # Controls who can get stuff from this server.
   #
 8   Order allow,deny
 9   Allow from all

10 </Directory>

0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 600 total points
ID: 13581585
and httpd is running as user66?

check from command line if the script runs
what does your apache's error_log say?
0
 

Author Comment

by:rblampain
ID: 13582265
I found I probably had $_SESSION in the wrong place, I thought it had to be first in the PHP code but it looks like it's got to be first - full stop.
The scripts seems to go a bit further since I made this change ($_SESSION() before PHP and HTML code).
Since changing the user and group httpd runs under made no difference I restored the original values (see below).

Hello ahoffmann, I still have to have a look at the link you gave me.
httpd should be running as "apache" now, the config file is normally for "User apache" and "Group apache"
The script runs and apache gives the following error:
[client 192.168.1.13] PHP Warning:  chmod(): Operation not permitted in /home/meeting/chair/gedit_file.php on line 25, referer: http://192.168.1.13/display_tree.php

I've just made user apache a member of group11 just in case.
0
 

Author Comment

by:rblampain
ID: 13588810
The culprit seems to be SELinux. This is supposed to be "off" by default in the Fedora C2 I'm using but disabling it seems to have solved the problem.
I thank you all in helping to narrow the search for the cause of the problem and I'll allocate the points according to your involvment.
(I should have been a bit more precise in my last post, I meant "session_start", not "$_SESSION")
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question