Happy Holidays.

I am using Apache 2.2.14 (from source) ./configure --enable-so --with-
mpm=worker --with-apr=/usr/local/bin/apr-1-config
apr-1.3.9 (from source) ./configure --prefix=/usr/local --enable-
threads
apr-util-1.3.9 (from source)./configure --with-apr=/usr/local/bin/
apr-1-config
Python 2.6.4 (from source)  ./configure --with-threads --enable-shared
--prefix=/usr/local
mod_wsgi 3.1 (from source)  ./configure --with-python=/usr/local/bin/
python2.6 --with-apxs=/usr/local/apache2/bin/apxs

on Centos 5.4.

Below I have the relevant apache config file and the error log.

If I use any other user than myuser ( which is the user that owns the
myurl project ) I get "ImportError: No module named
django.core.handlers.wsgi". I would like to be able to use other users
that do not have shell access or home directories.

What are the files and directories that need to have permissions set
to that of the daemon process user? I am assuming that this is a
permissions problem, since when I change user=myuser in the
WSGIDaemonProcess directive, my site works.

I have read:
http://code.google.com/p/modwsgi/wiki/ApplicationIssues

But I do not know how to set up permissions to get my site working
with daemon mode using other users that do not have home directories
or shell access, including the apache User- in this case 'beet'.

Any hints would be greatly appreciated.

####### WSGI script
import sys, os

sys.path.append('/var/www/django-projects')
sys.path.append('/var/www/django-projects/myurl')

os.environ['DJANGO_SETTINGS_MODULE'] = 'myurl.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

########### APACHE CONFIG
<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User beet
Group beet
</IfModule>
</IfModule>

LoadModule wsgi_module /usr/local/apache2/modules/mod_wsgi.so
WSGIPythonHome /usr/local

ServerLimit 16
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25

WSGISocketPrefix /var/run/wsgi

<VirtualHost 123.123.123.123:80>

   ServerName myurl.com

   DocumentRoot /var/www/myurl_htdocs/

   WSGIDaemonProcess myurl processes=2 threads=15 display-name=%
{GROUP} user=beet
   WSGIProcessGroup myurl
   WSGIScriptAlias /  /var/www/myurl_htdocs/myurl/apache/django.wsgi

   <Directory /var/www/django-projects/myurl/apache>
   Options -Indexes
   Order allow,deny
   Allow from all
   </Directory>
###################

############ error_log

[Sat Dec 26 02:31:05 2009] [notice] Apache/2.2.14 (Unix) mod_wsgi/3.1
Python/2.6.4 configured -- resuming normal operations
[Sat Dec 26 02:31:05 2009] [info] Server built: Dec 24 2009 23:11:42
[Sat Dec 26 02:31:05 2009] [debug] worker.c(1740): AcceptMutex:
sysvsem (default: sysvsem)
[Sat Dec 26 02:31:05 2009] [info] mod_wsgi (pid=15262): Attach
interpreter ''.
[Sat Dec 26 02:31:15 2009] [error] [client 321.321.321.321] mod_wsgi
(pid=15259): Target WSGI script '/var/www/django-projects/myurl/
apache/
django.wsgi' cannot be loaded as Python module.
[Sat Dec 26 02:31:15 2009] [error] [client 321.321.321.321] mod_wsgi
(pid=15259): Exception occurred processing WSGI script '/var/www/
django-projects/myurl/apache/django.wsgi'.
[Sat Dec 26 02:31:15 2009] [error] [client 321.321.321.321] Traceback
(most recent call last):
[Sat Dec 26 02:31:15 2009] [error] [client 321.321.321.321]   File "/
var/www/django-projects/myurl/apache/django.wsgi", line 13, in
<module>
[Sat Dec 26 02:31:15 2009] [error] [client 321.321.321.321]     import
django.core.handlers.wsgi
[Sat Dec 26 02:31:15 2009] [error] [client 321.321.321.321]
ImportError: No module named django.core.handlers.wsgi

--

You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.


Reply via email to