Apache-the-program can't see directiories apache-the-user can see
I have encountered strange behavior. When I ask the listing of the root directory under the rights of apache user, I see the different picture then I see when the same command is issued by Python and displayed on the web page.
Here is the first listing Code:
[root@telesmi ~]# sudo -u apache ls -l / Code:
total 100 Why? Also, if I ask to list some directory inside one of these strange directories, I get the following error (for example) ls: cannot access /d4m: Permission denied while normal lack of access usually gives the following message ls: cannot open directory /root: Permission denied What is the difference between "cannot access" and "cannot open directory"? Thanks. |
The read bit on a directory gives you the ability to list the contents ("cannot open" implies you don't have this ability). The execute bit on a directory gives you the ability to access the directory ("cannot access" implies you don't have this ability).
|
Thanks.
And what can prevent Apache to view access rights? |
I don't know why you're getting (apparently) unexpected results from within your Python code.
Does it happen only with / or with other directories (/usr, for example) too? |
This happens for some directories. Below is listing for ls -l /usr
Code:
total 112 |
While src has no apparent differences from the POV of the command line:
Code:
[root@telesmi /]# sudo -u apache ls -l /usr |
May be this can related with some restrictions, applied to Apache only? May be some nutshell or FUSE somehow used? I am a newbie hence not sure these are correct suggestions...
|
I found resolution. This was because of selinux security for httpd.
|
Quote:
|
Quote:
|
All times are GMT -5. The time now is 05:39 PM. |