I have a small vps with a minimum install of ubuntu lucid-lynx with about 256mb memory, it's newly installed with nothing special running on it. I'm trying to deploy django to it, while I'm successfully running the server using manage.py, I can't get apache with wsgi working:
# service apache2 start && service apache2 status
* Starting web server apache2 [ OK ]
Apache is NOT running.
Erorr log /var/log/apache2/error.log
:
[Thu Apr 14 21:17:29 2011] [warn] pid file /var/run/apache2.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Apr 14 21:17:29 2011] [notice] Apache/2.2.14 (Ubuntu) mod_wsgi/2.8 Python/2.6.5 configured -- resuming normal operations
[Thu Apr 14 21:17:29 2011] [alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread
[Thu Apr 14 21:17:29 2011] [error] Exception KeyError: KeyError(-1216795792,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Apr 14 21:17:29 2011] [alert] (11)Resource temporarily unavailable: apr_thread_create: unable to create worker thread
[Thu Apr 14 21:17:29 2011] [error] Exception KeyError: KeyError(-1216795792,) in <module 'threading' from '/usr/lib/python2.6/threading.pyc'> ignored
[Thu Apr 14 21:17:31 2011] [alert] No active workers found... Apache is exiting!
My apache config file /etc/apache2/httpd.conf
:
WSGIScriptAlias / /usr/local/django/deals/apache/django.wsgi
<Directory /usr/local/django/deals/apache>
Order deny,allow
Allow from all
</Directory>
The /usr/local/django/deals/apache/django.wsgi
file:
import os
import sys
path = '/usr/local/django/deals'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'deals.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
Seem to be installed:
# dpkg -l \*apache\* |grep -E '^ii'
ii apache2 2.2.14-5ubuntu8.4 Apache HTTP Server metapackage
ii apache2-mpm-worker 2.2.14-5ubuntu8.4 Apache HTTP Server - high speed threaded mod
ii apache2-utils 2.2.14-5ubuntu8.4 utility programs for webservers
ii apache2.2-bin 2.2.14-5ubuntu8.4 Apache HTTP Server common binary files
ii apache2.2-common 2.2.14-5ubuntu8.4 Apache HTTP Server common files
ii libapache2-mod-wsgi 2.8-2ubuntu1 Python WSGI adapter module for Apache