startup.sh 582 Bytes
Newer Older
1
2
#!/bin/bash

3
4
5
6
cd /var/www/wsm.rest
mkdir logs
echo "Launching Gunicorn..."
nohup /usr/local/bin/gunicorn wsgi:app --workers 3 --bind unix:wsm.rest.sock -m 007 </dev/null >logs/gunicorn.log 2>&1 &
7

8
echo "Setting up nginx config."
9
rm /etc/nginx/sites-enabled/default
10
11
12
13
cp /var/www/wsm.rest/configs/wsm.rest.nginx /etc/nginx/sites-enabled/wsm.rest

echo "Launching nginx..."
nohup nginx </dev/null >logs/nginx.log 2>&1 &
14

15
16
17
18
19
# Wait a little for Gunicorn to set up
sleep 2

echo "Fixing access to socket."
chown www-data:www-data /var/www/wsm.rest/wsm.rest.sock
20

21
echo "All done. Good to go!"