Let's say you want to host domains first.com
and second.com
.
Create folders for their files:
#!/bin/bash | |
NAME="hello_app" # Name of the application | |
DJANGODIR=/webapps/hello_django/hello # Django project directory | |
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket | |
USER=hello # the user to run as | |
GROUP=webapps # the group to run as | |
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn | |
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use | |
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name |
#!/usr/bin/env python3 | |
''' | |
DEVELOPMENT SPONSORED BY | |
PANASONIC INFORMATION SYSTEMS COMPANY EUROPE | |
Interested in a job? Apply below: | |
https://application.job.panasonic.eu/data/ruP0pHQvHrGZJKvL/rc.php?nav=jobsearch&custval12=ite&lang=EN&custval11=PBSEU_GER | |
''' |
#!/bin/bash | |
### Set default parameters | |
# somewhat follows the conventions from: http://michal.karzynski.pl/blog/2013/10/29/serving-multiple-django-applications-with-nginx-gunicorn-supervisor/ | |
# designed to run on a debian symbiosis box if your interested why its /srv | |
action=$1 | |
domain=$2 | |
appname=$3 | |
owner=$(who am i | awk '{print $1}') | |
sitesEnable='/etc/nginx/sites-enabled/' | |
sitesAvailable='/etc/nginx/sites-available/' |