I rebuilt the myapp exercise of a quickstarted tg2 distribution.
The reason why there was a discrepancy between the conf files and
the error log is that the conf files that I e-mailed had the paths
slightly
different from an earlier trial.  I have the current versions of
everything in
this e-mail.

I have set all of the files ownerships to the apache user, under /usr/
local/turbogears.
I also turned off the WSGIPythonHome directive

Here is the current error statement:
Debian5:/usr/local/turbogears/BASELINE/bin# tail -f /var/log/apache2/
error.log
[Wed Aug 11 19:58:18 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=5110): Starting thread 8 in daemon process 'myapp'.
[Wed Aug 11 19:58:18 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=5112): Starting thread 8 in daemon process 'myapp'.
[Wed Aug 11 19:58:18 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=5116): Starting thread 7 in daemon process 'myapp'.
[Wed Aug 11 19:58:18 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=5110): Starting thread 9 in daemon process 'myapp'.
[Wed Aug 11 19:58:18 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=5112): Starting thread 9 in daemon process 'myapp'.
[Wed Aug 11 19:58:18 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=5116): Starting thread 8 in daemon process 'myapp'.
[Wed Aug 11 19:58:18 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=5110): Starting thread 10 in daemon process 'myapp'.
[Wed Aug 11 19:58:18 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=5112): Starting thread 10 in daemon process 'myapp'.
[Wed Aug 11 19:58:18 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=5116): Starting thread 9 in daemon process 'myapp'.
[Wed Aug 11 19:58:18 2010] [debug] mod_wsgi.c(8673): mod_wsgi
(pid=5116): Starting thread 10 in daemon process 'myapp'.
[Wed Aug 11 19:58:33 2010] [info] mod_wsgi (pid=5110): Create
interpreter '192.168.149.128|/myapp'.
[Wed Aug 11 19:58:33 2010] [info] [client 127.0.0.1] mod_wsgi
(pid=5110, process='myapp', application='192.168.149.128|/myapp'):
Loading WSGI script '/usr/local/turbogears/myapp/apache/myapp.wsgi'.
[Wed Aug 11 19:58:33 2010] [error] [client 127.0.0.1] mod_wsgi
(pid=5110): Target WSGI script '/usr/local/turbogears/myapp/apache/
myapp.wsgi' cannot be loaded as Python module.
[Wed Aug 11 19:58:33 2010] [error] [client 127.0.0.1] mod_wsgi
(pid=5110): Exception occurred processing WSGI script '/usr/local/
turbogears/myapp/apache/myapp.wsgi'.
[Wed Aug 11 19:58:33 2010] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Wed Aug 11 19:58:33 2010] [error] [client 127.0.0.1]   File "/usr/
local/turbogears/myapp/apache/myapp.wsgi", line 25, in <module>
[Wed Aug 11 19:58:33 2010] [error] [client 127.0.0.1]     from
paste.deploy import loadapp
[Wed Aug 11 19:58:33 2010] [error] [client 127.0.0.1] ImportError: No
module named paste.deploy
[Wed Aug 11 19:58:33 2010] [debug] mod_deflate.c(615): [client
127.0.0.1] Zlib: Compressed 734 to 452 : URL /myapp
^C
Debian5:/usr/local/turbogears/BASELINE/bin#
-------------
End Statement
-------------

Here is the: ls -las /usr/local/turbogears/BASELINE
total 0
0 drwxr-sr-x 5 www-data www-data 120 2010-08-11 18:00 .
0 drwxr-sr-x 4 www-data www-data  96 2010-08-11 18:21 ..
0 drwxr-sr-x 2 www-data www-data 368 2010-08-11 18:41 bin
0 drwxr-sr-x 2 www-data www-data  80 2010-08-11 18:00 include
0 drwxr-sr-x 3 www-data www-data  80 2010-08-11 18:00 lib

-------------
End Statement
-------------

