RE: What controls which directories httpd can serve from?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>On 4/9/07, Ken Morley <Ken@xxxxxxxx> wrote:

>> When I run the app, here's what I see in /var/log/httpd/error_log:
>>
>> [error] [client 192.168.168.41] (13)Permission denied: access to 
>> /samples/directory.php denied.
>>
>> If I move the file back to /var/www/html, it runs just fine.  I 
>> originally thought that it might have something to do with 
>> permissions, but I've pretty much proven that's not the issue.  I
also 
>> made sure that the file and it's subdirectory were owned by the user 
>> running httpd and it made no difference.

> On 4/9/07, Joshua wrote:
>
>This error log message occurs only when apache does not have the unix
permissions necessary to access the file >in the filesystem. Check the
permissions of the samples directory to make sure it is searchable
(chmod +x). 
>Also check to see if you are using anything fancy like symlinks or
SELinux.
>
>Joshua.

On 4/9/07, Ken Morley wrote:

Joshua:

Thanks VERY MUCH for the reply.  I tried your suggestion of making the
./samples directory executable and that solves the problem! BTW, I'm not
using SELinux or symlinks.

The question remains as to why the ./samples directory requires +x and
the others don't.  They are identically owned with identical permissions
on the directory and files.  The directories created by the FreePBX
installation run PHP programs just fine, while the directory I created
by hand requires the chmod +x.  Go figure...

Here's the contents of /var/www/html.  Note that admin, panel,
recordings applications all work fine without chmod +x.

drw-rw----   7 asterisk asterisk 4096 Apr  9 17:21 admin
drw-r--r--   5 root     root     4096 Feb  3 16:24 asteridex
drw-r-----   2 asterisk asterisk 4096 Nov 27 10:16 _asterisk
-rw-r--r--   1 root     root      602 Jan 25 08:25 index.html
lrwxrwxrwx   1 root     root       14 Nov 28 09:34 linux-docs ->
/usr/share/doc
-rw-r--r--   1 root     root     4542 Jan 25 08:25 mainstyle.css
-rw-r--r--   1 root     root     4120 Apr  2 19:20 mc.cgi
drw-rw----   2 asterisk asterisk 4096 Jan 25 16:04 panel
drw-rw-rw-   2 root     root     4096 Apr  9 13:30 phpagi
drw-r--r--  10 root     root     4096 Jan 30 16:02 phpMyAdmin
drw-rw----   7 asterisk asterisk 4096 Nov 27 10:16 recordings
drwxrwx--x   2 asterisk asterisk 4096 Apr  9 14:32 samples
-rw-r--r--   1 root     root     1323 Apr  3 08:25 test.cgi
drw-r--r--   2 root     root     4096 Apr  3 07:32 xml

Contents of /var/www/html/admin.  Note that all PHP files are owned by
asterisk:asterisk
and have 664 permissions:

-rwxrwxr--   1 asterisk asterisk    40 Jan 25 08:25 bounce_op.sh
drwxrwx---   6 asterisk asterisk  4096 Nov 27 10:16 cdr
drwxrwx---   2 asterisk asterisk  4096 Nov 27 10:16 common
-rw-rw-r--   1 asterisk asterisk 20979 Jan 25 08:25 components.class.php
-rw-rw-r--   1 asterisk asterisk 13993 Jan 25 08:25 config.php
-rw-rw-r--   1 asterisk asterisk 20908 Jan 25 08:25 extensions.class.php
-rw-rw-r--   1 asterisk asterisk  7404 Jan 25 08:25
featurecodes.class.php
-rw-rw-r--   1 asterisk asterisk  5116 Jan 25 08:25 footer.php
-rw-rw-r--   1 asterisk asterisk 73827 Jan 25 08:25 functions.inc.php
-rw-rw-r--   1 asterisk asterisk  3808 Jan 25 08:25 header_auth.php
-rw-rw-r--   1 asterisk asterisk  7459 Jan 25 08:25 header.php
drwxrwx---   9 asterisk asterisk  4096 Nov 27 10:16 i18n
drwxrwx---   2 asterisk asterisk  4096 Nov 27 10:16 images
-rw-rw-r--   1 asterisk asterisk  1524 Jan 25 08:25 index.php
-rw-rw-r--   1 asterisk asterisk  1700 Jan 25 08:25 logout.php
drwxrwx---  45 asterisk asterisk  4096 Mar 23 08:47 modules
-rw-rw-r--   1 asterisk asterisk 26634 Jan 25 08:25 page.modules.php
-rw-rw-r--   1 asterisk asterisk  1099 Jan 25 08:25 panel.php
-rw-rw-r--   1 asterisk asterisk  2608 Jan 25 08:25 reports.php
-rw-rw-r--   1 asterisk asterisk     5 Jan 25 08:25 version.txt

Contents of /var/www/html/samples.  Note that all PHP files are owned by
asterisk:asterisk
and have 664 permissions:
 
-rw-rw-r--  1 asterisk asterisk  5192 Apr  9 14:03 cfwd.php
-rw-rw-r--  1 asterisk asterisk  4196 Apr  9 10:51 directory.php
-rw-rw-r--  1 asterisk asterisk  4174 Apr  8 12:13 dnd.php
-rw-rw-r--  1 asterisk asterisk  1524 Apr  9 14:32 index.php
-rw-rw-r--  1 asterisk asterisk   663 Apr  9 14:01 meetme-user-room.php
-rw-rw-r--  1 asterisk asterisk   375 Apr  9 14:01 misc.php
-rw-rw-r--  1 asterisk asterisk 19627 Apr  9 14:01 phpagi-asmanager.php
-rw-rw-r--  1 asterisk asterisk   622 Apr  9 14:01 phpagi.example.conf
-rw-rw-r--  1 asterisk asterisk 47179 Apr  9 14:01 phpagi.php
-rw-rw-r--  1 asterisk asterisk  6228 Apr  9 14:01
README.phpagi-asmanager
-rw-rw-r--  1 asterisk asterisk  1167 Apr  8 12:13 register.php
-rw-rw-r--  1 asterisk asterisk  9532 Apr  8 11:44 sample.php

I wonder what the difference is?

Thanks again!

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux