How to deply web2py using nginx? -


) Is the recipe for preparing to use. There are some incomplete notes (like) around the web, but I did not find any complete, single links. So, I appreciate your help.

OK, the web is looking closer in the email 2py email list which I have written above, let me know The complicated solution has already been there. I can follow the instructions and, thanks to the great post of Pobritt, now my deployment works like a magic (using only 38MB of RAM in the idle state) nginx + uwsgi

Which I have used (I've stripped fabfile.py to use it on the command line) Note: Where 'put' ('....' is to use the nano text editor).

  apt-get -y build-essential psmisc python-de V libxml2 libxml2-dev python-setuptools cd / opt; wget http://projects.unbit.it/downloads install / -vastiter-tar.gz tar -zxvf uwsgi * mv / opt / uwsgi * / / opt / uwsgi / Cd / opt / uwsgi /; Python setup.py chown -r www-data: www-data / opt / Uwsgi touch /var/log/uwsgi.log chown www-data /var/log/uwsgi.log apt-get - Y install libpcre3-dev build-required libssl-dev cd / opt; wget http://nginx.org/ download / nginx-0.8.54.tar.gz cd / opt; tr-zxvf nginx * cd / opt / nginx * / ./configure --prefix = / opt / nginx - user = nginx --group = nginx - -with-http_ssl_module cd / opt / nginx * /; Create CD / Opt / NGNX / Adduser --system --no-create-home --disabled-login --disabled-password --group nginx cp / opt / uwsgi * / nginx / uwsgi_params / opt / nginx to create / create / Conf / uwsgi_params wget https: // l Ibrary.linode.com/web-servers/nginx/installation/reference/init-deb.sh mv init-deb.sh /etc/init.d/nginx chmod + x / etc /init.d/nginx/ usr/sbin/update-rc.d -f nginx defaults /etc/init.d/nginx cd / opt / start wget https://library.linode.com/web-servers/nginx / Python-uwsgi / reference / init-deb Sh mv /opt/init-deb.sh/etc/init.d/uwsgi chmod + x /etc/init.d/uwsgi eko 'pithonpath = / var / web2py / MODULE = Wsgihandler '& gt; & Gt; / Etc / default / uwsgi /usr/sbin/update-rc.d -f uwsgi defaults /etc/init.d/uwsgi start rm /opt/nginx/conf/nginx.conf # Modify nginx.conf below and make it look Save /opt/nginx/conf/nginx.conf CD / OPT / NGN / CONF; Openssl genrsa-out server.key 1024 cd / opt / nginx / conf; Openssl req -batch -new -key server.key -out server.csr cd / opt / nginx / conf; Openssl x509 -req -days 1780 -in server.csr -signkey server.key -out server.crt /etc/init.d/nginx restart   

nginx.conf

  User www-data; Worker_processes 4; Event {worker_connections 1024; } Http {include mime.types; Default_type application / octet-stream; Keepalive_timeout 2; Send file on; #tcp_nopush on; Tcp_nodelay on; Jeez; Server {80; Server_name example.com www.example.com; Location / {uwsgi_pass 127.0.0.1:9001; Include uwsgi_params; } Location / static {root / var / web2py / applications / init /; }} # HTTPS server server {443 Listen; Server_name www.example.com example.com; Ssl on; Ssl_certificate /opt/nginx/conf/server.crt; Ssl_certificate_key /opt/nginx/conf/server.key; Location / {uwsgi_pass 127.0.0.1:9001; Include uwsgi_params; Uwsgi_param UWSGI_SCHEME $ plan; } Location / static {root / var / web2py / applications / init /;   

Comments