Here is the: ls -las /usr/local/turbogears/BASELINE/lib/python2.5/site-
packages
total 1552
  3 drwxr-sr-x 39 www-data www-data   2736 2010-08-11 19:00 .
  1 drwxr-sr-x  4 www-data www-data   1224 2010-08-11 18:00 ..
 20 -rw-r--r--  1 www-data root      18945 2010-08-11 18:19 AddOns-0.6-
py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:41
Babel-0.9.5-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:18 Beaker-1.3-
py2.5.egg
 36 -rw-r--r--  1 www-data root      35513 2010-08-11 18:19
BytecodeAssembler-0.3-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:41
Catwalk-2.0.2-py2.5.egg
  0 drwxr-sr-x  3 www-data www-data    136 2010-08-11 18:16
decorator-3.0.0-py2.5.egg
 28 -rw-r--r--  1 www-data root      28062 2010-08-11 18:19
DecoratorTools-1.7-py2.5.egg
  4 -rw-r--r--  1 www-data www-data   1763 2010-08-11 19:00 easy-
install.pth
  8 -rw-r--r--  1 www-data root       5935 2010-08-11 18:19
Extremes-1.1-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data    104 2010-08-11 18:18
FormEncode-1.2.1-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data    104 2010-08-11 18:41
FormEncode-1.2.2-py2.5.egg
224 -rw-r--r--  1 www-data root     227881 2010-08-11 18:15
Genshi-0.5.1-py2.5-linux-i686.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:17 Mako-0.2.4-
py2.5.egg
128 -rw-r--r--  1 www-data www-data 128709 2010-08-11 19:00
myapp-0.1dev-py2.5.egg
  4 -rw-r--r--  1 www-data www-data     29 2010-08-11 18:53 myapp.egg-
link
  0 drwxr-sr-x  5 www-data www-data    120 2010-08-11 18:17
nose-0.10.4-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:14
Paste-1.7.2-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:18
PasteDeploy-1.3.3-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:18
PasteScript-1.7.3-py2.5.egg
 80 -rw-r--r--  1 www-data root      79995 2010-08-11 18:16
PEAK_Rules-0.5a1.dev_r2582-py2.5.egg
 12 -rw-r--r--  1 www-data root       9801 2010-08-11 18:16
prioritized_methods-0.2.1-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:17
Pygments-1.0-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:16
Pylons-0.9.7-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:15
repoze.tm2-1.0a4-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:14
repoze.what-1.0.8-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:14
repoze.what.plugins.sql-1.0rc1-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:15
repoze.what_pylons-1.0rc3-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:12
repoze.what_quickstart-1.0-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:12
repoze.who-1.0.15-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:14
repoze.who_friendlyform-1.0b3-py2.5.egg
  0 drwxr-sr-x  5 www-data www-data    120 2010-08-11 18:14
repoze.who.plugins.sa-1.0rc1-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:16
repoze.who_testutil-1.0rc1-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:19
Routes-1.10.3-py2.5.egg
328 -rw-r--r--  1 www-data www-data 333390 2010-08-11 18:10
setuptools-0.6c11-py2.5.egg
320 -rw-r--r--  1 www-data www-data 324858 2008-05-20 16:20
setuptools-0.6c8-py2.5.egg
  4 -rw-r--r--  1 www-data www-data     30 2010-08-11 19:00
setuptools.pth
 92 -rw-r--r--  1 www-data root      90415 2010-08-11 18:16
simplejson-2.0.8-py2.5-linux-i686.egg
  0 drwxr-sr-x  5 www-data www-data    120 2010-08-11 18:41
sprox-0.6.10-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data    104 2010-08-11 18:13
SQLAlchemy-0.5.1-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:13
sqlalchemy_migrate-0.5.2-py2.5.egg
  8 -rw-r--r--  1 www-data root       4217 2010-08-11 18:19
