Hey guys
@anefta
Yes I’m using gunicorn. Both projects have service and socket files.
First project domestic_voicelogging:
Socket - gunicorn.socket
[Unit]
Description=gunicorn socket
[Socket]
ListenStream=/run/gunicorn.sock
SocketUser=marco
SocketGroup=www-data
SocketMode=0660
[Install]
WantedBy=sockets.target
Service - gunicorn.service
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
User=marco
Group=www-data
WorkingDirectory=/home/marco/domestic_voicelogging
ExecStart=/home/marco/domestic_voicelogging/venv/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
domestic_voicelogging.wsgi:application
[Install]
WantedBy=multi-user.target
Second project django_referral:
Socket - dajngo_referral.socket
[Unit]
Description=gunicorn socket for django_referral
[Socket]
ListenStream=/run/django_referral.sock
SocketUser=marco
SocketGroup=www-data
SocketMode=0660
[Install]
WantedBy=sockets.target
Service - django_referral.service
[Unit]
Description=gunicorn daemon for django_referral
Requires=django_referral.socket
After=network.target
[Service]
User=marco
Group=www-data
WorkingDirectory=/home/marco/django_referral
ExecStart=/home/marco/django_referral/venv/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/django_referral.sock \
django_referral.wsgi:application
[Install]
WantedBy=multi-user.target
i do think you might be on to something with the permission.
Here are the sock file permission:
[marco@mydjangoserver ~]$ ls -l /run/
total 28
drwxr-xr-x. 6 root root 120 Jul 8 09:49 NetworkManager
-rw-------. 1 root root 0 Jul 8 09:49 agetty.reload
-rw-r--r--. 1 root root 4 Jul 8 09:49 auditd.pid
drwxr-xr-x. 2 root root 80 Jul 8 09:49 blkid
drwxr-x---. 2 chrony chrony 80 Jul 8 09:49 chrony
drwxr-xr-x. 2 root root 40 Jul 8 09:49 chrony-dhcp
drwxr-xr-x. 2 root root 40 Jul 8 09:49 console
drwxr-xr-x. 5 root root 100 Sep 11 10:22 credentials
----------. 1 root root 0 Jul 8 09:49 cron.reboot
-rw-r--r--. 1 root root 4 Jul 8 09:49 crond.pid
drwx------. 2 root root 40 Jul 8 09:49 cryptsetup
drwxr-xr-x. 2 root root 60 Jul 8 09:49 dbus
srw-rw-rw-. 1 marco www-data 0 Sep 11 10:33 django_referral.sock
drwxr-xr-x. 2 root root 40 Jul 8 09:49 faillock
drwxr-x---. 2 root root 40 Jul 8 09:49 firewalld
drwxr-xr-x. 2 root root 60 Jul 8 09:48 fsck
srw-rw-rw-. 1 marco www-data 0 Jul 9 09:37 gunicorn.sock
prw-------. 1 root root 0 Jul 8 09:49 initctl
drwxr-xr-x. 4 root root 100 Jul 8 09:48 initramfs
drwxr-xr-x. 3 root root 80 Jul 8 09:49 lock
drwxr-xr-x. 3 root root 60 Jul 8 09:48 log
-rw-r--r--. 1 root root 0 Jul 8 09:49 motd
drwxr-xr-x. 2 root root 40 Jul 8 09:49 motd.d
drwxr-xr-x. 2 root root 40 Jul 8 09:48 mount
-rw-r--r--. 1 root root 8 Sep 11 14:08 nginx.pid
drwxr-xr-x. 2 postgres postgres 80 Jul 24 11:20 postgresql
-rw-------. 1 root root 25 Jul 8 09:49 qga.state
-rw-------. 1 root root 3 Jul 8 09:49 rsyslogd.pid
drwxr-xr-x. 2 root root 40 Jul 8 09:49 sepermit
drwxr-xr-x. 2 root root 40 Jul 8 09:49 setrans
-rw-r--r--. 1 root root 6 Jul 10 15:04 sshd.pid
drwx--x--x. 3 root root 60 Jul 8 09:49 sudo
drwxr-xr-x. 21 root root 540 Sep 11 11:52 systemd
drwxr-xr-x. 2 root root 60 Jul 8 09:48 tmpfiles.d
drwxr-xr-x. 3 root root 60 Jul 8 09:49 tpm2-tss
drwxr-xr-x. 6 root root 140 Jul 8 11:01 udev
drwxr-xr-x. 3 root root 60 Sep 11 13:37 user
-rw-rw-r--. 1 root utmp 2304 Sep 11 14:18 utmp
this was the permission i kind of remeber using for the first project:
sudo chown -R marco:www-data domestic_voicelogging
sudo chmod -R 755 domestic_voicelogging
sudo chmod +x domestic_voicelogging/manage.py
sudo chown -R marco:www-data domestic_voicelogging/venv
sudo chmod -R 755 domestic_voicelogging/venv
@KenWhitesell
I don’t really know what i did with the rewrite i got it from the internet.
To be honest im not really sure what the problem is exactly but the nginx test is successful and the gunicorn service and socket all run adn are active. i tried just serving/deploy the second project and it works but the css isnt loading. To answer you No, i can not search the ccs file name in the search.
this is waht im trying to deploy just the 2de one and it is working but the css is loading:
server {
listen 80;
server_name 41.76.110.165;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/marco/django_referral/staticfiles/;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/django_referral.sock;
}
}
when i check this log:
sudo tail -f /var/log/nginx/error.log
this is the error:
(venv) [marco@mydjangoserver django_referral]$ sudo tail -f /var/log/nginx/error.log
2024/09/11 13:52:23 [error] 1418239#1418239: *5 open() "/home/marco/django_referral/staticfiles/static/images/LogoText.50a448bb095a.png" failed (13: Permission denied), client: 105.245.232.98, server: 41.76.110.165, request: "GET /static/images/LogoText.50a448bb095a.png HTTP/1.1", host: "41.76.110.165", referrer: "http://41.76.110.165/djangoprogram/login/"
2024/09/11 13:52:23 [error] 1418239#1418239: *3 open() "/home/marco/django_referral/staticfiles/static/images/LogoS.bd2ae9c34de7.png" failed (13: Permission denied), client: 105.245.232.98, server: 41.76.110.165, request: "GET /static/images/LogoS.bd2ae9c34de7.png HTTP/1.1", host: "41.76.110.165", referrer: "http://41.76.110.165/djangoprogram/login/"
2024/09/11 14:00:03 [error] 1418422#1418422: *1 open() "/home/marco/django_referral/staticfiles/static/CSS/loginStyle.9b8774737cdc.css" failed (13: Permission denied), client: 105.245.232.98, server: 41.76.110.165, request: "GET /static/CSS/loginStyle.9b8774737cdc.css HTTP/1.1", host: "41.76.110.165", referrer: "http://41.76.110.165/djangoprogram/login/"
2024/09/11 14:00:07 [error] 1418422#1418422: *3 open() "/home/marco/django_referral/staticfiles/static/images/LogoText.50a448bb095a.png" failed (13: Permission denied), client: 105.245.232.98, server: 41.76.110.165, request: "GET /static/images/LogoText.50a448bb095a.png HTTP/1.1", host: "41.76.110.165", referrer: "http://41.76.110.165/djangoprogram/login/"
2024/09/11 14:07:57 [error] 1418630#1418630: *3 open() "/home/marco/django_referral/staticfiles/static/CSS/loginStyle.9b8774737cdc.css" failed (13: Permission denied), client: 105.245.232.98, server: 41.76.110.165, request: "GET /static/CSS/loginStyle.9b8774737cdc.css HTTP/1.1", host: "41.76.110.165", referrer: "http://41.76.110.165/djangoprogram/login/"
2024/09/11 14:08:02 [error] 1418630#1418630: *1 open() "/home/marco/django_referral/staticfiles/static/images/LogoText.50a448bb095a.png" failed (13: Permission denied), client: 105.245.232.98, server: 41.76.110.165, request: "GET /static/images/LogoText.50a448bb095a.png HTTP/1.1", host: "41.76.110.165", referrer: "http://41.76.110.165/djangoprogram/login/"
2024/09/11 14:08:03 [error] 1418630#1418630: *3 open() "/home/marco/django_referral/staticfiles/static/images/LogoS.bd2ae9c34de7.png" failed (13: Permission denied), client: 105.245.232.98, server: 41.76.110.165, request: "GET /static/images/LogoS.bd2ae9c34de7.png HTTP/1.1", host: "41.76.110.165", referrer: "http://41.76.110.165/djangoprogram/login/"
2024/09/11 14:17:34 [error] 1418653#1418653: *6 open() "/home/marco/django_referral/staticfiles/static/CSS/loginStyle.9b8774737cdc.css" failed (13: Permission denied), client: 105.245.236.240, server: 41.76.110.165, request: "GET /static/CSS/loginStyle.9b8774737cdc.css HTTP/1.1", host: "41.76.110.165", referrer: "http://41.76.110.165/djangoprogram/login/"
2024/09/11 14:17:35 [error] 1418653#1418653: *6 open() "/home/marco/django_referral/staticfiles/static/images/LogoText.50a448bb095a.png" failed (13: Permission denied), client: 105.245.236.240, server: 41.76.110.165, request: "GET /static/images/LogoText.50a448bb095a.png HTTP/1.1", host: "41.76.110.165", referrer: "http://41.76.110.165/djangoprogram/login/"
2024/09/11 14:17:35 [error] 1418653#1418653: *8 open() "/home/marco/django_referral/staticfiles/static/images/LogoS.bd2ae9c34de7.png" failed (13: Permission denied), client: 105.245.236.240, server: 41.76.110.165, request: "GET /static/images/LogoS.bd2ae9c34de7.png HTTP/1.1", host: "41.76.110.165", referrer: "http://41.76.110.165/djangoprogram/login/"
^C
I am very unfamiliar with permission etc. Hope we can figure this out <3