502 Bad Gateway nginx/1.14.0 (Ubuntu) Django - django

Well I've depoloyed my Django application on DigitalOcean, and used domain which I bought. Now instead of default application page it shows 502 Bad Gateway
nginx/1.14.0 (Ubuntu). And nginx errors log returns such error:
*4 connect() to unix:/home/username/project.sock failed (111: Connection refused) while connecting to upstream, client: 82.194.22.116, server: challenge.com, request: "GET / HTTP/1.1", upstream: "http://unix:/home/username/project.sock:/", host: "challenge.com"
my nginx configurations:
server {
listen 80;
server_name challenge.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/username;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/username/ccproject.sock;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $server_name;
}
}
my settings in ``settings.py```:
ALLOWED_HOSTS = ['64.225.1.249', 'challenge.com']
And my socket file is in /home/username/
gunicorn status:
(env) progbash#challengers:~/ccproject$ sudo systemctl status gunicorn
● gunicorn.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2019-12-12 10:27:02 UTC; 1min 56s ago
Process: 29262 ExecStart=/home/username/ccproject/env/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/username/ccproject.sock
Main PID: 29262 (code=exited, status=1/FAILURE)
Dec 12 10:26:57 challenge systemd[1]: Started gunicorn daemon.
Dec 12 10:26:57 challenge gunicorn[29262]: [2019-12-12 10:26:57 +0000] [29262] [INFO] Starting gunicorn 20.0.4
Dec 12 10:26:57 challengers gunicorn[29262]: [2019-12-12 10:26:57 +0000] [29262] [ERROR] Retrying in 1 second.
Dec 12 10:26:58 challenge gunicorn[29262]: [2019-12-12 10:26:58 +0000] [29262] [ERROR] Retrying in 1 second.
Dec 12 10:26:59 challengers gunicorn[29262]: [2019-12-12 10:26:59 +0000] [29262] [ERROR] Retrying in 1 second.
Dec 12 10:27:00 challenge gunicorn[29262]: [2019-12-12 10:27:00 +0000] [29262] [ERROR] Retrying in 1 second.
Dec 12 10:27:01 challenge gunicorn[29262]: [2019-12-12 10:27:01 +0000] [29262] [ERROR] Retrying in 1 second.
Dec 12 10:27:02 challenge gunicorn[29262]: [2019-12-12 10:27:02 +0000] [29262] [ERROR] Can't connect to /home/username/ccproject.sock
Dec 12 10:27:02 challenge systemd[1]: gunicorn.service: Main process exited, code=exited, status=1/FAILURE
Dec 12 10:27:02 challenge systemd[1]: gunicorn.service: Failed with result 'exit-code'.

How did your unix socket came to life? Do you have /etc/systemd/system/gunicorn.socket script as per here: https://docs.gunicorn.org/en/stable/deploy.html

Related

Nginx 502 bad gateway error when deploying django; (13: Permission denied) while connecting to upstream

I'm trying to set up a VPS Django server with nginx, however, I'm running into a 502 Bad Gateway error when I reload the nginx server with the following settings:
sudo nano /etc/nginx/sites-available/project
server {
listen 80;
server_name domainname.com;
location = /favicon.ico {
access_log off;
log_not_found off;
}
location /static/ {
root /home/ubuntu/Slide-Hackers-Web/src/static;
}
location /media/ {
root /home/ubuntu/Slide-Hackers-Web/src/static;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/ubuntu/Slide-Hackers-Web/src/project.sock;
}
}
I execute the commands in this order
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
sudo ln -sf /etc/nginx/sites-available/project /etc/nginx/sites-enabled
sudo systemctl restart nginx
sudo ufw allow 'Nginx Full'
If I exclude domainname.com from the server_name, then it responds with the classic "Welcome to nginx!" page, however, if I leave it, it responds with "502 Bad Gateway
nginx/1.18.0 (Ubuntu)".
I'm clueless as to what I'm supposed to do, any help?
sudo tail -f /var/log/nginx/error.log
2021/08/17 14:44:42 [crit] 45521#45521: *4 connect() to unix:/home/ubuntu/Slide-Hackers-Web/src/project.sock failed (13: Permission denied) while connecting to upstream, client: (CLIENTHOST), server: (SERVERHOST), request: "GET / HTTP/1.1", upstream: "http://unix:/home/ubuntu/Slide-Hackers-Web/src/project.sock:/", host: "(DOMAINNAME).com"
EDIT
gunicorn.service
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=ubuntu
Group=www-data
WorkingDirectory=/home/ubuntu/Slide-Hackers-Web/src
ExecStart=/home/ubuntu/Slide-Hackers-Web/env/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/ubuntu/Slide-Hackers-Web/src/project.sock project.wsgi:application
[Install]
WantedBy=multi-user.target
Status of both active services:
nginx:
ubuntu#vps-bdd44ecc:~$ sudo systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2021-08-17 14:13:08 UTC; 9s ago
Docs: man:nginx(8)
Process: 44170 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Process: 44181 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
Main PID: 44186 (nginx)
Tasks: 2 (limit: 2272)
Memory: 4.2M
CGroup: /system.slice/nginx.service
├─44186 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
└─44187 nginx: worker process
gunicorn:
ubuntu#vps-bdd44ecc:~$ sudo systemctl status gunicorn
● gunicorn.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2021-08-17 14:13:08 UTC; 16s ago
Main PID: 44192 (gunicorn)
Tasks: 4 (limit: 2272)
Memory: 91.7M
CGroup: /system.slice/gunicorn.service
├─44192 /home/ubuntu/Slide-Hackers-Web/env/bin/python /home/ubuntu/Slide-Hackers-Web/env/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/ubuntu/Slide-Hackers-Web/src/project.sock project.wsgi:application
├─44221 /home/ubuntu/Slide-Hackers-Web/env/bin/python /home/ubuntu/Slide-Hackers-Web/env/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/ubuntu/Slide-Hackers-Web/src/project.sock project.wsgi:application
├─44225 /home/ubuntu/Slide-Hackers-Web/env/bin/python /home/ubuntu/Slide-Hackers-Web/env/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/ubuntu/Slide-Hackers-Web/src/project.sock project.wsgi:application
└─44231 /home/ubuntu/Slide-Hackers-Web/env/bin/python /home/ubuntu/Slide-Hackers-Web/env/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/ubuntu/Slide-Hackers-Web/src/project.sock project.wsgi:application
Aug 17 14:13:08 vps-bdd44ecc gunicorn[31290]: [2021-08-17 14:13:08 +0000] [31290] [INFO] Shutting down: Master
Aug 17 14:13:08 vps-bdd44ecc systemd[1]: gunicorn.service: Succeeded.
Aug 17 14:13:08 vps-bdd44ecc systemd[1]: Stopped gunicorn daemon.
Aug 17 14:13:08 vps-bdd44ecc systemd[1]: Started gunicorn daemon.
Aug 17 14:13:08 vps-bdd44ecc gunicorn[44192]: [2021-08-17 14:13:08 +0000] [44192] [INFO] Starting gunicorn 20.1.0
Aug 17 14:13:08 vps-bdd44ecc gunicorn[44192]: [2021-08-17 14:13:08 +0000] [44192] [INFO] Listening at: unix:/home/ubuntu/Slide-Hackers-Web/src/project.sock (44192)
Aug 17 14:13:08 vps-bdd44ecc gunicorn[44192]: [2021-08-17 14:13:08 +0000] [44192] [INFO] Using worker: sync
Aug 17 14:13:08 vps-bdd44ecc gunicorn[44221]: [2021-08-17 14:13:08 +0000] [44221] [INFO] Booting worker with pid: 44221
Aug 17 14:13:08 vps-bdd44ecc gunicorn[44225]: [2021-08-17 14:13:08 +0000] [44225] [INFO] Booting worker with pid: 44225
Aug 17 14:13:09 vps-bdd44ecc gunicorn[44231]: [2021-08-17 14:13:09 +0000] [44231] [INFO] Booting worker with pid: 44231
etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

Gunicorn/Nginx configuration for Django 2.2 gives 502 Bad gateway

I am getting bad gateway 502 error when I access the site. This is how my configuration looks like
/etc/nginx/sites-enabled/django
upstream app_server {
server unix:/home/django/gunicorn.socket fail_timeout=0;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 4G;
server_name _;
keepalive_timeout 5;
# Your Django project's media files - amend as required
location /media {
alias /home/django/my_project/current/my_project/media;
}
# your Django project's static files - amend as required
location /static {
alias /home/django/my_project/current/my_project/static;
}
# Proxy the static assests for the Django Admin panel
location /static/admin {
alias /usr/local/lib/python3.6/dist-packages/django/contrib/admin/static/admin/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://app_server;
}
}
/etc/systemd/system/gunicorn.service
[Unit]
Description=Gunicorn daemon for Django
Before=nginx.service
After=network.target
[Service]
WorkingDirectory=/home/django/my_project/current
ExecStart=/usr/bin/gunicorn3 --name=my_project --pythonpath=/home/django/my_project/current --bind unix:/home/my_project/gunicorn.socket --config /etc/gunicorn.d/gunicorn.py my_project.wsgi:application --log-file /var/log/gunicorn.log --log-level debug --workers=2
Restart=always
SyslogIdentifier=gunicorn
User=django
Group=django
[Install]
WantedBy=multi-user.target
When I run service gunicorn status, I can see this:
● gunicorn.service - Gunicorn daemon for Django
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2020-07-19 19:28:37 UTC; 7min ago
Process: 9373 ExecStart=/usr/bin/gunicorn3 --name=my_project --pythonpath=/home/django/my_project/current --bind unix:/home/django/gunicorn.socket --config /etc/gunicorn.d/gunicorn.py my_project.wsgi:application --log-file /var/log/gunicorn.l
Main PID: 9373 (code=exited, status=1/FAILURE)
Jul 19 19:28:37 admin-panel-s-2vcpu-4gb-fra1-01 systemd[1]: gunicorn.service: Service hold-off time over, scheduling restart.
Jul 19 19:28:37 admin-panel-s-2vcpu-4gb-fra1-01 systemd[1]: gunicorn.service: Scheduled restart job, restart counter is at 5.
Jul 19 19:28:37 admin-panel-s-2vcpu-4gb-fra1-01 systemd[1]: Stopped Gunicorn daemon for Django.
Jul 19 19:28:37 admin-panel-s-2vcpu-4gb-fra1-01 systemd[1]: gunicorn.service: Start request repeated too quickly.
Jul 19 19:28:37 admin-panel-s-2vcpu-4gb-fra1-01 systemd[1]: gunicorn.service: Failed with result 'exit-code'.
Jul 19 19:28:37 admin-panel-s-2vcpu-4gb-fra1-01 systemd[1]: Failed to start Gunicorn daemon for Django.
And I can see in the nginx error log:
2020/07/19 19:26:00 [crit] 9039#9039: *15 connect() to unix:/home/django/gunicorn.socket failed (2: No such file or directory) while connecting to upstream, client: 84.48.191.11, server: _, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/gunicorn.socket:/", host: "161.35.197.193"
Any advice? I looked into similar questions, but I was not able to resolve my problem.
It seems like I had an error 502 because it couldn't open database. I have found more information about it in Gunicorn log.

Can't connect to /home/ubuntu/env/Project/Project.sock

Am trying to host a we application using gunicorn and nginx. But I cant start the gunicorn service. everytime am getting the error message.
This is the error am getting
(env) root#ip-172-31-21-54:/home/env# sudo systemctl status gunicorn
● gunicorn.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2018-12-17 14:59:42 UTC; 488ms ago
Process: 14160 ExecStart=/home/ubuntu/env/bin/gunicorn --access-logfile - --
workers 3 --bind unix:/home/ubuntu/env/Project/Project.sock
Project.wsgi:application (code=exited, status=1/FAILURE)
Main PID: 14160 (code=exited, status=1/FAILURE)
Dec 17 14:59:36 ip-172-31-21-54 systemd[1]: Started gunicorn daemon.
Dec 17 14:59:37 ip-172-31-21-54 gunicorn[14160]: [2018-12-17 14:59:37 +0000]
[14160] [INFO] Starting gunicorn 19.9.0
Dec 17 14:59:37 ip-172-31-21-54 gunicorn[14160]: [2018-12-17 14:59:37 +0000]
[14160] [ERROR] Retrying in 1 second.
Dec 17 14:59:38 ip-172-31-21-54 gunicorn[14160]: [2018-12-17 14:59:38 +0000]
[14160] [ERROR] Retrying in 1 second.
Dec 17 14:59:39 ip-172-31-21-54 gunicorn[14160]: [2018-12-17 14:59:39 +0000]
[14160] [ERROR] Retrying in 1 second.
Dec 17 14:59:40 ip-172-31-21-54 gunicorn[14160]: [2018-12-17 14:59:40 +0000]
[14160] [ERROR] Retrying in 1 second.
Dec 17 14:59:41 ip-172-31-21-54 gunicorn[14160]: [2018-12-17 14:59:41 +0000] [14160] [ERROR] Retrying in 1 second.
Dec 17 14:59:42 ip-172-31-21-54 gunicorn[14160]: [2018-12-17 14:59:42 +0000] [14160] [ERROR] Can't connect to /home/ubuntu/env/Project/Project.sock
Dec 17 14:59:42 ip-172-31-21-54 systemd[1]: gunicorn.service: Main process exited, code=exited, status=1/FAILURE
Dec 17 14:59:42 ip-172-31-21-54 systemd[1]: gunicorn.service: Failed with result 'exit-code'.
And My gunicorn.service file is
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=ubuntu
Group=www-data
WorkingDirectory=/home/ubuntu/env/Project
ExecStart=/home/ubuntu/env/bin/gunicorn --access-logfile -
--workers 3 --bind unix:/home/ubuntu/env/Project/Project.sock
Project.wsgi:application
[Install]
WantedBy=multi-user.target
I cant find the error.. Please help me to solve this.

Deploying Django, Gunicorn, Nginx, Virtualenv on Digital ocean gives me 502 Bad Gateway & Gunicorn can't read Secret Key

I've been trying to deploy for 2 days now and It seems like I can't get it to work even though I went through many articles, StackOverflow questions, and Digital Ocean Tutorials.
My main tutorial is this one: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04?comment=47694#create-and-configure-a-new-django-project
when I bind my gunicorn file (see command below) and go to my_ip_address:8001 everything works fine
gunicorn --bind 0.0.0.0:8001 vp.wsgi:application
But at the part where I created and edited my gunicorn.service file:
sudo nano /etc/systemd/system/gunicorn.service
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=tony
Group=www-data
WorkingDirectory=/home/tony/vp/vp/
ExecStart=/home/tony/vp/vpenv/bin/gunicorn --workers 3 --bind unix:/home/tony/vp/vp/vp.sock vp.wsgi:application
[Install]
WantedBy=multi-user.target
And my nginx file (I replaced my ip address with my_ip_address for privacy)
sudo nano /etc/nginx/sites-available/vp
server {
listen 80;
server_name my_ip_address;
location = /facivon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/tony/vp;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/tony/vp/vp/vp.sock;
}
}
I get a bad gateway 502 error.
Even after reloading everything:
(vpenv) ~/vp/vp$ sudo systemctl daemon-reload
(vpenv) ~/vp/vp$ sudo systemctl start gunicorn
(vpenv) ~/vp/vp$ sudo systemctl enable gunicorn
(vpenv) ~/vp/vp$ sudo systemctl restart nginx
So I checked the status of gunicorn:
(vpenv) ~/vp/vp$ sudo systemctl status gunicorn
And get the error:
gunicorn.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2017-04-23 13:41:09 UTC; 18s ago
Main PID: 15438 (code=exited, status=3)
Apr 23 13:41:09 vp-first gunicorn[15438]: SECRET_KEY = os.environ["VP_SECRET_KEY"]
Apr 23 13:41:09 vp-first gunicorn[15438]: File "/home/tony/vp/vpenv/lib/python3.5/os.py", line 7
Apr 23 13:41:09 vp-first gunicorn[15438]: raise KeyError(key) from None
Apr 23 13:41:09 vp-first gunicorn[15438]: KeyError: 'VP_SECRET_KEY'
Apr 23 13:41:09 vp-first gunicorn[15438]: [2017-04-23 13:41:09 +0000] [15445] [INFO] Worker exitin
Apr 23 13:41:09 vp-first gunicorn[15438]: [2017-04-23 13:41:09 +0000] [15438] [INFO] Shutting down
Apr 23 13:41:09 vp-first gunicorn[15438]: [2017-04-23 13:41:09 +0000] [15438] [INFO] Reason: Worke
Apr 23 13:41:09 vp-first systemd[1]: gunicorn.service: Main process exited, code=exited, status=3/
Apr 23 13:41:09 vp-first systemd[1]: gunicorn.service: Unit entered failed state.
Apr 23 13:41:09 vp-first systemd[1]: gunicorn.service: Failed with result 'exit-code'.
^X
I have placed my Secret Key in both ~./bashrc (and did source ~./bashrc), and in my virtualenv activate file (and did source vpenv/bin/activate).
The .sock file is nowhere to be found!
Some notes:
Before, I was getting an other error that gunicorn could not boot and my gunicorn and nginx config paths looked like this:
Gunicorn:
WorkingDirectory=/home/tony/vp/
ExecStart=/home/tony/vp/vpenv/bin/gunicorn --workers 3 --bind unix:/home/tony/vp/vp.sock vp.wsgi:application
Nginx:
location / {
include proxy_params;
proxy_pass http://unix:/home/tony/vp/vp.sock;
}
As you can see the paths were vp/vp.sock not vp/vp/vp.sock as they are now.
When I do:
$ ps -aux | grep gunicorn
I get:
tony 15624 0.0 0.1 12944 976 pts/3 S+ 13:57 0:00 grep --color=auto gunicorn
Which means there is an error.
my nginx error log file:
2017/04/23 13:41:19 [crit] 15491#15491: *2 connect() to unix:/home/tony/vp/vp/vp.sock failed (2: No such file or directory) while connecting to upstream, client: Client.IP, server: Server.IP, request: "GET / HTTP/1.1", upstream: "http://unix:/home/tony/vp/vp/vp.sock:/", host: "Server.IP"
2017/04/23 13:41:19 [crit] 15491#15491: *2 connect() to unix:/home/tony/vp/vp/vp.sock failed (2: No such file or directory) while connecting to upstream, client: Client.IP, server: Server.IP, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/home/tony/vp/vp/vp.sock:/favicon.ico", host: "Server.IP", referrer: "http://Server.IP/"
Here is my wsgi.py file:
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
application = get_wsgi_application()
And yes I use multiple settings files.
I have to say that this is my first time deploying but I do my best to understand everything.
Hope you can help!!!
The new user I created did not have permission to access .bashrc
What I did was I placed my environment variables inside my gunicorn.service file like this:
[Service]
Environment=VP_SECRET_KEY=<value>
restarted everything:
sudo systemctl daemon-reload
sudo systemctl start gunicorn
sudo systemctl enable gunicorn
sudo systemctl restart nginx
And done!

NGINX--Connect to UNIX sock failed

Checked out a few other similar issues here, but can't diagnose the issue.
My site has been occasionally going down with a 502 Bad Gateway Error.
I found the following in my error log. Note i'm using a VPS server on Ubuntu 16.04 using Gunicorn/NGINX.
2017/02/21 01:08:29 [crit] 1247#1247: *1 connect() to unix:/home/django/chrisblog/chrisblog.sock failed (2: No such file or directory) while connecting to upstream, client: 173.48.32.62, server: 45.32.201.31, request: "GET /redditclone/ HTTP/1.1", upstream: "http://unix:/home/django/chrisblog/chrisblog.sock:/redditclone/", host: "pythoncreate.com"
2017/02/21 01:10:36 [crit] 1575#1575: *1 connect() to unix:/home/django/chrisblog/chrisblog.sock failed (2: No such file or directory) while connecting to upstream, client: 173.48.32.62, server: 45.32.201.31, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/chrisblog/chrisblog.sock:/", host: "pythoncreate.com"
2017/02/21 01:48:04 [crit] 2342#2342: *2 connect() to unix:/home/django/chrisblog/chrisblog.sock failed (2: No such file or directory) while connecting to upstream, client: 173.48.32.62, server: 45.32.201.31, request: "GET / HTTP/1.1", upstream: "http://unix:/home/django/chrisblog/chrisblog.sock:/", host: "pythoncreate.com"
When i go to check the gunicorn status i get the following so it looks like maybe it is failing for some reason?:
gunicorn.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2017-02-21 01:46:08 UTC; 7min ago
Main PID: 2245 (code=exited, status=203/EXEC)
Feb 21 01:46:08 mydjangoblog systemd[1]: Started gunicorn daemon.
Feb 21 01:46:08 mydjangoblog systemd[1]: gunicorn.service: Main process exited, code=exited, status=203/EXEC
Feb 21 01:46:08 mydjangoblog systemd[1]: gunicorn.service: Unit entered failed state.
Feb 21 01:46:08 mydjangoblog systemd[1]: gunicorn.service: Failed with result 'exit-code'.
And here is a shot of output of ps aux | grep nginx
root 2341 0.0 0.1 125104 1480 ? Ss 01:47 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 2342 0.0 0.4 125444 3152 ? S 01:47 0:00 nginx: worker process
django 2461 0.0 0.2 16576 2000 pts/0 S+ 01:57 0:00 grep --color=auto nginx
any help here is hugely appreciated
You just need to check whether "/home/django/chrisblog/chrisblog.sock" exists.