Welcome to Centmin Mod Community
Become a Member

Nginx missing log file can't restart nginx?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by elargento, Jun 26, 2017.

  1. elargento

    elargento Member

    284
    16
    18
    Jan 4, 2016
    Ratings:
    +37
    Local Time:
    3:50 PM
    10
    I'm experiencing a similar issue

    Code:
    [02:34][root@domain.com centminmod]# nginx -t
    nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
    nginx: [emerg] open() "/home/nginx/domains/domain.com/log/access.log" failed (2: No such file or directory)
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
    
    Any idea where the problem is?
    I don't see there is any reference of access.log in nginx.conf
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,034
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,784
    Local Time:
    4:50 AM
    Nginx 1.13.x
    MariaDB 5.5
    that is referenced in domain.com.conf vhost file
     
  3. elargento

    elargento Member

    284
    16
    18
    Jan 4, 2016
    Ratings:
    +37
    Local Time:
    3:50 PM
    10
    In that case I think you can reproduce this by following these steps:
    Code:
    pure-pw userdel user
     rm -rf /usr/local/nginx/conf/conf.d/domain.com.conf
     rm -rf /usr/local/nginx/conf/conf.d/domain.com.ssl.conf
     rm -rf /usr/local/nginx/conf/ssl/domain.com/domain.com.crt
     rm -rf /usr/local/nginx/conf/ssl/domain.com/domain.com.key
     rm -rf /usr/local/nginx/conf/ssl/domain.com/domain.com.csr
     rm -rf /usr/local/nginx/conf/ssl/domain.com
     rm -rf /home/nginx/domains/domain.com
     service nginx restart
    If I follow the instructions it says to delete domain.com.conf first and then restart nginx. I followed these steps and got the error on my first post.