# Python2.6.6 mod_wsgi and apache22 in a jail



## Sylhouette (Dec 1, 2010)

Hello all 
I am setting up Baruwa in a jail.

However I can not get the webpart working.

The error that I get is the following


```
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5] mod_wsgi (pid=88387): Target WSGI script '/usr/local/lib/python2.6/site-
packages/baruwa/baruwa.wsgi' cannot be loaded as Python module.
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5] mod_wsgi (pid=88387): Exception occurred processing WSGI script 
'/usr/local/lib/python2.6/site-packages/baruwa/baruwa.wsgi'.
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5] Traceback (most recent call last):
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5]   File "/usr/local/lib/python2.6/site-packages/baruwa/baruwa.wsgi", line 6, in <module>
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5]     import django.core.handlers.wsgi
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5]   File "/usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 8, in 
<module>
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5]     from django import http
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5]   File "/usr/local/lib/python2.6/site-packages/django/http/__init__.py", line 5, in 
<module>
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5]     from urllib import urlencode
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5]   File "/usr/local/lib/python2.6/urllib.py", line 26, in <module>
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5]     import socket
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5]   File "/usr/local/lib/python2.6/socket.py", line 64, in <module>
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5]     from _ssl import SSLError as sslerror
[Wed Dec 01 20:51:33 2010] [error] [client 192.168.0.5] ImportError: cannot import name SSLError
```

If I do the following all looks ok

You mean doing the following


```
mailscanner ~ # python
Python 2.6.6 (r266:84292, Dec  1 2010, 15:12:05)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd8
Type "help", "copyright", "credits" or "license" for more information.
>>> from _ssl import SSLError as sslerror
>>>
```

What can I do to get rid of the error?

regards,
Syl


----------



## Sylhouette (Dec 2, 2010)

Solved, the problem was that mod_wsgi needs apache with thread support.

I did not select thread support.

regards,
Johan


----------

