I am going to deploy a mediumsized site powered by Django. I've got a devoted Ubuntu Server.

I am really confused that serversoftware to make use of. And so i considered to myself: why don't you request stackoverflow.

What i am searching for is:

  • Easy to setup
  • Easily on assets
  • Can serve mediafiles
  • In a position to serve multiple djangosites on same server
  • I'd rather not install PHP or other things that sucks assets, as well as for which i've no use for.

I have come across mod_wsgi and mod_python on Apache, nginx and lighty. What are benefits and drawbacks of those and also have i skipped someone?

@Craig: In some way i seem like Apache would be to bloated for me personally. How about the options?

@BrianLy: Ok I'll take a look at mod_wsgi more. Why will i need Apache basically serve static files with lighty? I've also handled for everyone the django application itself with lighty. Is the fact that bad in anyway? Sorry for beeing so stupid :-)

UPDATE: How about lighty and nginx - what are uses-times when fundamental essentials perfect choice?

Since i have was searching for more in-depth solutions, i made the decision to check out the problem myself in more depth. Please tell me if i have misinterpreted something.

General recommendation is by using another webserver to handle media. Separate means a webserver which isn't running django. This server could be for example:

  • Lighttpd (Lighty)
  • Nginx (EngineX
  • Or another light-weight server

Then, for django, you are able to go lower different pathways. You may either:

  • Serve Django via Apache and:

    • mod_python

      This is actually the stable and suggested/well recorded way. Cons: uses lots of memory.

    • mod_wsgi

      From things i understand, mod_wsgi is really a more recent alternative. It seems to become faster and simpler on assets.

    • mod_fastcgi

      When utilizing FastCGI you're assigning the serving of Django to a different process. Since mod_python features a python interpreter in each and every request it uses lots of memory. This can be a method to bypass this problem. Also there's some security concerns.

      That which you do is you start your django fastcgi server inside a separate process after which configures apache via rewrites to refer to this as process if needed.

Or else you can:

  • Serve django without needing Apache however with another server that supports FastCGI natively:

    (The documentation mentions that can be done this without having any Apache specific needs. I suppose the main reason is always to save memory.)

    • Lighttpd

    This is actually the server that runs Youtube. It appears easily to make use of, however i have seen reviews on memoryleaks.

    • nginx

    I have seen benchmarks declaring this server is even faster than lighttpd. It's mainly recorded in russian though.

Another factor, du to restrictions in Python your server ought to be running in forked mode, note threaded.

Making this my current research, However i want more opinions and encounters.

As @Craig stated the documentation uses mod_python. I've not used Ubuntu like a server, but were built with a good knowledge about mod_wsgi on Solaris. You'll find documentation for mod_wsgi and Django about the mod_wsgi site.

A fast overview of your needs:

  • Simple to setup I have found apache 2.2 simple enough to construct and install.
  • Easily on assets I'd state that this is dependent in your usage and traffic. * You might not wish to server all files using Apache and employ LightTPD (lighty) to server static files.
  • Can serve media files I suppose you mean images, expensive files? Apache can perform this. Multiple sites on same server Virtual server website hosting on Apache.
  • Rather not install other extensions Comment out anything you wouldn't want within the Apache config.