SymbolType-1.0-py2.5.egg
 24 -rw-r--r--  1 www-data root      21532 2010-08-11 18:17
Tempita-0.2-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:01
tg.devtools-2.0.2-py2.5.egg
 36 -rw-r--r--  1 www-data root      35161 2010-08-11 18:41
tgext.admin-0.3.10-py2.5.egg
 20 -rw-r--r--  1 www-data root      18082 2010-08-11 18:41
tgext.crud-0.3.8-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:41
ToscaWidgets-0.9.10-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:15
ToscaWidgets-0.9.4-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data    104 2010-08-11 18:16
transaction-1.0a1-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:13
TurboGears2-2.0.3-py2.5.egg
 16 -rw-r--r--  1 www-data root      15121 2010-08-11 18:14
TurboJson-1.2.1-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:41
tw.forms-0.9.9-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:15
WebError-0.10.1-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:15
WebFlash-0.1a9-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data    104 2010-08-11 18:19
WebHelpers-0.6.4-py2.5.egg
112 -rw-r--r--  1 www-data root     112707 2010-08-11 18:17
WebOb-0.9.6.1-py2.5.egg
 44 -rw-r--r--  1 www-data root      43432 2010-08-11 18:17
WebTest-1.1-py2.5.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:13
zope.interface-3.4.1-py2.5-linux-i686.egg
  0 drwxr-sr-x  4 www-data www-data     96 2010-08-11 18:41
zope.sqlalchemy-0.6-py2.5.egg

-------------
End Statement
-------------

Here is the: ls -las /usr/local/turbogears/BASELINE/lib/python2.5/site-
packages/myapp-0.1dev-py2.5.egg
128 -rw-r--r-- 1 www-data www-data 128709 2010-08-11 19:00 /usr/local/
turbogears/BASELINE/lib/python2.5/site-packages/myapp-0.1dev-py2.5.egg

-------------
End Statement
-------------

Here is the: ls -las /usr/local/turbogears/myapp/python-eggs
total 1
0 drwxr-sr-x 2 www-data www-data  48 2010-08-11 19:35 .
1 drwxr-sr-x 9 www-data www-data 536 2010-08-11 19:35 ..

-------------
End Statement
-------------

And now the curent configs:
# 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
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 sys

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

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

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

#            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

I'm skipping the production.ini because it really isn't any different
and I'm
not getting things working to the point that the ini file becomes
relevant.

