Nadyrbek Sultanov
Nadyrbek Sultanov

Reputation: 153

Deploying Django project on Centos 8, using Gunicorn, Nginx (Gunicorn.service problem)

I followed this tutorial

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-centos-7

  1. Tried to deploy Django project on centos 8
  2. Everything went fine and worked, except gunicorn.service
    [Unit]
    Description=gunicorn daemon
    After=network.target
        
    [Service]
    User=facealatoo
    Group=nginx
    WorkingDirectory=/home/facealatoo/nadyr/promed
    ExecStart=/home/facealatoo/nadyr/promed/venv/bin/gunicorn \ 
        --workers 3 \
        --bind unix:/home/facealatoo/nadyr/promed/promed.sock \
        configs.wsgi:application

    [Install]
    WantedBy=multi-user.target

  1. Folders destinations

  2. my project folder destination '/home/facealatoo/nadyr/promed' settings.py file 'home/facealatoo/nadyr/promed/configs/settings.py'
  3. server user name 'facealatoo'
  4. after running
    sudo systemctl daemon-reload
    sudo systemctl start gunicorn
    sudo systemctl enable gunicorn
    sudo systemctl status gunicorn.service  

Error message

    ● gunicorn.service - gunicorn daemon
    Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor 
    preset: disabled)
    Active: failed (Result: exit-code) since Fri 2020-05-15 18:37:22 +06; 13s 
    ago
    Main PID: 32293 (code=exited, status=203/EXEC)
        
    May 15 18:37:22 facealatoo.net.kg systemd[1]: Started gunicorn daemon.
    May 15 18:37:22 facealatoo.net.kg systemd[1]: gunicorn.service: Main 
    process exited, code=exited, status=203/EXEC
    May 15 18:37:22 facealatoo.net.kg systemd[1]: gunicorn.service: Failed 
    with result 'exit-code'.

Please help me! ;) Thanks in advance ))))

Upvotes: 1

Views: 2275

Answers (1)

Nadyrbek Sultanov
Nadyrbek Sultanov

Reputation: 153

I just change socket file destination (home/facealatoo(user)/) and gunicorn destination (usr/local/bin/gunicorn). And these actions solved my problem)))

Upvotes: 3

Related Questions