Results 1 to 10 of 10

Thread: nginx.conf test failed

  1. #1
    Join Date
    Jun 2009
    Location
    Santiago, Chile
    Posts
    100

    nginx.conf test failed

    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 by microz; 05-19-2013 at 04:56 PM.

  2. #2
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    11,023
    Hello,

    It seems you've got old things on your server. Make sure, you've got the latest version of Directadmin and re-build nginx.

    Related: http://forum.directadmin.com/showthread.php?t=45978
    With regards, Alex.

    Professional Server Management for web hosting companies and individuals
    Hourly Support, Disaster Recovery, Server Hardening, Monthly Subscription
    Directadmin installation and optimization

    Click here if you need a Linux Admin

  3. #3
    Join Date
    Apr 2013
    Posts
    13

    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.

  4. #4
    Join Date
    Aug 2006
    Location
    LT, EU
    Posts
    6,744
    Quote Originally Posted by 1srael View Post
    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
    Martynas Bendorius
    MB Martynas IT. Professional server management company. Official DirectAdmin, CloudLinux, LiteSpeed and Comodo partners.

  5. #5
    Join Date
    Jun 2013
    Posts
    5

    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?

  6. #6
    Join Date
    Jun 2013
    Posts
    5

    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

  7. #7
    Join Date
    Oct 2011
    Posts
    134
    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;

  8. #8
    Join Date
    Oct 2011
    Posts
    134
    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

  9. #9
    Join Date
    Oct 2011
    Posts
    134
    Quote Originally Posted by Hardie View Post
    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

  10. #10
    Join Date
    Oct 2011
    Posts
    134
    I ran:

    Code:
    ./build nginx
    and now it's working again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •