On 26 May 2011 22:52, David <[email protected]> wrote: >>> >>> The python module directories are all duplicated in the change-root >>> and true root; (actually they are in the change-root, and each >>> directory is soft-linked from the same path in the true root, but they >>> act as dual copies) >> >> Are you saying you have a symlink pointing from inside chroot >> directory outside. You can't do that. > > No, it's the other way around. The files are in the chroot dir, with > symlinks from outside the chroot pointing in, so that python running > outside the chroot sees the same paths as python running inside the > chroot. > > Apache chroots itself during startup, based on a 'Chroot /webroot' > line in the apache2.conf. > > Follow up: > > While composing this email, I reread the wiki/InstallationIssues page, > and tried setting the PATH explicitly for Apache; that *seems* to have > resolved the problem.
If you mean setting PATH so Python application can be found as anchor point, then you might be able to also use WSGIPythonHome. That is only a guess though as I don't understand the problem enough from the description. Graham > Thank you, Graham, for a great product, and extensive documentation. > > David > >> >> What happens when you have a physical copy inside of the chroot. >> >> BTW, do you need to have the whole Apache in the chroot? >> >> There is an ability to chroot just a mod_wsgi daemon process group. >> >> Graham >> >>> For diagnostic purposes, the wsgi script has the snippet: >>> >>> import sys >>> print >> sys.stderr, 'sys.path =', sys.path >>> print >> sys.stderr, 'sys.prefix =', sys.prefix >>> >>> This is what it prints in chrooted embedded python: >>> sys.path = ['/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', >>> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', >>> '/usr/lib/python2.6/lib-dynload', '/wsgi'] >>> sys.prefix = /usr >>> >>> and this is what it prints run from bash in the true root. >>> >>> sys.path = ['/webroot/wsgi', >>> '/usr/lib/python2.6/dist-packages/WebOb-1.0.7-py2.6.egg', >>> '/usr/lib/python2.6/dist-packages/twiddler-0.9.1-py2.6.egg', >>> '/usr/lib/python2.6/dist-packages/elementtree-1.2.7_20070827_preview-py2.6.egg', >>> '/usr/lib/python2.6/dist-packages/lxml-2.3-py2.6-linux-x86_64.egg', >>> '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', >>> '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', >>> '/usr/lib/python2.6/lib-dynload', '/usr/lib/python2.6/dist-packages', >>> '/usr/local/lib/python2.6/dist-packages', '/wsgi'] >>> sys.prefix = /usr >>> >>> Anyway, the abbreviated path I get chrooted does not allow Python to >>> find modules. Any insight as to what I might do to get this working? >> >> -- >> 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. >> >> > > > > -- > [email protected] > Rdbhost -> SQL databases as a webservice [www.rdbhost.com] > > -- > 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. > > -- 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.
