I have had a couple of serious downtime incidents in the last year or two. The last one was almost two days, and I do not clearly recall the first one but I believe it was more then one day and was perhaps more forgivable because it was caused by a catastrophic total power failure in their data center.
However, this last incident was just (as far as I am aware) my little server, and it took them more then ten hours to even acknowledge my trouble ticket. And a total of more then forty hours to get the server running again. That is just unacceptable, even on the weekend.
I believe that in the past they were faster in responding to trouble tickets. Maybe it has something to do with a change in management, I do not know. Under the circumstances, they agreed to cancel my account without penalty and this week I moved my server to Rackspace.
These  would indicate mod_wsgi is the best way to server Django sites using Apache.
mod_wsgi does not seem to exist in the CentOS 5 repositories. Using this as my guide, I installed from source as follows:
cd /usr/lib/python2.4/config ln -s ../../../lib64/libpython2.4.so . cd wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz tar -xf mod_wsgi-3.3.tar.gz cd mod_wsgi-3.3 yum install httpd-devel ./configure --with-python=/usr/bin/python2.4 make make install
That all seemed to go well, and now I see this file: /usr/lib64/httpd/modules/mod_wsgi.so
Turn this module on in Apache, by adding the following lines to /etc/httpd/conf/httpd.conf:
LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi.so
AddHandler wsgi-script .wsgi
After "/etc/init.d/httpd restart" apache is still working. A very good sign.....
It is worth noting that the reference I am using for this also installed Python2.5 from source at the start of the whole process. CentOS 5 only has Python2.4. The reference did not justify why this was done, lets just cross our fingers and hope it will not be necessary.
Now lets see if we can get Apache to server up my helloWorld Django site. This seems to be the most authoritative document I can find on the subject.
cd /var/www/html/django/chinawandererCreate file /var/www/html/django/chinawanderer/apache/django.wsgi which contains the following:
Add this to /etc/httpd/conf/httpd.conf:import os, sys sys.path.append('/var/www/html/django') sys.path.append('/var/www/html/django/chinawanderer') os.environ['DJANGO_SETTINGS_MODULE'] = 'chinawanderer.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
And it works. Django in action: http://domain.com/django/chinawanderer/
WSGIScriptAlias / /var/www/html/django/chinawanderer/apache/django.wsgi Order deny,allow Allow from all