Hello -

I have been attempting to set up an environment to run a django-based
application using apache 2.2, mod_wsgi, and Python 2.6.  This is
running on RHEL 5, which requires us to keep the default Python 2.4
installed, as well.  I've gone through the documentation, as well as a
number of threads that appeared to be related, and tried to follow
those instructions, but nothing seems to be working.  Any help anyone
can provide would be greatly appreciated.  I have tried to provide all
relevant information below, but if I've missed anything, just ask.

As it stands right now, I have managed to get to the point where
Apache does send the request to Python through wsgi correctly, and the
correct Python version (2.6.4) appears to be getting executed.  I am
basing this on the following line in the apache log files, which
appears during startup:

[Thu Jun 09 14:02:36 2011] [notice] Apache/2.2.18 (Unix) mod_ssl/
2.2.18 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_wsgi/3.3 Python/2.6.4
configured -- resuming normal operations

However, when the script is run, it seems the python interpreter is
unable to find the standard libraries, resulting in an import error
for any referenced module, like so:


[Thu Jun 09 15:24:13 2011] [error] [client 10.1.2.168] mod_wsgi
(pid=25436): Target WSGI script '/data2/app/apphome/indivo/
indivo_server/django.wsgi' cannot be loaded as Python module.
[Thu Jun 09 15:24:13 2011] [error] [client 10.1.2.168] mod_wsgi
(pid=25436): Exception occurred processing WSGI script '/data2/app/
apphome/indivo/indivo_server/django.wsgi'.
[Thu Jun 09 15:24:13 2011] [error] Traceback (most recent call last):
[Thu Jun 09 15:24:13 2011] [error]   File "/data2/app/apphome/indivo/
indivo_server/django.wsgi", line 1, in <module>
[Thu Jun 09 15:24:13 2011] [error]     import os
[Thu Jun 09 15:24:13 2011] [error] ImportError: No module named os

We have attempted to use virtualenv to set up the Python2.6
environment, and pointed to it using the WSGI configuration
parameters.  The relevant section of the httpd.conf section looks like
this:

-- BEGIN httpd.conf SNIPPET --
<IfModule wsgi_module>
    DocumentRoot /data2/app/apphome/indivo/indivo_server
    Alias /static/ /data2/app/apphome/indivo/indivo_server/static/
    EnableMMAP  On
    EnableSendfile On
    LogLevel  warn

   <Directory /data2/app/apphome/indivo/indivo_server>
      Order deny,allow
      Allow from all
   </Directory>
   WSGIPythonHome /data2/app/python/python-26/
   WSGIApplicationGroup %{GLOBAL}
   WSGIScriptAlias / /data2/app/apphome/indivo/indivo_server/
django.wsgi
   WSGIPassAuthorization On

</IfModule>
-- END httpd.conf SNIPPET --

/data2/app/python/python-26/ is the location we created with
virtualenv.  I have also tried pointing directly to library
directories with WSGIPythonPath and WSGIPythonEggs directives, but
nothing seems to make it able to locate the libraries.

Also, from other threads I have seen, I have verified that the
mod_wsgi.so we are using is correctly linked to python2.6:

[ch143422@ndvodmo modules]$ ldd mod_wsgi.so
        linux-vdso.so.1 =>  (0x00007ffffcdfc000)
        libpython2.6.so.1.0 => /usr/lib64/libpython2.6.so.1.0
(0x00002b2b4ba25000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b2b4bdcd000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002b2b4bfe9000)
        libutil.so.1 => /lib64/libutil.so.1 (0x00002b2b4c1ed000)
        libm.so.6 => /lib64/libm.so.6 (0x00002b2b4c3f0000)
        libc.so.6 => /lib64/libc.so.6 (0x00002b2b4c674000)
        /lib64/ld-linux-x86-64.so.2 (0x000000304ce00000)
[ch143422@ndvodmo modules]$


Tim Kutz



-- 
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