4

I'm curious... I'm looking to have a really efficient setup for my slice for a client. I'm not an expert with servers and so am looking for good solid resources to help me set this up... It's been recommended to me that using FastCGI for PHP, Green Unicorn (gunicorn) for Django and Nginx for media is a good combination to have PHP and Django running on the same slice/server. This is needed due to have a main Django website and admin, but also to have a PHP forum on there too.

Could anyone push me to some useful resources that would help me set this up on my slice? Or at least, any views or comments on this particular setup?

2
  • Nah you don't wanna be doing that mate. What you wanna be doing is running Green Unicorn behind a mod_proxy setup with a whiskey interface. Commented Mar 23, 2010 at 9:25
  • What's whiskey? I couldn't find any reference to it on the web Commented Mar 31, 2011 at 10:24

4 Answers 4

3

I think one solution could be using a combination of PHP as apache module or through FastCGI and use mod_proxy apache module to do some reverse proxy to access your administration app running with gunicorn

You can have a setup like :

  • Front HTTP Server apache on port 80 : www.host.com:80
  • Backend HTTP Server gunicorn on another port : other.host.com:8080 or localhost:8080 publicly accessed with mod_proxy and url like www.host.com/admin/
  • Media HTTP Server : media.host.com, if it has to be on the same system you can use mod_proxy and run the NGINX server on another TCP port.

Note that you should not be able to get the best performance with the NGINX as a media server hidden behind apache with mod_proxy.

This part of setup relies upon the possibility of having more than one public IP adress on this slice.

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

Comments

2

I found this question and almost went down the path of using Green Unicorn myself. Just a note that uWSGI seems to give significantly better performance than Green Unicorn, see a set of benchmarks here.

Linode has a great howto for configuring uWSGI with Nginx on Ubuntu (it works fine on Debian too).

I'm now using this setup and very happy with it so far.

Comments

-1

For the PHP part consider to install any PHP accelerator like eAccelerator or any other bytecode cache.
This is a more general article but could also be interessting for you.
For the Django part I have no idea / experience.

2 Comments

aa bytecode cache for PHP is not a solution for his question, he wants to have php and django working on the same host.
To quote the question: "I'm looking to have a really efficient setup..." therefore I would install a bytecode cache... ;-)
-1

I've been trying to run django behind nginx with WSGI module. It runs OK and pretty fast. You'll have to compile your own nginx, but it's really painless.

1 Comment

The problem here is that the nginx wsgi module is quite different than the apache one. Specifically, nginx is a single process server, so if the wsgi app blocks then the whole server blocks with it. It is unsupported. If you google for Graham Dumpleton, his comments are instructive as to the problems with this setup. To save time I have done so: blog.dscpl.com.au/2009/05/… This is why this answer neither is best practices, nor answers the question.

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.