我的NGINX服务器已经停止,并且正在生成错误。
我正在使用Ubantu 16.04和我在Digital Ocean Server上部署的应用程序。
当我运行下面的colde sudo 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.$ nginx -t的输出为:
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我用$ sudo systemctl status nginx检查了状态
输出为:
● 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)如何解决此问题
发布于 2017-08-29 20:10:43
我在cd /usr目录中找到了这个bitradiology.chained.crt文件。
然后转到以下目录cd /etc/nginx/sites-enabled并打开默认文件
sudo nano default我编辑了这个文件,并用/usr/替换了/root/
/usr/bitradiology.chained.crt的/root/bitradiology.chained.crt
我首先运行nginx配置测试:
nginx -t测试运行成功后,我可以重新启动服务
/etc/init.d/nginx restart NGINX已经启动,我的应用程序正在运行。
谢谢!
发布于 2017-08-21 21:55:49
检查配置文件中的ssl_certificate指令。Nginx明确表示它找不到指定的文件之一:
fopen:没有这样的文件或directory:fopen('/root/bitradiology.chained.crt','r')
https://stackoverflow.com/questions/45798561
复制相似问题