#No ``.sock`` file even though gunicorn is running

15 messages · Page 1 of 1 (latest)

vocal dove
#
● 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
#

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```
severe ermine
coarse tangle
vocal dove
severe ermine
#

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.

vocal dove
#

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://

coarse tangle
#

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

vocal dove
#

i don't know why the blog mentioned the sock file even though their example also use ip address