I have configure mod_wsgi along with Apache 2 and tested with my Debain Squeeze 6. I need to put my code under /var/www directory as a extension .wsgi.
Now, I want to configure Django with mod_wsgi. How do I do it? Do I put my every files under /var/www. Is there a security issue or something? Can someone tell me step by step to configure django with mod_wsgi and where would be better to put the DJango codes? Thank you! P.S I have intermediate Django knowledge.
I have configure mod_wsgi along with Apache 2 and tested with my Debain Squeeze
Share
Here are a couple of links that you can use. The first one has proven the most useful for me as it is very detailed!
http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
https://code.djangoproject.com/wiki/django_apache_and_mod_wsgi
Hope it helps!
EDIT:
Regarding security, as long as you provide access to the apache user (or www-data, depending on your linux distribution) (chown and chgrp) for all files in your /var/www/html/your_django_project you should not have any issues. Do NOT run anything as superuser.
Be careful to allow the apache user to write your log files, wherever they are. You could get irrelevant errors which could be caused by that.
Also, setup apache to serve django media files if you don’t want to end up with media-less pages 🙂