I believe my Python versions are all in sync (2.7.6).
I discovered that my first problem was that my chroot was not completely
set up. I had neglected to mount the chroot fs in my guest. I did that
and have verified that the chroot is working as expected. It is located in
/var/chroot and the Django application has been copied to
/var/chroot/var/www/transfergateway . (I have not changed any permissions
on any of the chroot files).
Now that I have resolved the chroot problem, I am having a new error when
trying to start Apache with running mod_wsgi in the chroot:
Updated apache.conf:
WSGISocketPrefix /var/run/wsgi
<VirtualHost *:443>
ServerName **redacted***
WSGIScriptAlias / /var/chroot/var/www/transfergateway/myproject/wsgi.py
WSGIProcessGroup chroot
WSGIDaemonProcess chroot user=daemon group=daemon processes=2 threads=25
chroot=/var/chroot python-path=/var/chroot/var/www/transfergateway
<Directory /var/chroot/var/www/transfergateway/myproject/>
<Files wsgi.py>
Order deny,allow
Allow from all
</Files>
</Directory>
</VirtualHost>
WSGI File in chroot: /var/chroot/var/www/transfergateway/myproject/wsgi.py:
"""
WSGI config for myproject project.
This module contains the WSGI application used by Django's development
server
and any production WSGI deployments. It should expose a module-level
variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands
discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom
one
that later delegates to the Django one. For example, you could introduce
WSGI
middleware here, or combine a Django application with an application of
another
framework.
"""
import os
import sys
path='/var/www/transfergateway/myproject'
#if path not in sys.path:
#sys.path.append(path)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
Apache error log:
mod_wsgi (pid=16343): Target WSGI
script '/var/www/transfergateway/myproject/wsgi.py' cannot be loaded as
Python module.
mod_wsgi (pid=16343): Exception occurred processing WSGI script
'/var/www/transfergateway/myproject/wsgi.py'.
Traceback (most recent call last):
File "/var/www/transfergateway/myproject/wsgi.py", line 31, in
<module> application = get_wsgi_application()
File "/usr/local/lib/python2.7/dist-packages/django/core/wsgi.py", line 14,
in get_wsgi_application django.setup()
File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 20,
in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line
46, in __getattr__self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line
42, in _setupself._wrapped = Settings(settings_module)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line
98, in __init__% (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'myproject.settings' (Is it on
sys.path? Is there an import error in the settings file?): No module named
myproject.settings
I believe my issue now is relating to the PythonPath directive and access
to the project/Python my chroot, but am unsure how to resolve.
I'm kind of stuck-- so I appreciate the help!
--Jennifer
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.