Discover Centmin Mod today
Register Now

Nginx nginx fail to make issue

Discussion in 'Install & Upgrades or Pre-Install Questions' started by runos, Dec 17, 2019.

  1. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    8:20 AM
    1.17.6
    10
    Hi ya!

    New user here. First time installing CMM and encountered issue with nginx.


    Please fill in any relevant information that applies to you:
    • CentOS Version: CentOS 7.7 64bit ?
    • Centmin Mod Version Installed: 123.09beta01.b365
    • Nginx Version Installed: 1.17.6
    • PHP Version Installed: 7.3.12
    • MariaDB MySQL Version Installed: 10.3.21
    • When was last time updated Centmin Mod code base ? : today
    • Persistent Config:
      Code (Text):
      MARCH_TARGETNATIVE='n'
      LETSENCRYPT_DETECT='y'
      
    Pastebin split into 2 parts:
    https://pastebin.com/UWTFF5uu
    https://pastebin.com/wdrtazve (The error is in line 2432 of this bin)

    Pls advice. Thank you!
     
    Last edited: Dec 18, 2019
  2. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    8:20 AM
    1.17.6
    10
    UPDATE:

    When I ran the command:
    systemctl status nginx.service -l

    it returns the following error:
    Starting nginx: nginx: [emerg] module "ngx_http_image_filter_module" is already loaded in /usr/local/nginx/conf/dynamic-modules.conf:4

    I finally manage to get nginx running by commenting all the lines in dynamic-modules.conf

    Is this a bug or there's something wrong with my CMM configs?

    Thank you!
     
  3. pamamolf

    pamamolf Well-Known Member

    4,125
    429
    83
    May 31, 2014
    Ratings:
    +841
    Local Time:
    3:20 AM
    Nginx-1.29.x
    MariaDB 10.6.x
    It seems that you add something related to ngx_http_image_filter_module in your config and was not needed as it was already loaded from /usr/local/nginx/conf/dynamic-modules.conf...

    You don't have to add anything manual as Centminmod is taking care all of that modules when you add or remove them...
     
  4. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    8:20 AM
    1.17.6
    10
    pamamolf, I started from fresh installation of CMM and didn't do anything manual though :(
     
  5. pamamolf

    pamamolf Well-Known Member

    4,125
    429
    83
    May 31, 2014
    Ratings:
    +841
    Local Time:
    3:20 AM
    Nginx-1.29.x
    MariaDB 10.6.x
  6. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    10:20 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
  7. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    8:20 AM
    1.17.6
    10
    Here you go:

    Persistent Config:
    Code (Text):
    MARCH_TARGETNATIVE='n'
    LETSENCRYPT_DETECT='y'
    


    nginx -V:
    https://pastebin.com/ArhBTGKc

    nginx installation log (centminmod_123.09beta01.b365_171219-210020_nginx_upgrade.log)
    Split into 2 parts:
    https://pastebin.com/UWTFF5uu
    https://pastebin.com/wdrtazve (The error is in line 2432 of this bin)

    dynamic-modules.conf:
    https://pastebin.com/PZcD4Se4

    Currently I commented out all the "load_module" in dynamic-modules.conf and I can restart nginx successfully.

    But if I try to upgrade nginx again, it will recreate dynamic-modules.conf with all those "load_module" and returns the following error:
    Code (Text):
    Starting nginx: nginx: [emerg] module "ngx_http_image_filter_module" is already loaded in /usr/local/nginx/conf/dynamic-modules.conf:4
    
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
    


    Let me know what other info you need :)
     
    Last edited: Dec 18, 2019
  8. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    10:20 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
  9. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    8:20 AM
    1.17.6
    10
    Finally I got it working by following the FAQ's 31. How To Compile Nginx With Minimal Additional Nginx Modules instructions.

    Persistent Config:
    Code (Text):
    MARCH_TARGETNATIVE='n'
    LETSENCRYPT_DETECT='y'
    NGINX_STREAM='n'               # http://nginx.org/en/docs/stream/ngx_stream_core_module.html
    NGINX_STREAMGEOIP='n'          # nginx 1.11.3+ option http://hg.nginx.org/nginx/rev/558db057adaa
    NGINX_STREAMREALIP='n'         # nginx 1.11.4+ option http://hg.nginx.org/nginx/rev/9cac11efb205
    NGINX_STREAMSSLPREREAD='n'     # nginx 1.11.5+ option https://nginx.org/en/docs/stream/ngx_stream_ssl_preread_module.html
    NGINX_RTMP='n'                 # Nginx RTMP Module support https://github.com/arut/nginx-rtmp-module
    NGINX_FLV='n'                  # http://nginx.org/en/docs/http/ngx_http_flv_module.html
    NGINX_MP4='n'                  # Nginx MP4 Module http://nginx.org/en/docs/http/ngx_http_mp4_module.html
    NGINX_AUTHREQ='n'              # http://nginx.org/en/docs/http/ngx_http_auth_request_module.html
    NGINX_SECURELINK='n'           # http://nginx.org/en/docs/http/ngx_http_secure_link_module.html
    NGINX_FANCYINDEX='n'           # http://wiki.nginx.org/NgxFancyIndex
    NGINX_VHOSTSTATS='n'           # https://github.com/vozlt/nginx-module-vts
    NGINX_PAGESPEED='n'            # Install ngx_pagespeed
    NGINX_PASSENGER='n'            # Install Phusion Passenger requires installing addons/passenger.sh before hand
    NGINX_WEBDAV='n'               # Nginx WebDAV and nginx-dav-ext-module
    NGINX_UPSTREAMCHECK='n'        # nginx upstream check https://github.com/yaoweibin/nginx_upstream_check_module
    NGINX_OPENRESTY='n'            # Agentzh's openresty Nginx modules
    LUAJIT_GITINSTALL='n'          # opt to install luajit 2.1 from dev branch http://repo.or.cz/w/luajit-2.0.git/shortlog/refs/heads/v2.1
    ORESTY_LUANGINX='n'            # enable or disable or ORESTY_LUA* nginx modules below
    NGINX_STUBSTATUS=y             # http://nginx.org/en/docs/http/ngx_http_stub_status_module.html required for nginx statistics
    NGINX_SUB='n'                  # http://nginx.org/en/docs/http/ngx_http_sub_module.html
    NGINX_ADDITION='n'             # http://nginx.org/en/docs/http/ngx_http_addition_module.html
    NGINX_IMAGEFILTER='n'          # http://nginx.org/en/docs/http/ngx_http_image_filter_module.html
    NGINX_CACHEPURGE='y'           # https://github.com/FRiCKLE/ngx_cache_purge/
    NGINX_ACCESSKEY='n'            #
    NGINX_HTTPCONCAT='n'           # https://github.com/alibaba/nginx-http-concat
    NGINX_THREADS='y'              # https://www.nginx.com/blog/thread-pools-boost-performance-9x/
    ORESTY_HEADERSMORE='y'         # openresty headers more https://github.com/openresty/headers-more-nginx-module
    


    Maybe this config should be default for new installations as well?
     
  10. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    10:20 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    no no it should work without needing to do that - so the initial install log would give me an idea where the problem was
     
  11. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    8:20 AM
    1.17.6
    10
    These are the logs I downloaded. There are so many logs.
    Do you need me to pastebin all of them?
    If not, let me know which are the important ones :)
     

    Attached Files:

  12. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    10:20 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    from https://community.centminmod.com/threads/how-to-troubleshoot-centmin-mod-initial-install-issues.102/
    so installer_*.log would be full log :)
     
  13. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    8:20 AM
    1.17.6
    10
  14. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    10:20 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    so the install log shows nginx installed properly so issue isn't at initial install, but on nginx upgrade via centmin.sh menu option 5 i see nginx fail at configure stage
    Code (Text):
    configuring additional modules
    adding module in ../ngx_cache_purge-2.5
    ../srcache-nginx-module-0.31/config: line 30: [: !=: unary operator expected
     + ngx_http_cache_purge_module was configured
    adding module in ../redis2-nginx-module-0.15
     + ngx_http_redis2_module was configured
    adding module in ../ngx_http_redis-0.3.7
     + ngx_http_redis_module was configured
    adding module in ../memc-nginx-module-0.18
     + ngx_http_memc_module was configured
    adding module in ../srcache-nginx-module-0.31
     + ngx_http_srcache_filter_module was configured
    configuring additional dynamic modules
    adding module in ../ngx-fancyindex-0.4.2
    ./configure: error: no ../ngx-fancyindex-0.4.2/config was found
    

    so maybe /svr-setup downloaded fancyindex nginx module was missing or deleted ?

    what's output for these commands
    Code (Text):
    ls -lahrt /svr-setup/ | grep -i fancy

    Code (Text):
    ls -lah /svr-setup/ngx-fancyindex-0.4.2/config

    for posting code or output from commands to keep the formatting, you might want to use CODE tags for code How to use forum BBCODE code tags :)

    on my server i see
    Code (Text):
    ls -lahrt /svr-setup/ | grep -i fancy
    drwxrwxr-x    2 root      root       4.0K Apr  4  2011 ngx-fancyindex-ngx-fancyindex
    -rw-r--r--    1 root      root        13K Jul 13  2015 ngx-fancyindex-0.3.1.tar.gz
    drwxrwxr-x    3 root      root       4.0K Aug 18  2017 ngx-fancyindex-0.4.2
    -rw-r--r--    1 root      root        22K Sep 10 17:45 ngx-fancyindex-0.4.2.tar.gz
    

    Code (Text):
    ls -lah /svr-setup/ngx-fancyindex-0.4.2/config
    -rw-rw-r-- 1 root root 801 Aug 18  2017 /svr-setup/ngx-fancyindex-0.4.2/config
    

    if the config file is missing or corrupted, you can remove the files and directories and let centmin.sh menu option 5 nginx upgrade routine re-download it again
    Code (Text):
    cd /svr-setup
    rm -rf /svr-setup/ngx-fancyindex*
    
     
  15. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    8:20 AM
    1.17.6
    10
    If I run this:
    ls -lah /svr-setup/ngx-fancyindex-0.4.2/config

    This is the error:
    Code:
    ls: cannot access /svr-setup/ngx-fancyindex-0.4.2/config: No such file or directory
    So I did the steps you recommended and ran nginx upgrade again.
    This is the result now:
    Code:
    -rw-rw-r-- 1 root root 801 Aug 19  2017 /svr-setup/ngx-fancyindex-0.4.2/config
    
    Problem solved! Thanks! :)
     
  16. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    10:20 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Glad to hear :D
     
  17. runos

    runos Member

    57
    17
    8
    Dec 17, 2019
    Ratings:
    +22
    Local Time:
    8:20 AM
    1.17.6
    10
    Yeah!... Next is to learn how to secure the server and follow by tweaking the performance! :)