Serve multiple wsgi application with nginx and uwsgi.
One site = one user, every site run on different user.
- nginx
- a web group, nginx have to run under it to serve static files
- python
- uwsgi core under /usr/bin
git clone https://github.com/unbit/uwsgi.git
cd uwsgi
git tag
git checkout tags/<tagname>
python uwsgiconfig.py --build core
python2 uwsgiconfig.py --plugin plugins/python core python2
python3 uwsgiconfig.py --plugin plugins/python core python3
Run ./scripts/setup.py
.
Generate nginx configuration ./scripts/make_nginx_conf.py
, the
configuration will be created in the current directory. Feel free to
update it, then add it to nginx/site-enabled, and be sure nginx run under
web group. Restart nginx.
Make an init script for uwsgi and activate it, there is an example for
sysvinit: ./uwsgi/init-deb.sh
.
You are ready to enjoy python-hosting !
- create a user 'newuser'
./manage.py newuser create
./manage.py newuser enable
./manage.py newuser disable
You may want to check if the folder struct and the permissions are well
set for the sites, just run the script ./scripts/check_environment.py
.