User Tools

Site Tools


aufsetzen_raspberry_lokal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
aufsetzen_raspberry_lokal [2026/06/12 20:55] nininaufsetzen_raspberry_lokal [2026/06/12 21:52] (current) ninin
Line 82: Line 82:
 ====15. Static Files==== ====15. Static Files====
   python manage.py collectstatic   python manage.py collectstatic
 +
 +Rechte für Nginx auf das staticfiles-Verzeichnis vergeben:
 +  sudo chown -R :www-data [...]/sese_project/serious-seeds/app/staticfiles/
 +  sudo chmod -R 755 [...]/sese_project/serious-seeds/app/staticfiles/
 +  sudo chmod o+x /home/[SYSTEMUSER]
      
 ====16. Nginx==== ====16. Nginx====
Line 96: Line 101:
      
       location / {       location / {
-          proxy_pass http://unix:/run/gunicorn.sock:/;+          proxy_pass http://unix:/run/gunicorn/gunicorn.sock:/;
           proxy_set_header Host $host;           proxy_set_header Host $host;
           proxy_set_header X-Real-IP $remote_addr;           proxy_set_header X-Real-IP $remote_addr;
Line 115: Line 120:
   sudo nginx -T | sed -n '1,200p' | grep -n 'proxy_pass\|upstream'   sudo nginx -T | sed -n '1,200p' | grep -n 'proxy_pass\|upstream'
  
 +====17. Gunicorn====
      
 +
 +  sudo nano /etc/systemd/system/gunicorn.service
 +
 +content:
 +  [Unit]
 +  
 +  Description=gunicorn daemon for Django
 +  After=network.target
 +  
 +  [Service]
 +  User=[SYSTEMUSER]
 +  Group=www-data
 +  RuntimeDirectory=gunicorn
 +  WorkingDirectory=[...]/sese_project/serious-seeds/app
 +  ExecStart=[...]/sese_project/serious-seeds/env/bin/gunicorn --workers 5 --threads 2 --timeout 60 --max-requests 1000 --max-requests-jitter 100 --bind unix:/run/gunicorn/gunicorn.sock seriousseeds.wsgi:application
 +  
 +  [Install]
 +  WantedBy=multi-user.target
 +
 +Start and enable the service:
 +  sudo systemctl start gunicorn
 +  sudo systemctl enable gunicorn
aufsetzen_raspberry_lokal.1781297725.txt.gz · Last modified: by ninin