2

I've been following the book "The Definitive guide to Django" to create a web application. So far so good and soon, I'll be deploying the application on production. I am targeting the usage of Apache + FastCGI specified on the book. I am able to follow the initial setup indicated in the book. (i.e install Apache, install mod_fastcgi and edit httpd.conf). The next step indicated is "Specifying the Location of the FastCGI server". There are 2 steps which are (1)Use the FastCGIExternalServer directive to specify the location of your FastCGI server and (2)Use mod_rewrite to point URLs at FastCGI as appropriate.

This is where I got lost. I don't know if I will just add the following lines again to httpd.conf:

# Connect to FastCGI via a socket/named pipe:
FastCGIExternalServer /home/user/public_html/mysite.fcgi -socket /home/user/mysite.sock
# Connect to FastCGI via a TCP host/port:
FastCGIExternalServer /home/user/public_html/mysite.fcgi -host 127.0.0.1:3033

If not, how should I proceed on this? Hoping to hear any ideas. Thank you very much in advance!

1 Answer 1

1

I am not familiar with FastCGI myself (I have used Apache's mod_wsgi and gunicorn in the past, and will probably use gunicorn in the future) but it looks like you only need one of those lines. Preferably the top one using the socket.

Which file you add it to exactly depends on your specific Linux distribution. I would recommend not using your book for advice on how to serve django, because online tutorials specific to a linux distribution (for instance, this Linode help article on how to install django on Ubuntu 10.04 with mod_wsgi) will be more up-to-date and more specific. Only try to make sense of a potentially out-of-date book's instructions if you are an experienced system administrator.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the feedback Andrew. You've mentioned about gunicorn...Given you've used it before and will use it on the future, can you point me to comprehensive references on installing, configuring and using it? Thanks again!
When I used gunicorn it was on Heroku: devcenter.heroku.com/articles/python -- which itself is an avenue for hosting and serving django apps I heartily recommend. Here's also a good post on getting gunicorn set up on Ubuntu: senko.net/en/django-nginx-gunicorn . You'll notice that both of these tutorials use virtualenv -- that's because virtualenv is awesome and makes your job a lot easier.
Here's also another very specific and detailed document that I hadn't seen before: brandonkonkle.com/blog/2010/jun/25/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.