● gunicorn.service - gunicorn daemon
Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2023-08-13 06:43:31 UTC; 2min 36s ago
Main PID: 4607 (gunicorn)
Tasks: 4 (limit: 9553)
Memory: 101.7M
CPU: 539ms
CGroup: /system.slice/gunicorn.service
├─4607 /home/pcmcom/paymall_backend/env/bin/python3 /home/pcmcom/paymall_backend/env/bin/gunicorn --env DJANGO_SETTINGS_MODULE=paymall_backend.settings.prod --access-logfile /home/pcmcom/paymall_backend/logs/gunicorn.log --workers 3 --bind 127.0.0.1:8000 paymall_backend.wsgi:application
├─4608 /home/pcmcom/paymall_backend/env/bin/python3 /home/pcmcom/paymall_backend/env/bin/gunicorn --env DJANGO_SETTINGS_MODULE=paymall_backend.settings.prod --access-logfile /home/pcmcom/paymall_backend/logs/gunicorn.log --workers 3 --bind 127.0.0.1:8000 paymall_backend.wsgi:application
├─4609 /home/pcmcom/paymall_backend/env/bin/python3 /home/pcmcom/paymall_backend/env/bin/gunicorn --env DJANGO_SETTINGS_MODULE=paymall_backend.settings.prod --access-logfile /home/pcmcom/paymall_backend/logs/gunicorn.log --workers 3 --bind 127.0.0.1:8000 paymall_backend.wsgi:application
└─4610 /home/pcmcom/paymall_backend/env/bin/python3 /home/pcmcom/paymall_backend/env/bin/gunicorn --env DJANGO_SETTINGS_MODULE=paymall_backend.settings.prod --access-logfile /home/pcmcom/paymall_backend/logs/gunicorn.log --workers 3 --bind 127.0.0.1:8000 paymall_backend.wsgi:application
Aug 13 06:43:31 pcm-server systemd[1]: Started gunicorn daemon.
Aug 13 06:43:31 pcm-server gunicorn[4607]: [2023-08-13 06:43:31 +0000] [4607] [INFO] Starting gunicorn 21.2.0
Aug 13 06:43:31 pcm-server gunicorn[4607]: [2023-08-13 06:43:31 +0000] [4607] [INFO] Listening at: http://127.0.0.1:8000 (4607)
Aug 13 06:43:31 pcm-server gunicorn[4607]: [2023-08-13 06:43:31 +0000] [4607] [INFO] Using worker: sync``` the ``gunicorn .service`` file
#No ``.sock`` file even though gunicorn is running
15 messages · Page 1 of 1 (latest)
the gunicorn service file
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=pcmcom
Group=www-data
WorkingDirectory=/home/pcmcom/paymall_backend
ExecStart=/home/pcmcom/paymall_backend/env/bin/gunicorn \
--env DJANGO_SETTINGS_MODULE='paymall_backend.settings.prod' \
--access-logfile /home/pcmcom/paymall_backend/logs/gunicorn.log \
--workers 3 --bind 127.0.0.1:8000 paymall_backend.wsgi:application
[Install]
WantedBy=multi-user.target```
It's been a while since I used systemd to deploy, but the last time I did, I wrote my own socket file. This tutorial is pretty solid:
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-22-04
Why do you think there should be a sock file?
i was reading a blog there was mentioned that there has to be a socket file. later find out that the there is no need because here binding a ip only. The blog is not updated so i got worried.
It's common practice to proxy_pass nginx to the socket file rather than the loopback address.
Though both should work more or less the same.
ip is working now
i added ssl too
fisrt when tried to create ssl then gone dns problem but it is resolved
now website redirect to https://
Yes, if you bind to IP, it will use TCP
You can bind to unix socket, than it will create a sock file
unix socket should be somewhat faster, but you need to get permissions right
i don't know why the blog mentioned the sock file even though their example also use ip address