Hello,
I run into small probablems in my configuration/placement.
- I have compiled and enabled mod_wsgi 1.8 with apache2 on debian.
http://lucasmanual.com/mywiki/TurboGears#head-36b7eef1526da4fe58c73738c925f34f6bc93c1d
I have a basic turbogears app that turbogears created using
quickstart. I am trying to run it in mod_wsgi.
I have installed my app using egg deploy.
easy_install myfirstapp-1.0-py2.4.egg
It put my turbogears app in
/usr/lib/python2.4/site-packages/myfirstapp-1.0-py2.4.egg/myfirstapp
I put my myfirstapp.wsgi in /etc/myfirstapp
/etc/myfirstapp# ls -l
total 8
-rw-r--r-- 1 root root 1157 2008-01-23 16:20 myfirstapp.wsgi
-rw-r--r-- 1 root root 2045 2008-01-22 00:22 prod.cfg
myfirstapp.wsgi looks like this:
-----------------------------
import sys
sys.path.append('/usr/lib/python2.4/site-packages/myfirstapp-1.0-py2.4.egg/myfirstapp')
sys.stdout = sys.stderr
import os
os.environ['PYTHON_EGG_CACHE'] =
'/usr/lib/python2.4/site-packages/myfirstapp-1.0-py2.4.egg/myfirstapp'
import atexit
import cherrypy
import cherrypy._cpwsgi
import turbogears
turbogears.update_config(configfile="/etc/myfirstapp/prod.cfg",
modulename="myfirstapp.config")
turbogears.config.update({'global': {'server.environment': 'production'}})
turbogears.config.update({'global': {'autoreload.on': False}})
turbogears.config.update({'global': {'server.log_to_screen': False}})
#For non root mounted wiki:
turbogears.config.update({'global': {'server.webpath': '/myfirstapp'}})
import myfirstapp.controllers
cherrypy.root = myfirstapp.controllers.Root()
if cherrypy.server.state == 0:
atexit.register(cherrypy.server.stop)
cherrypy.server.start(init_only=True, server_class=None)
#For root mounted app
#application = cherrypy._cpwsgi.wsgiAppi
#For none-root mounted app
def application(environ, start_response):
environ['SCRIPT_NAME'] = ''
return cherrypy._cpwsgi.wsgiApp(environ, start_response)
--------------
My apache file in:
/etc/apache2/conf.d/myfirstapp looks like:
WSGIScriptAlias /myfirstapp /etc/myfirstapp/myfirstapp.wsgi
<Directory /usr/lib/python2.4/site-packages/myfirstapp-1.0-py2.4.egg/myfirstapp>
Order deny,allow
Allow from all
</Directory>
This is the error I am getting in my logs:
cat /var/log/apache2/error.log
-- resuming normal operations
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1] mod_wsgi
(pid=4177): Target WSGI script '/etc/myfirstapp/myfirstapp.wsgi'
cannot be loaded as Python module.
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1] mod_wsgi
(pid=4177): Exception occurred within WSGI script
'/etc/myfirstapp/myfirstapp.wsgi'.
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1] File
"/etc/myfirstapp/myfirstapp.wsgi", line 13, in ?
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1]
turbogears.update_config(configfile="/etc/myfirstapp/prod.cfg",
modulename="myfirstapp.config")
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1] File
"/var/lib/python-support/python2.4/turbogears/config.py", line 207, in
update_config
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1]
configure_loggers(configdict)
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1] File
"/var/lib/python-support/python2.4/turbogears/config.py", line 143, in
configure_loggers
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1]
_get_handlers(handlers, formatters)
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1] File
"/var/lib/python-support/python2.4/turbogears/config.py", line 50, in
_get_handlers
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1] raise
ConfigError("Missing or wrong argument to "
[Wed Jan 23 16:23:02 2008] [error] [client 127.0.0.1] ConfigError:
Missing or wrong argument to FileHandler in handler access_out ->
[Errno 13] Permission denied: 'server.log'
----
-What is wrong with this configuration?
-Configuration mentions writable cache folder? Where is that at? Do I need it?
- Is /usr/lib/python2.4/site-packages/myfirstapp-1.0-py2.4.egg/myfirstapp
prefered folder to link in apache?
- Is there a different way I should deploy my app? (not with
easy_install or some parameter for easy_install?)
- What should be the permissions on each of these files ,wsgi, prod.cfg,
Thanks,
Lucas
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---