Hello, I'm working on an exercise to learn tg2 and mod_wsgi
integration.
The basic idea is to use a quickstarted tg2 app and immediately deploy
that
app using mod_wsgi.
I started with some templates from modwsgideploy.
I modified them to point to the right directories, and also fix some
directive
issues.  (mod_wsgi couldn't see the virtual environment for instance.)

The work on this halted when I got to this point.

[Wed Aug 04 20:58:35 2010] [error] [client 127.0.0.1] Error - <type
'exceptions.OSError'>: [Errno 20] Not a directory: '/usr/local/
turbogears/BASELINE/lib/python2.5/site-packages/myapp-0.1dev-
py2.5.egg/
myapp/controllers'

The theme of the problem was that when "myapp" was installed it was
installed as
an egg file.   The execution of the package just didn't happen.

I went to Graham's mod_wsgi's group to see if he could help.  He
tried, but he
couldn't help proper like.  Topic: A virtual environment thing?
(turbogears 2.0)
Google group: modwsgi.

Graham's final word was this:
>For whatever reason, Paste deploy isn't dealing with your zipped egg
>file. Suggest you install it as an expanded egg based package instead.
>
>Alternatively, you will need to go ask TG people whether one can have
>a site as zipped egg file and how to get it to work as I can't think
>of anything else to suggest.
>
>Graham
Here's the current conf files and error log:
--------------------------------------------
# Begin Apache 2 conf, filename "myapp", path "/etc/apache2/sites-
available"
Alias /myapp/images /usr/local/turbogears/myapp/myapp/public/images
Alias /myapp/css /usr/local/turbogears/myapp/myapp/public/css
Alias /myapp/javascript /usr/local/turbogears/myapp/myapp/public/
javascript

# my BASELINE is probably wrong(i.e. it may not be a BASELINE)
#WSGIPythonHome /usr/local/turbogears/BASELINE/
# removing WSGIPythonHome

WSGIDaemonProcess myapp threads=10 processes=3 python-path=/usr/local/
turbogears/BASELINE/lib/python2.5/site-packages
WSGIProcessGroup myapp
WSGIScriptAlias /myapp /usr/local/turbogears/myapp/apache/myapp.wsgi

<Directory /usr/local/turbogears/myapp/apache>
Order deny,allow
Allow from all
</Directory>
# End Apache 2 conf
---------------------------------------------
# Begin myapp.wsgi, path "/usr/local/turbogears/myapp/apache"

import os, sys
sys.path.append('/usr/local/turbogears/myapp')

os.environ['PYTHON_EGG_CACHE'] = '/usr/local/turbogears/myapp/python-
eggs'

prev_sys_path = list(sys.path)

#import site
#site.addsitedir('/usr/local/pythonenv/BASELINE/lib/python2.5/site-
packages')

new_sys_path = []
for item in list(sys.path):
    if item not in prev_sys_path:
       new_sys_path.append(item)
       sys.path.remove(item)
       sys.path[:0] = new_sys_path

#from paste.script.util.logging_config import fileConfig
#fileConfig('/usr/local/turbogears/myapp/production.ini')

from paste.deploy import loadapp
application = loadapp('config:/usr/local/turbogears/myapp/
production.ini')
# End myapp.wsgi
---------------------------------------
err log:
Debian5:/home/james# tail -f /var/log/apache2/error.log
[Thu Aug 12 15:47:44 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=4227): Starting thread 7 in daemon process 'myapp'.
[Thu Aug 12 15:47:44 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=4225): Starting thread 8 in daemon process 'myapp'.
[Thu Aug 12 15:47:44 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=4226): Starting thread 8 in daemon process 'myapp'.
[Thu Aug 12 15:47:44 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=4227): Starting thread 8 in daemon process 'myapp'.
[Thu Aug 12 15:47:44 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=4225): Starting thread 9 in daemon process 'myapp'.
[Thu Aug 12 15:47:44 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=4226): Starting thread 9 in daemon process 'myapp'.
[Thu Aug 12 15:47:44 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=4227): Starting thread 9 in daemon process 'myapp'.
[Thu Aug 12 15:47:44 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=4225): Starting thread 10 in daemon process 'myapp'.
[Thu Aug 12 15:47:44 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=4226): Starting thread 10 in daemon process 'myapp'.
[Thu Aug 12 15:47:44 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=4227): Starting thread 10 in daemon process 'myapp'.
[Thu Aug 12 15:48:03 2010] [info] mod_wsgi (pid=4225): Create
interpreter '192.168.149.128|/myapp'.
[Thu Aug 12 15:48:03 2010] [info] mod_wsgi (pid=4225): Adding '/usr/
local/turbogears/BASELINE/lib/python2.5/site-packages' to path.
[Thu Aug 12 15:48:03 2010] [info] [client 127.0.0.1] mod_wsgi
(pid=4225, process='myapp', application='192.168.149.128|/myapp'):
Loading WSGI script '/usr/local/turbogears/myapp/apache/myapp.wsgi'.
[Thu Aug 12 15:48:03 2010] [info] mod_wsgi (pid=4286): Attach
interpreter ''.
[Thu Aug 12 15:48:17 2010] [debug] mod_deflate.c(615): [client
127.0.0.1] Zlib: Compressed 430 to 223 : URL /myapp
[Thu Aug 12 15:48:17 2010] [info] mod_wsgi (pid=4227): Create
interpreter '192.168.149.128|/myapp'.
[Thu Aug 12 15:48:17 2010] [info] mod_wsgi (pid=4227): Adding '/usr/
local/turbogears/BASELINE/lib/python2.5/site-packages' to path.
[Thu Aug 12 15:48:17 2010] [info] [client 127.0.0.1] mod_wsgi
(pid=4227, process='myapp', application='192.168.149.128|/myapp'):
Loading WSGI script '/usr/local/turbogears/myapp/apache/myapp.wsgi'.
[Thu Aug 12 15:48:20 2010] [error] [client 127.0.0.1] Error - <type
'exceptions.OSError'>: [Errno 20] Not a directory: '/usr/local/
turbogears/BASELINE/lib/python2.5/site-packages/myapp-0.1dev-
py2.5.egg/
myapp/controllers'
....

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en.

Reply via email to