Join the community today
Register Now

Nginx Nginx failed to start when install 123.09beta01

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by leminhduong, Mar 3, 2019.

  1. leminhduong

    leminhduong New Member

    10
    2
    3
    Mar 2, 2019
    Việt Nam
    Ratings:
    +3
    Local Time:
    12:38 PM
    1.15.9
    MariaDB 10
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed:123.09beta01
    • Nginx Version Installed: 1.15.9
    • PHP Version Installed: 7.3.2
    • MariaDB MySQL Version Installed: Distrib 10.1.38-MariaDB
    • When was last time updated Centmin Mod code base ? : March 3 2019
    • Persistent Config: /etc/centminmod/custom_config.inc
      Code (Text):
      BORINGSSL_SWITCH='y' 
      LETSENCRYPT_DETECT='y'
      

    i install centmin 123.09beta01 and i problems nginx not working
    systemctl status nginx.service
    Code (Text):
    [B]●[/B] nginx.service - SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server
    
       Loaded: loaded (/etc/rc.d/init.d/nginx; bad; vendor preset: disabled)
    
       Active: [B]failed[/B] (Result: exit-code) since Sun 2019-03-03 02:31:50 UTC; 30min ago
    
        Docs: man:systemd-sysv-generator(8)
    
    
    Mar 03 02:31:50 ip-172-26-9-124.ap-southeast-1.compute.internal systemd[1]: Starting SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server...
    
    Mar 03 02:31:50 ip-172-26-9-124.ap-southeast-1.compute.internal systemd[1]: [B]nginx.service: control process exited, code=exited status=5[/B]
    
    Mar 03 02:31:50 ip-172-26-9-124.ap-southeast-1.compute.internal systemd[1]: [B]Failed to start SYSV: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server.[/B]
    
    Mar 03 02:31:50 ip-172-26-9-124.ap-southeast-1.compute.internal systemd[1]: [B]Unit nginx.service entered failed state.[/B]
    
    Mar 03 02:31:50 ip-172-26-9-124.ap-southeast-1.compute.internal systemd[1]: [B]nginx.service failed.[/B]
    
    Mar 03 02:38:35 ip-172-26-9-124.ap-southeast-1.compute.internal systemd[1]: [B]Unit nginx.service cannot be reloaded because it is inactive.[/B]
    
    Mar 03 02:51:28 ip-172-26-9-124.ap-southeast-1.compute.internal systemd[1]: [B]Unit nginx.service cannot be reloaded because it is inactive.[/B]
    
    


    nginx -t

    Code (Text):
    [/B]
    [B]-bash: nginx: command not found
    [B]


    trying doing just
    Code (Text):
    [/B]
    yum -y remove python2-psutil
    [B]


    still getting error

    File Log
    /root/centminlogs/debug.txt

    leminhduong94/centminlogs

    [/B]
     
  2. eva2000

    eva2000 Administrator Staff Member

    40,188
    8,888
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,697
    Local Time:
    3:38 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    To troubleshoot, you need to check the full nginx upgrade log at /root/centminlogs and instructions under Sharing logs and errors heading for using Pastebin.com or Gists to share a sanitised version of the contents of the nginx_upgrade.log log. You can see full details at How to troubleshoot Centmin Mod initial install issues

    also what's output of
    Code (Text):
    nginx -t

    when you run centmin.sh menu option 4 there's a nginx upgrade log timestamped at /root/centminlogs

    if you type this command it lists all logs in date ascending order so latest log at bottom
    Code (Text):
    ls -lArt /root/centminlogs

    so copy the entire contents of latest nginx_upgrade log to gist.github.com or pastebin.com

    you can use grep to filter the logs, i.e. look for nginx_upgrade in log name
    Code (Text):
    ls -lahrt /root/centminlogs/ | grep nginx_upgrade
    -rw-r--r--  1 root root 3.2M Oct 11 15:55 centminmod_1.2.3-eva2000.09.001_111016-155345_nginx_upgrade.log
    -rw-r--r--  1 root root 672K Oct 11 22:06 centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log

    So the last nginx upgrade log was named centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log and located at /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log

    then use cat command to output the contents of that log

    clear your ssh window buffer/screen and type
    Code (Text):
    cat /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-220515_nginx_upgrade.log

    then select and copy and paste output to pastebin.com or gist.github.com file to share. If your SSH client's scroll buffer isn't large enough using cat might not output the entire log file contents, so you may need to download the log and use local text editor to open and copy and paste.

    so only need content of one specific log, in this case most recent nginx_upgrade.log log
     
  3. eva2000

    eva2000 Administrator Staff Member

    40,188
    8,888
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,697
    Local Time:
    3:38 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    If nginx never worked then it's install and not nginx upgrade issue

    Troubleshooting Initial Install



    To troubleshoot initial installation, you need to check the initial install log at /root/centminlogs and instructions under Sharing logs and errors heading for using Pastebin.com or Gists to share a sanitised version of the contents of the initial install log. You can see full details at How to troubleshoot Centmin Mod initial install issues

    Example for 123.09beta01 and newer list /root/centminlogs files in date ascending order and grep for installer_*
    Code (Text):
    ls -lahrt /root/centminlogs | grep installer_*
    

    example output returns install log at /root/centminlogs both a the full log and minimal log (smaller in size with some stuff filtered out)
    Code (Text):
    ls -lahrt /root/centminlogs | grep installer_*
    -rw-r--r-- 1 root root 4.3M Jul 12 09:06 installer_120718-083445.log
    -rw-r--r-- 1 root root 826K Jul 12 10:20 installer_120718-083445_minimal.log
    


    Example for 123.08stable list /root/centminlogs files in date ascending order and grep for install.log
    Code (Text):
    ls -lahrt /root/centminlogs | grep install.log
    

    example output returns install log at /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_install.log
    Code (Text):
    ls -lahrt /root/centminlogs | grep install.log
    -rw-r--r--  1 root root 2.2M Oct 11 01:40 centminmod_1.2.3-eva2000.09.001_111016-112321_install.log
    

    in SSH use cat to ouput contents of /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_install.log. Clear your SSH client window/buffer so only output is the contents of the file

    for 123.08stable
    Code (Text):
    cat /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_install.log
    

    for 123.09beta01 and newer
    Code (Text):
    cat /root/centminlogs/installer_120718-083445_minimal.log
    


    Then copy and paste into Pastebin.com or Gists entry. If your SSH window scroll buffer isn't that large to get the whole contents of the install log, you can download file manually and copy and paste contents. But makes sure it's sanitised version of the contents of the initial install log as outlined at How to troubleshoot Centmin Mod initial install issues
     
    • Like Like x 1
  4. leminhduong

    leminhduong New Member

    10
    2
    3
    Mar 2, 2019
    Việt Nam
    Ratings:
    +3
    Local Time:
    12:38 PM
    1.15.9
    MariaDB 10
  5. eva2000

    eva2000 Administrator Staff Member

    40,188
    8,888
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,697
    Local Time:
    3:38 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    problem seems to be with amazon ec2's virtualization type label messing with nginx build label
    Code (Text):
    nginx configure options (alternate ordering):
    ./configure --with-ld-opt="-Wl,-E -L/usr/local/zlib-cf/lib -L/usr/local/lib -ljemalloc -Wl,-z,relro -Wl,-rpath,/usr/local/zlib-cf/lib:/usr/local/lib" --with-cc-opt="-I/usr/local/zlib-cf/include -I/usr/local/include -m64 -march=native -DTCP_FASTOPEN=23 -g -O3 -fstack-protector-strong -flto -fuse-ld=gold --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wimplicit-fallthrough=0 -fcode-hoisting -Wimplicit-fallthrough=0 -fcode-hoisting -Wno-cast-function-type -Wp,-D_FORTIFY_SOURCE=2" --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --build=030319-092215-centos7-xen
    xen-hvm
    aws --with-compat --with-http_stub_status_module --with-http_secure_link_module --with-libatomic --with-http_gzip_static_module --with-http_sub_module --with-http_addition_module --with-http_image_filter_module=dynamic --with-http_geoip_module --with-stream_geoip_module --with-stream_realip_module --with-stream_ssl_preread_module --with-threads --with-stream --with-stream_ssl_module --with-http_realip_module --add-dynamic-module=../ngx-fancyindex-0.4.2 --add-module=../ngx_cache_purge-2.5 --add-dynamic-module=../ngx_devel_kit-0.3.0 --add-dynamic-module=../set-misc-nginx-module-0.32 --add-dynamic-module=../echo-nginx-module-0.61 --add-module=../redis2-nginx-module-0.15 --add-module=../ngx_http_redis-0.3.7 --add-module=../memc-nginx-module-0.18 --add-module=../srcache-nginx-module-0.31 --add-dynamic-module=../headers-more-nginx-module-0.33 --with-pcre-jit --with-zlib=../zlib-cloudflare-1.3.0 --with-http_ssl_module --with-http_v2_module --with-openssl=../openssl-1.1.1b
    ./configure: error: invalid option "xen-hvm"
    

    Code (Text):
    --build=030319-092215-centos7-xen
    xen-hvm
    aws
    

    what is output for the ssh command
    Code (Text):
    virt-what

    i suspect your Amazon EC2 server's virtualization label is more than one single word i.e. xen-kvm aws so it broke nginx build labelling. Normally, the virtualization type is one word i.e. xen, kvm, openvz

    Once you confirm the issue I will fix it in 123.09beta01 update, though you will need to do a fresh OS reload and fresh centmin mod install as the install log also contained passwords which were exposed publicly in this post.
     
    • Like Like x 1
  6. leminhduong

    leminhduong New Member

    10
    2
    3
    Mar 2, 2019
    Việt Nam
    Ratings:
    +3
    Local Time:
    12:38 PM
    1.15.9
    MariaDB 10
    Many thanks
     
  7. leminhduong

    leminhduong New Member

    10
    2
    3
    Mar 2, 2019
    Việt Nam
    Ratings:
    +3
    Local Time:
    12:38 PM
    1.15.9
    MariaDB 10
    what is output for the ssh command
    Code:
    virt-what
    
    Code:
    xen
    
    xen-hvm
    
    aws
    
     
  8. eva2000

    eva2000 Administrator Staff Member

    40,188
    8,888
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,697
    Local Time:
    3:38 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    woah so output had 3 words on separate lines ?

    can you post output for these 3 commands then as this is the fix i added but just to make sure all 3 of those words/lines end up in one line without spaces
    Code (Text):
    SETBUILD_ENV="-$(virt-what)"
    SETBUILD_ENV=$(echo $SETBUILD_ENV | tr -d '\n' | sed -e 's| |-|g')
    echo $SETBUILD_ENV
    
     
    • Like Like x 1
  9. leminhduong

    leminhduong New Member

    10
    2
    3
    Mar 2, 2019
    Việt Nam
    Ratings:
    +3
    Local Time:
    12:38 PM
    1.15.9
    MariaDB 10
    yep,
    result output for these 3 commands is
    Code:
    -xen-xen-hvm-aws
    
     
    • Informative Informative x 1
  10. eva2000

    eva2000 Administrator Staff Member

    40,188
    8,888
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,697
    Local Time:
    3:38 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Great. So my latest 123.09beta01 updates have fixed your problem with unexpected output for virt-what output :)

    So if you do a fresh CentOS 7 install and fresh 123.09beta01 install and should work this time :D
     
    • Like Like x 1
  11. leminhduong

    leminhduong New Member

    10
    2
    3
    Mar 2, 2019
    Việt Nam
    Ratings:
    +3
    Local Time:
    12:38 PM
    1.15.9
    MariaDB 10
    Thank you for taking trouble to help me. I do appreciate it :yuck:
     
    • Like Like x 1
..