mod_python is part of apache and executes with the permissions of the
apache process.

Perhaps this has the answer
http://www.modpython.org/pipermail/mod_python/2001-January/011650.html

On 8/26/06, Martin Kelly <[EMAIL PROTECTED]> wrote:
It was with the os.mkdir() command via mod_python. The error log agrees:

[Sat Aug 26 21:18:41 2006] [error] [client 127.0.0.1] PythonHandler
mod_python. publisher:   File "/var/www/sgen/sgen.py", line 6, in ?\n
  os.mkdir('aoeu'), referer: http://127.0.0.1/sgen/
[Sat Aug 26 21:18:41 2006] [error] [client 127.0.0.1] PythonHandler
mod_python. publisher: OSError: [Errno 13] Permission denied: 'aoeu',
referer: http://127.0.0.1/sgen/

and:

[EMAIL PROTECTED]:~$ ps auwwfx|grep apache
root      6286  0.0  0.7   9788  3888 ?        Ss   21:03   0:00
/usr/sbin/apache2 -k start -DSSL
www-data  6287  0.0  0.3   8760  1788 ?        S    21:03   0:00  \_
/usr/sbin/apache2 -k start -DSSL
www-data  6292  0.0  1.0 232636  5668 ?        Sl   21:03   0:00  \_
/usr/sbin/apache2 -k start -DSSL
www-data  6294  0.0  1.1 232636  5708 ?        Sl   21:03   0:00  \_
/usr/sbin/apache2 -k start -DSSL
martin    6841  0.0  0.1   1948   616 pts/0    S+   22:22   0:00
   \_ grep apache

Looks like it is indeed running with www-data. I think the problem is
that mod_python is running under the wrong user. Does anyone know what
to do about this?

Thanks all.

larry price wrote:
> you can find out who apache is running as using ps
>
> ps auwwfx|grep apache
>
> How are you attempting to create the directory?
>
> and,
>
> What is the exact error message you are getting?
>
> also look through your error.log to see if something useful is in there.
>
>
> On 8/26/06, Martin Kelly <[EMAIL PROTECTED]> wrote:
>> I'm trying to give Apache permission to create a directory in /var/www,
>> as the permission keeps being denied. In my /etc/apache2/apache2.conf,
>> it has the following:
>>
>> User www-data
>> Group www-data
>>
>> So I assume apache is now running under www-data. Here's the output of a
>> few commands:
>>
>> [EMAIL PROTECTED]:~$ ls -l /var/
>> other entries
>> drwxrwxr-x  8 www-data www-data 4096 2006-08-26 21:00 www
>>
>> [EMAIL PROTECTED]:~$ ls -l /var/www/
>> total 44
>> drwxrwxr-x  2 www-data www-data 4096 2006-07-08 04:06 img
>> -rw-rw-r--  1 www-data www-data 1303 2006-08-23 21:24 index.html
>> -rw-rw-r--  1 www-data www-data  330 2006-06-28 22:48 main.css
>> drwxrwxr-x  2 www-data www-data 4096 2006-08-18 12:33 misc
>> drwxrwxr-x 68 www-data www-data 8192 2006-08-18 21:14 music
>> drwxrwxr-x  2 www-data www-data 4096 2006-08-18 21:13 secure
>> drwxrwxr-x  4 www-data www-data 4096 2006-08-26 20:46 sgen
>> -rw-rw-r--  1 www-data www-data  868 2006-05-26 19:21 spam.html
>> -rw-rw-r--  1 www-data www-data 1166 2006-05-26 19:21 spam.php
>> drwxrwxr-x  2 www-data www-data 4096 2006-08-24 21:52 utils
>>
>> Now, if I enable write permissions for all, it will work fine, but
>> that's totally insecure. I just wonder why apache doesn't seem to be
>> running under www-data.
>>
>> Thanks all,
>> Martin
>> _______________________________________________
>> EUGLUG mailing list
>> [email protected]
>> http://www.euglug.org/mailman/listinfo/euglug
>>
> _______________________________________________
> EUGLUG mailing list
> [email protected]
> http://www.euglug.org/mailman/listinfo/euglug
>
_______________________________________________
EUGLUG mailing list
[email protected]
http://www.euglug.org/mailman/listinfo/euglug

_______________________________________________
EUGLUG mailing list
[email protected]
http://www.euglug.org/mailman/listinfo/euglug

Reply via email to