Yes, ofc.
Thanks to pbreit for his script.
I just added support for 443 port (SSL) and Postgres to it.
It installs web2py+nginx+uwsgi+postgres on ubuntu:

===================
apt-get update
apt-get -y upgrade
apt-get -y install build-essential psmisc python-dev libxml2 libxml2-
dev python-setuptools
adduser --system --no-create-home --disabled-login --disabled-password
--group uwsgi
apt-get -y install unzip
cd /opt/
wget http://web2py.com/examples/static/web2py_src.zip
unzip web2py_src.zip
chown -R uwsgi:uwsgi web2py
cd web2py
sudo -u uwsgi python -c "from gluon.widget import console; console();"
sudo -u uwsgi python -c "from gluon.main import save_password;
save_password(raw_input('admin password: '),443)"
cd /opt/
wget http://projects.unbit.it/downloads/uwsgi-0.9.6.8.tar.gz
tar -zxvf uwsgi*
mv uwsgi*/ uwsgi/
cd uwsgi/
python setup.py install
chown -R uwsgi:uwsgi /opt/uwsgi
touch /var/log/uwsgi.log
chown uwsgi /var/log/uwsgi.log
apt-get -y install libpcre3-dev build-essential libssl-dev
cd /opt/
wget http://nginx.org/download/nginx-0.8.54.tar.gz
tar -zxvf nginx-0.8.54.tar.gz
cd /opt/nginx-0.8.54/
./configure --prefix=/opt/nginx --user=nginx --group=nginx --with-
http_ssl_module
make
make install
adduser --system --no-create-home --disabled-login --disabled-password
--group nginx
cp /opt/uwsgi/nginx/uwsgi_params /opt/nginx/conf/uwsgi_params
wget 
https://library.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 start
cd /opt/
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
echo 'PYTHONPATH=/opt/web2py/
MODULE=wsgihandler' > /etc/default/uwsgi
/usr/sbin/update-rc.d -f uwsgi defaults
/etc/init.d/uwsgi start
echo 'user uwsgi;
worker_processes  4;
events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    client_max_body_size 100M;

    server {
        listen       80;
        server_name  "";
        location / {
            uwsgi_pass     127.0.0.1:9001;
            include        uwsgi_params;
        }
        location /static {
            root   /opt/web2py/applications/welcome/;
        }
    }
    server {
        listen       443;
        server_name  "";
        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 $scheme;
        }
        location /static {
            root   /opt/web2py/applications/welcome/;
        }
    }
}' > /opt/nginx/conf/nginx.conf

/etc/init.d/nginx restart

# get sertificates
cd /opt/nginx/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

#install PostgreSQL
sudo apt-get -y install postgresql
sudo apt-get -y install python-psycopg2

===================

take care with copy and paste it, because google break links and
newlines


On 27 мар, 21:16, Jose <[email protected]> wrote:
> On 27 mar, 06:54, LightOfMooN <[email protected]> wrote:
>
> > Yes, just tested it.
> > Many parallel downloads, nice speed, and no locks even more.
> > Nginx Rocks!
>
> Hello LightOfMooN,
>
> please, could show me how to configure nginx + + web2py uwsgi. I use
> uwsgi + cherokee + web2py and I had the same problems that you
> mentioned.
>
> Thank you very much.
>
> Jose

Reply via email to