1

My NGINX server have stopped and it is generating error.

I am using Ubantu 16.04 and my app deploye at Digital Ocean Server.

When I run the following colde sudo systemctl start nginx It is giving following output:

Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. 

Output of $ nginx -t is:

nginx: [emerg] BIO_new_file("/root/bitradiology.chained.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/root/bitradiology.chained.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file) nginx: configuration file /etc/nginx/nginx.conf test failed 

I checked the status with $ sudo systemctl status nginx

output is:

● 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 Mon 2017-08-21 11:01:51 UTC; 1min 50s ago Process: 2085 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=2) Process: 2420 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE) Main PID: 2462 (code=exited, status=0/SUCCESS) Aug 21 11:01:51 ubuntu-512mb-nyc3-01 systemd[1]: Starting A high performance web server and a reverse proxy server... Aug 21 11:01:51 ubuntu-512mb-nyc3-01 nginx[2420]: nginx: [emerg] BIO_new_file("/root/bitradiology.chained.crt") failed (SSL: error:02001002:system library:fopen:No such Aug 21 11:01:51 ubuntu-512mb-nyc3-01 nginx[2420]: nginx: configuration file /etc/nginx/nginx.conf test failed Aug 21 11:01:51 ubuntu-512mb-nyc3-01 systemd[1]: nginx.service: Control process exited, code=exited status=1 Aug 21 11:01:51 ubuntu-512mb-nyc3-01 systemd[1]: Failed to start A high performance web server and a reverse proxy server. Aug 21 11:01:51 ubuntu-512mb-nyc3-01 systemd[1]: nginx.service: Unit entered failed state. Aug 21 11:01:51 ubuntu-512mb-nyc3-01 systemd[1]: nginx.service: Failed with result 'exit-code'. lines 1-14/14 (END) 

How to fix this problem

0

2 Answers 2

2

I found this bitradiology.chained.crt file into the cd /usr directory.

Then go to the following directory cd /etc/nginx/sites-enabled and open the default file

sudo nano default 

I edited this file and replaced /root/ by /usr/

/root/bitradiology.chained.crt by /usr/bitradiology.chained.crt

I run the nginx config test first:

nginx -t 

after the test ran successful, I can restart the service

/etc/init.d/nginx restart 

NGINX has been started and my app is running right now.

Thanks!!!

Sign up to request clarification or add additional context in comments.

Comments

0

Check your ssl_certificate instructions in your config files. Nginx is clearly saying it can't find one of the files specified:

fopen:No such file or directory:fopen('/root/bitradiology.chained.crt','r')

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.