nginx.conf test failed

microz

Verified User
Joined
Jun 10, 2009
Messages
124
Location
Santiago, Chile
Hi,

For some reason obtain this error, after install DA with nginx, php-fpm:

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

Any suggestion?

Rgds,
 
Last edited:
The same here...

Hi guys,
The same here:
Code:
# service nginx restart
nginx: [emerg] BIO_new_file("/etc/httpd/conf/ssl.crt/server.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/httpd/conf/ssl.crt/server.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed


Tested in a fresh new vps and CB2.0.

If any one can help us...Thank you !
I'm very interested in use the nginx+php-fpm with DA.
Thank you so much,
Israel.
 
Hi guys,
The same here:
Code:
# service nginx restart
nginx: [emerg] BIO_new_file("/etc/httpd/conf/ssl.crt/server.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/httpd/conf/ssl.crt/server.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed


Tested in a fresh new vps and CB2.0.

If any one can help us...Thank you !
I'm very interested in use the nginx+php-fpm with DA.
Thank you so much,
Israel.

You seem to be running a VPS image that has old version installed. Please do:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build rewrite_confs
 
Same issue

Gracefully shutting down php-fpm55: . done
Starting php-fpm55: done
httpd: no process killed
httpd: no process killed
Restarting nginx.
nginx: [emerg] BIO_new_file("/etc/httpd/conf/ssl.crt/server.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/httpd/conf/ssl.crt/server.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed

Has someone any ideas to fix this?
 
Solved, it's an error caused by the directadmin.conf

I solved this by changing the values (below) to point to nginx in directadmin.conf.

Code:
apachecert=/etc/httpd/conf/ssl.crt/server.crt
apacheconf=/etc/httpd/conf/httpd.conf
apacheips=/etc/httpd/conf/ips.conf
apachekey=/etc/httpd/conf/ssl.key/server.key
apachelogdir=/var/log/httpd/domains
 
I am having the same problem:

Code:
s01: service nginx restart

nginx: [emerg] BIO_new_file("/etc/httpd/conf/ssl.crt/server.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/httpd/conf/ssl.crt/server.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed
/etc/init.d/nginx: line 73: return: can only `return' from a function or sourced script
Shutting down nginx: 
Starting nginx: nginx: [emerg] BIO_new_file("/etc/httpd/conf/ssl.crt/server.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/httpd/conf/ssl.crt/server.crt','r') error:2006D080:BIO routines:BIO_new_file:no such file)

This started after I configured DA to run over HTTPS. This is how I did it:

Code:
/usr/bin/openssl req -x509 -newkey rsa:1024 -keyout /usr/local/directadmin/conf/cakey.pem -out /usr/local/directadmin/conf/cacert.pem -days 9000 -nodes

chown diradmin:diradmin /usr/local/directadmin/conf/cakey.pem

chmod 400 /usr/local/directadmin/conf/cakey.pem

and then setting "SSL=1" in directadmin.conf.

The error refers to "/etc/httpd/conf/ssl.crt/server.crt", but the thing is that "/etc/httpd/conf" is empty:

Code:
s01:/etc/httpd/conf# ls -a
.  ..

So I can understand why Nginx can't find any certificate in there. So I looked inside "/etc/nginx/nginx.conf" for HTTPS settings to match against that path, but all I found was this:

Code:
ssl                  on;
        ssl_certificate      /etc/nginx/ssl.crt/server.crt;
        ssl_certificate_key  /etc/nginx/ssl.key/server.key;
 
This is a brand new box running Debian 6 by the way. It worked just fine until I configured HTTPS for DA.

I have tried this, but it did not work:
Code:
cd /usr/local/directadmin/custombuild
./build update
./build rewrite_confs
 
I solved this by changing the values (below) to point to nginx in directadmin.conf.

Code:
apachecert=/etc/httpd/conf/ssl.crt/server.crt
apacheconf=/etc/httpd/conf/httpd.conf
apacheips=/etc/httpd/conf/ips.conf
apachekey=/etc/httpd/conf/ssl.key/server.key
apachelogdir=/var/log/httpd/domains

Like this? I did not work for me.

Code:
apachecert=/etc/nginx/ssl.crt/server.crt
apacheconf=/etc/nginx/nginx.conf
apacheips=/etc/nginx/directadmin-ips.conf
apachekey=/etc/nginx/ssl.key/server.key
apachelogdir=/var/log/nginx/domains
 
Back
Top