error-nginx-and-does-not-want-to-start/

(Comments)

Today I had a very very annoying and confusing situation. Which was a doesn't work host! And it's terrible. 

Here how it looked like. 

And it means the error is in my side. So I go to the site and try to turn off 

1. My Gunicorn 

2. My Nginx

And it turns out that my Nginx that does not work. 

I found it by typing 

service nginx status

or

journalctl -xe

And it always give me error that 

django@dashboardserver:~$ journalctl -xe
Hint: You are currently not seeing messages from other users and the system.
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.


and it made me more worried because nothing it seems wrong

django@dashboardserver:~$ service nginx stop
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'nginx.service'.
Authenticating as: ,,, (django)
Password:
==== AUTHENTICATION COMPLETE ===
django@dashboardserver:~$ killall -9 nginx
nginx: no process found
django@dashboardserver:~$ service nginx start
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'nginx.service'.
Authenticating as: ,,, (django)
Password:
==== AUTHENTICATION COMPLETE ===
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
django@dashboardserver:~$ systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-05-22 19:49:12 UTC; 15s ago
Process: 7504 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)

and it still does not show anything

The situation is getting more weird because the system does not show the exact location about where is the error. And it gives me another Paulo Coelho moment where the programmer mostly spend 90% of his time actually not in programming, but in debugging. Especially debugging something that usually works but then why the hell it doesnt work now. 

And then I found some hint.

I login as a root and do the test to turn on the nginx again

root@dashboardserver:~# systemctl restart nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
root@dashboardserver:~# service nginx quit
Usage: nginx {start|stop|restart|reload|force-reload|status|configtest|rotate|upgrade}
root@dashboardserver:~# service nginx stop
root@dashboardserver:~# systemctl start nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
root@dashboardserver:~# nginx -t
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
2019/05/22 19:52:09 [emerg] 7679#7679: open() "/var/log/nginx/access.log" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed

And whalla 

The isue it turned out because I dont have the log for nginx. 

So the solution was creating the log

root@dashboardserver:~# cd /var/log
root@dashboardserver:/var/log# mkdir nginx
root@dashboardserver:/var/log# sudo chown -R www-data:www-data /var/log/nginx;
root@dashboardserver:/var/log# sudo chmod -R 755 /var/log/nginx;
root@dashboardserver:/var/log# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@dashboardserver:/var/log# systemctl start nginx
root@dashboardserver:/var/log#

And thanks to this site that helps me find out the solution. 

And whalla the site lives again!

Current rating: 1

Comments

Riddles

22nd Jul- 2020, by: Editor in Chief
524 Shares 4 Comments
Generic placeholder image
20 Oct- 2019, by: Editor in Chief
524 Shares 4 Comments
Generic placeholder image
20Aug- 2019, by: Editor in Chief
524 Shares 4 Comments
10Aug- 2019, by: Editor in Chief
424 Shares 4 Comments
Generic placeholder image
10Aug- 2015, by: Editor in Chief
424 Shares 4 Comments

More News  »

Potongan cerita pendek - kelas kosong masa SMA yang mengingatkanku pada dirinya

Recent news

Cerita ini fiksi belaka, kemiripan dengan kejadian sesungguhnya hanyalah kebetulan, atau dirimu memang ingin membuatnya kebetulan 😅

read more
4 days, 3 hours ago

Apa kepanjangan kwk di c plano pilkada

Recent news

Dalam konteks formulir C Plano pada Pilkada, singkatan “KWK” berarti “Kepala Wilayah Kerja”. Formulir C1-KWK Plano adalah catatan hasil penghitungan suara di Tempat Pemungutan Suara (TPS) yang digunakan dalam Pemilihan Kepala Daerah dan Wakil Kepala Daerah. Formulir ini mencatat secara rinci perolehan suara di setiap TPS dan merupakan bagian penting dalam proses rekapitulasi suara.

read more
1 week, 1 day ago

What is department of Government efficiency

Recent news

The **Department of Government Efficiency (DOGE)** is a proposed initiative by President-elect Donald Trump, aiming to streamline federal operations and reduce wasteful spending. Announced on November 12, 2024, the department is set to be co-led by tech entrepreneur Elon Musk and former Republican presidential candidate Vivek Ramaswamy.

read more
1 week, 4 days ago

Who Kyle Singler

Recent news

Kyle Singler is a former professional basketball player known for his collegiate success at Duke University and his tenure in the NBA.

read more
1 week, 4 days ago

Who is Pete Hegseth

Recent news

Pete Hegseth is an American television host, author, and Army National Guard officer, recently nominated by President-elect Donald Trump to serve as the United States Secretary of Defense.

read more
1 week, 4 days ago

Who is Anne Applebaum

Recent news

Anne Applebaum is a renowned journalist, historian, and author whose works delve into some of the most pressing and complex topics of the modern era. Her expertise lies in examining the intricacies of authoritarian regimes, the rise of populism, and the fragility of democratic institutions. Her Pulitzer Prize-winning book, "Gulag: A History," offers an in-depth exploration of the Soviet labor camp system, shedding light on the human suffering and ideological underpinnings of one of the 20th century’s most oppressive systems.

read more
1 week, 4 days ago

What is Plexity AI and how it can help us to see our civilization in the future?

Recent news

Plexity AI is a marvel of our times—a confluence of technological ingenuity and the boundless hunger for understanding. At its core, Plexity AI represents an advanced synthesis of artificial intelligence and machine learning, built not merely to mimic thought but to empower it. Unlike earlier iterations of AI, which focused on specialized tasks or data crunching, Plexity seems designed to operate as an expansive intellectual partner, capable of untangling the Gordian knots of complexity that define the modern era.

read more
1 week, 4 days ago

template for tanya jawab wifi

Recent news

Pertanyaan kali ini adalah 

read more
2 months, 1 week ago

More News »

Generic placeholder image

Collaboratively administrate empowered markets via plug-and-play networks. Dynamically procrastinate B2C users after installed base benefits. Dramatically visualize customer directed convergence without