Setting up tg application on nginx + virtualenv + paste server + uwsgi

162 views
Skip to first unread message

jeetu

unread,
Sep 2, 2012, 1:12:46 PM9/2/12
to turbo...@googlegroups.com
I am going to setup tg using nginx in virtualenv and uwsgi. So setup is going to be like:

# Become su
sudo su

# The main dir for hosting and virtualenvs
mkdir /web

# Create venv dir for all virtualenvs
mkdir /web/venv

# create virtualenv for tg
mkdir /web/venv/tg22_venv
source /web/venv_tg22_venv/bin/activate
easy_install -i http://tg.gy/220 tg.devtools

# create app directory for all web based applications
mkdir /web/venv/apps

# clone your developed tg application inside apps to /web/venv/apps/tgapp
hg clone <your developed app> <hosted app tgapp>

I will be using nginx web server and uwsgi. I know how to configure them so that they run the tgapp's built in paster server
nginx -> uwsgi -> paste server.
The question is what should be the permission set on the /web and subsequent directories for security reasons etc..
Is "chown www-data:www-data -R /web" will be enough?


Carlos Daniel Ruvalcaba Valenzuela

unread,
Sep 2, 2012, 2:11:23 PM9/2/12
to turbo...@googlegroups.com
> The question is what should be the permission set on the /web and subsequent
> directories for security reasons etc..
> Is "chown www-data:www-data -R /web" will be enough?

Yes, it should be enough and it is a good idea, you'll want to have
nginx serve your static files directly thus the project directory
owner or group should be something that allows nginx to access it.

Regards,
Carlos Daniel Ruvalcaba Valenzuela

Mengu

unread,
Sep 2, 2012, 3:23:35 PM9/2/12
to turbo...@googlegroups.com
hi jeetu

you don't have to run paste server. nginx > uwsgi will do enough. you can read my blog post on how to deploy a tg 2 application with nginx & uwsgi at http://www.mengu.net/post/deploying-turbogears-21-application-with-nginx-and-uwsgi

also, let us know about the app when you deploy so we add it to tg powered apps list. :)

best of luck.
Reply all
Reply to author
Forward
0 new messages