0

So I'm trying to set up a OSQA server locally as a test run, so that when I set it up on a externally hosted server it will all go smoothly. I'm following this tutorial and have been going well so far, but have got stuck. At Starting Apache and OSQA I'm using Ubuntu 11.04 Natty Narwhal, Python2.7, Django, Apache, MySQL and everything else the tutorial calls for, however when I try to visit the site (http://localhost) I get an internal server 500 error. Looking at the error log I see this:

[Tue Oct 11 20:13:35 2011] [notice] mod_python: using mutex_directory /tmp 
[Tue Oct 11 20:13:36 2011] [notice] Apache/2.2.17 (Ubuntu) mod_python/3.3.1 Python/2.7.1+ mod_wsgi/3.3 configured -- resuming normal operations
[Tue Oct 11 20:15:13 2011] [notice] caught SIGTERM, shutting down
[Tue Oct 11 20:15:14 2011] [notice] mod_python: Creating 8 session mutexes based on 6 max processes and 25 max threads.
[Tue Oct 11 20:15:14 2011] [notice] mod_python: using mutex_directory /tmp 
[Tue Oct 11 20:15:14 2011] [notice] Apache/2.2.17 (Ubuntu) mod_python/3.3.1 Python/2.7.1+ mod_wsgi/3.3 configured -- resuming normal operations
[Tue Oct 11 20:23:46 2011] [notice] caught SIGTERM, shutting down
[Tue Oct 11 20:23:47 2011] [notice] mod_python: Creating 8 session mutexes based on 6 max processes and 25 max threads.
[Tue Oct 11 20:23:47 2011] [notice] mod_python: using mutex_directory /tmp 
[Tue Oct 11 20:23:47 2011] [notice] Apache/2.2.17 (Ubuntu) mod_python/3.3.1 Python/2.7.1+ mod_wsgi/3.3 configured -- resuming normal operations

Note that I tried to restart the server multiple times, so that is why there are duplicates. I've solved some of the other problems using forums, but I can't find an answer to this one. Can someone please explain what the error log means and why a SIGTERM is being sent to apache immediately after starting it?

EDIT: When checking osqa.error.log I see the following:

[Tue Oct 11 20:24:16 2011] [error] [client 127.0.0.1]     self.load_middleware()
[Tue Oct 11 20:24:16 2011] [error] [client 127.0.0.1]   File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/core/handlers/base.py", line 39, in load_middleware
[Tue Oct 11 20:24:16 2011] [error] [client 127.0.0.1]     for middleware_path in settings.MIDDLEWARE_CLASSES:
[Tue Oct 11 20:24:16 2011] [error] [client 127.0.0.1]   File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/utils/functional.py", line 276, in __getattr__
[Tue Oct 11 20:24:16 2011] [error] [client 127.0.0.1]     self._setup()
[Tue Oct 11 20:24:16 2011] [error] [client 127.0.0.1]   File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/conf/__init__.py", line 42, in _setup
[Tue Oct 11 20:24:16 2011] [error] [client 127.0.0.1]     self._wrapped = Settings(settings_module)
[Tue Oct 11 20:24:16 2011] [error] [client 127.0.0.1]   File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/conf/__init__.py", line 89, in __init__
[Tue Oct 11 20:24:16 2011] [error] [client 127.0.0.1]     raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
[Tue Oct 11 20:24:16 2011] [error] [client 127.0.0.1] ImportError: Could not import settings 'osqa.settings' (Is it on sys.path?): No module named osqa.settings

I'll try to figure this one out. Will update if further problems. Thanks.

user9517
  • 115,471
  • 20
  • 215
  • 297
Joshua Walsh
  • 165
  • 1
  • 10

1 Answers1

0

I'm no OSQA expert, in fact I've never used it. I do however know a smattering of Python, and looking at your stack trace I'd say you where missing an import module / python library of some description.

It appears the app your trying to run is looking to import a python module that handles it's settings, and it's either unable to find it or load it.

Do a search of your server environment, see if you can locate the file. If you can check it's permissions and make sure it's readable by what ever user the web server and/or the OSQA app is running under (Tip: if different may need to make them members of the same group).

If all is ok in this respect, then make sure that the module is in a location where your python interpreter expects to find additional library files and modules.

Whatever is causing the ultimate sigterm, I'm guessing it's most likely to mod_python keeling over due to the missing mod file causing exceptions / faults in the app code.

shawty
  • 293
  • 4
  • 15