Permission Denied for Gunicorn

190 Views Asked by At

I in the middle of deploying a django apps in linode. I am new to this so I just follow tutorial from digital ocean. Link here

When I tried to check gunicorn status with this

sudo systemctl status gunicorn

It will show this error

Aug 07 08:29:53 localhost systemd[1]: Started gunicorn daemon.
Aug 07 08:29:53 localhost systemd[50433]: gunicorn.service: Failed to execute /home/sammy/luzern_hikvision/myprojectenv/bin/gunicorn: Permission denied
Aug 07 08:29:53 localhost systemd[50433]: gunicorn.service: Failed at step EXEC spawning /home/sammy/luzern_hikvision/myprojectenv/bin/gunicorn: Permission denied
Aug 07 08:29:53 localhost systemd[1]: gunicorn.service: Main process exited, code=exited, status=203/EXEC
Aug 07 08:29:53 localhost systemd[1]: gunicorn.service: Failed with result 'exit-code'.

My gunicorn.service file have this

[Unit]
Description=gunicorn daemon
After=network.target

[Service]
User=sammy
Group=sammy
WorkingDirectory=/home/sammy/luzern_hikvision
ExecStart=/home/sammy/luzern_hikvision/myprojectenv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/run/gunicorn.sock luzern_vms.wsgi:application

[Install]
WantedBy=multi-user.target

I did run chown -R sammy:sammy /home/sammy

but still won't work.

If I run ls -lah , I will get this

total 36K
drwxr-x---  5 sammy sammy 4.0K Aug  7 05:53 .
drwxr-xr-x  3 root  root  4.0K Aug  7 05:30 ..
-rw-------  1 sammy sammy 1.2K Aug  7 06:57 .bash_history
-rw-r--r--  1 sammy sammy  220 Aug  7 05:30 .bash_logout
-rw-r--r--  1 sammy sammy 3.8K Aug  7 05:53 .bashrc
drwx------  3 sammy sammy 4.0K Aug  7 05:51 .cache
drwxrwxr-x  5 sammy sammy 4.0K Aug  7 05:52 .local
drwxrwxr-x 11 sammy sammy 4.0K Aug  7 05:46 luzern_hikvision
-rw-r--r--  1 sammy sammy  807 Aug  7 05:30 .profile
-rw-r--r--  1 sammy sammy    0 Aug  7 05:36 .sudo_as_admin_successful

My end goal is to move on to the nginx setup so that I can attach my subdomain into the IP Address.Thank you so much in advance!

0

There are 0 best solutions below