Thanks.

I ever released PHP/Symfony project and it has same issue, the cache 
directory much be changed to have ownership of user apache and be writable. 
I believe for python/django, this is the same.
But when I use manage.py runserver, nothing happened, only in mod_wsgi, I 
got this issue. I guess, in mod_wsgi, the user should be apache also, while 
in "manage.py runserver" ,user is root, it can write to whereever.
Sorry, I am not a IT guy, so maybe these questions are pretty silly.

1. In apache mod_wsgi, who is the user, is that 'apache'? but when I tried 
to use chown -R apache:apache for the whole document root, I got 
'user/group does not exist', so it may be someone else;
2. I tried to print out the name at '/usr/lib/python2.6/os.py in makedirs, 
line 157', the name parameter is only '.cache', this is kind of confusion, 
where is the directory going to be created?
3. I am not using daemon mode yet, if I change to daemon mode, will that 
solve the problem?

For your answer, point 1 and 2, how do I control the directory position, 
how can I move to /tmp?

Thanks for your kind help in advance.

Frank


On Friday, August 2, 2013 6:51:46 PM UTC-7, Jason Garber wrote:
>
> Sounds like you need a traceback to see what it was trying to do.  Check 
> this:
>
>
> http://stackoverflow.com/questions/4839762/how-do-i-use-djangos-logger-to-log-a-traceback-when-i-tell-it-to
>
> Also, assuming you are in daemon mode, the wsgi python process will 
> inherit the apache user/group unless overridden with the arguments `user` 
> and `group` to your WSGIProcessGroup directive in the apache configuration.
>
> You have a couple of options:
>
> 1. make this file/dir writable by `apache` (or your webserver user)
> 2. see if you can move it to /tmp via django config  (best?)
> 3. add user and group parameters to WSGIProcessGroup so that it runs as 
> the user that owns your files (potential security issues like writing 
> executable code)
>
> Not really a mod_wsgi problem, by the way, but I hope this helps point you 
> to an answer.
>
> J
>
>
>
>
>
> On Fri, Aug 2, 2013 at 9:05 PM, Frank He <[email protected] 
> <javascript:>>wrote:
>
>> I am now deploying my django project using apache mod_wsgi, after a lot 
>> effort, it is near the end. But now when I run my project directly, I am 
>> stuck with a permission issue, and got this error:
>>
>> OSError at / 
>>
>> [Errno 13] Permission denied: '.cache'
>>
>>  Request Method: GET  Request URL: http://10.3.94.239/  Django Version: 
>> 1.4  Exception Type: OSError  Exception Value: 
>>
>> [Errno 13] Permission denied: '.cache'
>>
>>  Exception Location: /usr/lib/python2.6/os.py in makedirs, line 157  Python 
>> Executable: /usr/bin/python
>> I believe this is because the cache can not be written, so natually,  I 
>> need to change its permission. But WHERE?
>>
>> I don't know how to find out the directory.
>>
>> Can you tell me anything about this?
>>
>> Thanks very much in advance.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "modwsgi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/modwsgi.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to