Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am setting up Django Project on Digital Ocean with Nginx. I am getting error on journalctl -u gunicorn.socket this command. Got this Error
root@vavaphysio:/var/www/html/sandbox# journalctl -u gunicorn.socket
-- Logs begin at Mon 2020-01-06 03:17:11 UTC, end at Sat 2020-01-18 06:28:38 UTC. --
Jan 14 12:08:43 vavaphysio systemd[1]: /etc/systemd/system/gunicorn.socket:6: Unknown section 'Service'. Ignoring.
Jan 14 12:08:43 vavaphysio systemd[1]: gunicorn.socket: Unit has no Listen setting (ListenStream=, ListenDatagram=, ListenFIFO=, ...). Refusing.
Jan 16 09:04:14 vavaphysio systemd[1]: Listening on gunicorn socket.
Jan 16 09:36:44 vavaphysio systemd[1]: gunicorn.socket: Failed with result 'service-start-limit-hit'.
Jan 16 09:53:47 vavaphysio systemd[1]: Listening on gunicorn socket.
Here is my gunicorn Socket file
**[Unit]
Description=gunicorn socket
[Socket]
ListenStream=/run/gunicorn.sock
[Install]
WantedBy=sockets.target**
Gunicorn Service File:
**[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
User=root
Group=www-data
WorkingDirectory=/var/www/html/sandbox
ExecStart=/var/www/html/sandbox/env/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
sandbox.wsgi:application
[Install]
WantedBy=multi-user.target**
Any Answer Please.
with this settings you need to have file /var/www/html/sandbox/sandbox/wsgi.py
because you set WorkingDirectory=/var/www/html/sandbox
and in ExecStart
you write sandbox.wsgi:application
so gunicorn try to enter to WorkingDirectory
and find there sandbox/wsgi.py
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.