2008/08/04

Hosting Muliple Site Django under Nginx with WSGI

My site is very small and the hosting provider have strict limit on memory. I compile the Nginx like this:

./configure --prefix=$HOME/nginx_build --with-cpu-opt=pentium4 --add-module=./mod_wsgi --without-http_autoindex_module --without-http_auth_basic_module --without-http_charset_module --without-http_ssi_module --without-http_geo_module --without-http_map_module --without-http_proxy_module --without-http_memcached_module --without-http_rewrite_module --without-http_referer_module --without-http_upstream_ip_hash_module --without-http_browser_module --without-http_limit_zone_module --without-http_empty_gif_module --conf-path=$HOME/conf/nginx.conf

The most important thing that host Django by mod_WSGI is
add
wsgi_use_main_interpreter off;
wsgi_enable_subinterpreters on;
to your conf file. Mod_wsgi need to create distinct sub interpreters.

No comments: