By harshku2630
Hello
I host a django website and set all thing then I run sudo systemctl restart nginx
in my server it gives me an error that Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
then I run systemctl status nginx.service
it shows me that
nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:> Active: failed (Result: exit-code) since Mon 2021-07-12 06:39:25 UTC; 1min> Docs: man:nginx(8) Process: 30855 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_proc>
then I run sudo ufw allow "Nginx Full
and then I run sudo ufw status
its give me the result that
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
8000 ALLOW Anywhere
Nginx Full ALLOW Anywhere
Nginx HTTP ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
8000 (v6) ALLOW Anywhere (v6)
Nginx Full (v6) ALLOW Anywhere (v6)
Nginx HTTP (v6) ALLOW Anywhere (v6)
then I run again systemctl status nginx.service
but it gives me error again and again that
nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:> Active: failed (Result: exit-code) since Mon 2021-07-12 06:39:25 UTC; 1min> Docs: man:nginx(8) Process: 30855 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_proc>
So please tell me what can I do to solve this problem
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hi there,
It sounds like that there might be another service already listening on that port. You could check this with the following command:
netstat -plant | grep 80
Also, what is the output of the journalctl -xe
command?
If this does not provide enough information, I could suggest checking the Nginx error log:
tail -100 /var/log/nginx/error.log
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.