On Aug 9, 7:00 pm, Graham Dumpleton <[email protected]>
wrote:
> On 10 August 2010 07:20, James Durham <[email protected]> wrote:
>
>
>
> > [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'
>
> Does the directory '/usr/local/turbogears/BASELINE' exist? Post output of:
>
>   ls -las /usr/local/turbogears/BASELINE
>
>   ls -las /usr/local/turbogears/BASELINE/lib/python2.5/site-packages
>
>   ls -las 
> /usr/local/turbogears/BASELINE/lib/python2.5/site-packages/myapp-0.1dev-py2.5.egg
>
> so can see whether it is even a virtual environment, who user owns it
> and what permissions are on directories.
>
>
>
> > I am trying to get a quickstarted (non modifide) distributed under
> > mod_wsgi.  I know I'm doing something wrong, but I can't put my finger
> > on it.
>
> > I am new to Python eggs and python distribution stuff.
> > My app when installed in the Vitual Enviroment seem's to want to stay
> > in an egg file when runing the myapp.wsgi script.
> > ---------
> > here's the relevant files
> > ---------
> > # 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/
>
> Don't override WSGIPythonHome unless you really understand why you
> would want to do it.
>
> > WSGIDaemonProcess myapp threads=10 processes=3
>
> Which means your processes run as Apache user. Thus any virtual
> environment directories would need to be readable by Apache user at
> least.
>
>
>
> > 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 sys
>
> > prev_sys_path = list(sys.path)
>
> > import site
> > site.addsitedir('/usr/local/pythonenv/BASELINE/lib/python2.5/site-
> > packages')
>
> Which doesn't agree with path for virtual environment you were giving
> above. Presume you mean't:
>
>   /usr/local/turbogears/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
>
> > import os, sys
> > sys.path.append('/usr/local/turbogears/myapp')
>
> > os.environ['PYTHON_EGG_CACHE'] = '/usr/local/turbogears/myapp/python-
> > eggs'
>
> Does this directory exist? What is the output from running:
>
>   ls -las /usr/local/turbogears/myapp/python-eggs
>
> Graham
>
> > 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
>
> > ----------------
>
> > # Begin production.ini
> > #
> > # myapp - TurboGears configuration
> > #
> > # The %(here)s variable will be replaced with the parent directory of
> > this file
> > #
> > [DEFAULT]
> > # WARGING == If debug is not set to false, you'll get the interactive
> > # debugger on production, which is a huge security hole.
>
> > debug = false
> > email_to = [email protected]
> > smtp_server = localhost
> > error_email_from = pa...@localhost
>
> > [server:main]
> > use = egg:Paste#http
> > host = 0.0.0.0
> > #port = 8080
>
> > [app:main]
> > use = egg:myapp
> > full_stack = true
> > cache_dir = %(here)s/data
> > beaker.session.key = myapp
> > beaker.session.secret = 6LH9mO+an90u6/gmVPtvY8ZZ3
> > app_instance_uuid = {53f38e78-b8f9-4f82-a443-f88b8423d567}
>
> > # If you'd like to fine-tune the individual locations of the cache
> > data dirs
> > # for the Cache data, or the Session saves, un-comment the desired
> > settings
> > # here:
> > #beaker.cache.data_dir = %(here)s/data/cache
> > #beaker.session.data_dir = %(here)s/data/sessions
> > # Specify the database for SQLAlchemy to use via
> > # turbogears.database
> > # %(here) may include a ':' character on Windows environments; this
> > can
> > # invalidate the URI when specifying a SQLite db via path name
> > sqlalchemy.url = sqlite:///%(here)s/somedb.db
> > sqlalchemy.echo = False
>
> > # WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION
> > ENVIRONMENT*
> > # Debug mode will enable the interactive debugging tool, allowing
> > ANYONE to
> > # execute malicious code after an exception is raised.
> > #set debug = false
>
> > # Logging configuration
> > # Add additional loggers, handlers, formatters here
> > # Uses python's logging config file format
> > #http://docs.python.org/lib/logging-config-fileformat.html
>
> > [loggers]
> > keys = root, myapp, sqlalchemy, auth
>
> > [handlers]
> > keys = console
>
> > [formatters]
> > keys = generic
>
> > # If you create additional loggers, add them as a key to [loggers]
> > [logger_root]
> > level = INFO
> > handlers = console
>
> > [logger_myapp]
> > level = INFO
> > handlers =
> > qualname = myapp
>
> > [logger_sqlalchemy]
> > level = WARN
> > handlers =
> > qualname = sqlalchemy.engine
> > # "level = INFO" logs SQL queries.
> > # "level = DEBUG" logs SQL queries and results.
> > # "level = WARN" logs neither.  (Recommended for production systems.)
>
> > # A logger for authentication, identification and authorization --
> > this is
> > # repoze.who and repoze.what:
> > [logger_auth]
> > level = WARN
> > handlers =
> > qualname = auth
>
> > # If you create additional handlers, add them as a key to [handlers]
> > [handler_console]
> > class = StreamHandler
> > args = (sys.stderr,)
> > level = NOTSET
> > formatter = generic
>
> > # If you create additional formatters, add them as a key to
> > [formatters]
> > [formatter_generic]
> > format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %
> > (message)s
> > datefmt = %H:%M:%S
> > # End production.ini
>
> > --
> > 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 
> > athttp://groups.google.com/group/modwsgi?hl=en.

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