Access file outside DocumentRoot

Access file outside DocumentRoot

am 15.10.2007 17:14:22 von b38911

Hello.

I'm trying to access (remove) some files outside the document root
with a PHP script running on an apache2 server.
The removal fails (but also if I try to read a file) and I get the
error "Permission denied" in httpd error_log file.

I tried to add an Alias in httpd.conf, but it does not work....I'm
sure I'm missing something stupid...

Thanks,
Clip

Re: Access file outside DocumentRoot

am 15.10.2007 17:16:16 von Captain Paralytic

On 15 Oct, 16:14, b38...@yahoo.com wrote:
> Hello.
>
> I'm trying to access (remove) some files outside the document root
> with a PHP script running on an apache2 server.
> The removal fails (but also if I try to read a file) and I get the
> error "Permission denied" in httpd error_log file.
>
> I tried to add an Alias in httpd.conf, but it does not work....I'm
> sure I'm missing something stupid...
>
> Thanks,
> Clip

Does the user that apache is running under have permission to access
he files/directories?

Re: Access file outside DocumentRoot

am 15.10.2007 17:21:20 von b38911

> > Clip
>
> Does the user that apache is running under have permission to access
> he files/directories?

Yes, it has. It is running with apache user and "apache" has access to
these files and dir.

Thanks!

Re: Access file outside DocumentRoot

am 15.10.2007 17:27:15 von Captain Paralytic

On 15 Oct, 16:21, b38...@yahoo.com wrote:
> > > Clip
>
> > Does the user that apache is running under have permission to access
> > he files/directories?
>
> Yes, it has. It is running with apache user and "apache" has access to
> these files and dir.
>
> Thanks!

Well if apache is getting permission denied when it is trying to
access the files, what gives you the evidence that it "has access to
these files"?

If it had access to them, then when it tried to read them it would
read them. Getting access denied instead of getting the contents
suggests that it does NOT have access.

Thanks!

Re: Access file outside DocumentRoot

am 15.10.2007 17:31:29 von b38911

> Well if apache is getting permission denied when it is trying to
> access the files, what gives you the evidence that it "has access to
> these files"?
>
> If it had access to them, then when it tried to read them it would
> read them. Getting access denied instead of getting the contents
> suggests that it does NOT have access.
>
> Thanks!


you are right....but...I'm looking at the permissions: the files have
rw access to user and group and they are owned by user apache. I tried
also a stupid thing: I gave full access (777) to files and dirs, but I
still get the same error...
thanks,

Re: Access file outside DocumentRoot

am 15.10.2007 18:36:03 von Brendan Gillatt

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

b38911@yahoo.com wrote:
> Hello.
>
> I'm trying to access (remove) some files outside the document root
> with a PHP script running on an apache2 server.
> The removal fails (but also if I try to read a file) and I get the
> error "Permission denied" in httpd error_log file.
>
> I tried to add an Alias in httpd.conf, but it does not work....I'm
> sure I'm missing something stupid...
>
> Thanks,
> Clip
>

Have you got SafeMode on?

- --
Brendan Gillatt
brendan {at} brendangillatt {dot} co {dot} uk
http://www.brendangillatt.co.uk
PGP Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xBACD7433
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)

iD8DBQFHE5bzkA9dCbrNdDMRAtalAJ4pXWM2xK4N/RqdZKQ50Kn9AB//GgCf e/QS
X3IlXUqD33kcM0K4UitpiC8=
=ZgpZ
-----END PGP SIGNATURE-----

Re: Access file outside DocumentRoot

am 15.10.2007 22:45:40 von Jerry Stuckle

b38911@yahoo.com wrote:
>> Well if apache is getting permission denied when it is trying to
>> access the files, what gives you the evidence that it "has access to
>> these files"?
>>
>> If it had access to them, then when it tried to read them it would
>> read them. Getting access denied instead of getting the contents
>> suggests that it does NOT have access.
>>
>> Thanks!
>
>
> you are right....but...I'm looking at the permissions: the files have
> rw access to user and group and they are owned by user apache. I tried
> also a stupid thing: I gave full access (777) to files and dirs, but I
> still get the same error...
> thanks,
>
>

Is Apache actually running as user "Apache"? And who owns the directory
and what are the permissions there?


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Access file outside DocumentRoot

am 16.10.2007 08:58:20 von b38911

> Is Apache actually running as user "Apache"? And who owns the directory
> and what are the permissions there?
>
> --
> ==================

Got it: safe_mode was off, but I had SELINUX on. I turned it off and
then it is ok.

Thanks to all!

Clip