Discover Centmin Mod today
Register Now

Nginx unknown directive vhost_traffic_status_dump

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, Sep 25, 2017.

  1. pamamolf

    pamamolf Well-Known Member

    3,072
    293
    83
    May 31, 2014
    Ratings:
    +524
    Local Time:
    8:09 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Please fill in any relevant information that applies to you:
    • CentOS Version:CentOS 7 64bit ?
    • Centmin Mod Version Installed:123.09beta01
    • Nginx Version Installed:1.13.5
    • PHP Version Installed: 7.1.9
    • MariaDB MySQL Version Installed: 10.1.21
    • When was last time updated Centmin Mod code base ? : just now

    Restarting nginx fails with error:

    Code:
     nginx: [emerg] unknown directive "vhost_traffic_status_dump" in /usr/local/nginx/conf/vts_http.conf:2
    content of that file:

    Code:
    #vhost_traffic_status_zone;
    vhost_traffic_status_dump /var/log/nginx/vts.db;
    Nginx conf for the domain:

    Code:
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name mydomain.com;
    #            return 301 $scheme://www.mydomain.com$request_uri;
    #       }
    
    server {
     
      server_name mydomain.com www.mydomain.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/mydomain.com/log/access.log;
      error_log /home/nginx/domains/mydomain.com/log/error.log;
    
      #include /usr/local/nginx/conf/autoprotect/mydomain.com/autoprotect-mydomain.com.conf;
      root /home/nginx/domains/mydomain.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      include /usr/local/nginx/conf/cloudflare.conf;
      #include /usr/local/nginx/conf/503include-main.conf;
    
      location / {
      #include /usr/local/nginx/conf/503include-only.conf;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Wordpress Permalinks example
      try_files $uri $uri/ /index.php?q=$uri&$args;
    
      }
    
      include /usr/local/nginx/conf/pre-staticfiles-local-mydomain.com.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
     
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }

     
    • Informative Informative x 1
  2. eva2000

    eva2000 Administrator Staff Member

    33,648
    7,448
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,449
    Local Time:
    3:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    whoops forgot to add a conditional check for this
     
  3. eva2000

    eva2000 Administrator Staff Member

    33,648
    7,448
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,449
    Local Time:
    3:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    Just updated 123.09beta01 with fix, if you recompile nginx via centmin.sh menu option 4 it should auto fix it or you can just comment out that directive manually and restart nginx if you do not want to recompile
     
  4. pamamolf

    pamamolf Well-Known Member

    3,072
    293
    83
    May 31, 2014
    Ratings:
    +524
    Local Time:
    8:09 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Great :)

    I think there is a typo also at the nginx config file:

    Code:
    # run the auto command once to popular cloudflare ips
    do you mean populate?

    Also i think on the same file there is no reason to have the same line twice one commented and one uncommented:

    Code:
    more_set_headers "X-Powered-By: centminmod";
    :)
     
  5. eva2000

    eva2000 Administrator Staff Member

    33,648
    7,448
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,449
    Local Time:
    3:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    k fixed typo as to duplicate, i think there's a function in inc/cpcheck.inc which checks to see if that header is set/exists and if not, add it so could be a incorrect detection on that part but i am not seeing this in my installs

    i see in nginx.conf
    Code (Text):
    more_set_headers "Server: nginx centminmod";
    more_set_headers "X-Powered-By: centminmod";
    
     
  6. pamamolf

    pamamolf Well-Known Member

    3,072
    293
    83
    May 31, 2014
    Ratings:
    +524
    Local Time:
    8:09 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    It is down:

    Code:
    more_set_headers "Server: nginx centminmod";
    more_set_headers "X-Powered-By: centminmod";
    
    # uncomment cloudflare.conf include if using cloudflare for
    # server and/or vhost site + setup cron job for command
    # /usr/local/src/centminmod/tools/csfcf.sh auto
    # run the auto command once to popular cloudflare ips
    include /usr/local/nginx/conf/cloudflare.conf;
    # uncomment incapsula.conf include if using incapsula for
    # server and/or vhost site + setup cron job for command
    # /usr/local/src/centminmod/tools/csfincapsula.sh auto
    # run the auto command once to popular incapsula ips
    #include /usr/local/nginx/conf/incapsula.conf;
    include /usr/local/nginx/conf/maintenance.conf;
    #more_set_headers "X-Powered-By: centminmod";
    Last line :)
     
  7. eva2000

    eva2000 Administrator Staff Member

    33,648
    7,448
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,449
    Local Time:
    3:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    strange not seeing that at all

    this is what i see
    Code (Text):
    more_set_headers "Server: nginx centminmod";
    more_set_headers "X-Powered-By: centminmod";
    
    # uncomment cloudflare.conf include if using cloudflare for
    # server and/or vhost site + setup cron job for command
    # /usr/local/src/centminmod/tools/csfcf.sh auto
    # run the auto command once to popular cloudflare ips
    #include /usr/local/nginx/conf/cloudflare.conf;
    # uncomment incapsula.conf include if using incapsula for
    # server and/or vhost site + setup cron job for command
    # /usr/local/src/centminmod/tools/csfincapsula.sh auto
    # run the auto command once to popular incapsula ips
    #include /usr/local/nginx/conf/incapsula.conf;
    include /usr/local/nginx/conf/maintenance.conf;
    #include /usr/local/nginx/conf/vts_http.conf;
    include /usr/local/nginx/conf/geoip.conf;
    include /usr/local/nginx/conf/webp.conf;
    #include /usr/local/nginx/conf/pagespeedadmin.conf;
    include /usr/local/nginx/conf/fastcgi_param_https_map.conf;
    
     
  8. pamamolf

    pamamolf Well-Known Member

    3,072
    293
    83
    May 31, 2014
    Ratings:
    +524
    Local Time:
    8:09 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    I just install Centminmod and add one test domain there and got it....

    I am 100% sure !
     
  9. eva2000

    eva2000 Administrator Staff Member

    33,648
    7,448
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,449
    Local Time:
    3:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    ok will investigate :)
     
  10. pamamolf

    pamamolf Well-Known Member

    3,072
    293
    83
    May 31, 2014
    Ratings:
    +524
    Local Time:
    8:09 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    and there is a space also there for me :)

    Code:
    #include /usr/local/nginx/conf/incapsula.conf;
    include /usr/local/nginx/conf/maintenance.conf;
    #more_set_headers "X-Powered-By: centminmod";
    
    include /usr/local/nginx/conf/vts_http.conf;
    include /usr/local/nginx/conf/geoip.conf;
    include /usr/local/nginx/conf/webp.conf;
    #include /usr/local/nginx/conf/pagespeedadmin.conf;
    include /usr/local/nginx/conf/fastcgi_param_https_map.conf;
    It's not a problem but it is good to have as much as possible clean config files and only what is needed :)

    Thank you George !
     
    • Informative Informative x 1
  11. gamal

    gamal New Member

    24
    2
    3
    Jan 31, 2018
    Ratings:
    +2
    Local Time:
    3:09 PM
    1.13.8
    i have the same error, rebuilding using the option 4 in centmin menu doesn't change anything.
    Code:
    nginx -t
    
    nginx: [emerg] unknown directive "vhost_traffic_status_dump" in /usr/local/nginx/conf/vts_http.conf:2
    
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
    
    Code:
    systemctl status nginx.service
    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: failed (Result: exit-code) since Wed 2018-01-31 00:21:38 UTC; 10h ago
    
        Docs: man:systemd-sysv-generator(8)
    
      Process: 19717 ExecStart=/etc/rc.d/init.d/nginx start (code=exited, status=1/FAILURE)
    
    
    Jan 31 00:21:38 3alamtaney systemd[1]: Starting SYSV: Nginx is an HTTP(S) s.....
    
    Jan 31 00:21:38 3alamtaney nginx[19717]: Starting nginx: nginx: [emerg] unkn...2
    
    Jan 31 00:21:38 3alamtaney nginx[19717]: [FAILED]
    
    Jan 31 00:21:38 3alamtaney systemd[1]: nginx.service: control process exite...=1
    
    Jan 31 00:21:38 3alamtaney systemd[1]: Failed to start SYSV: Nginx is an HT...r.
    
    Jan 31 00:21:38 3alamtaney systemd[1]: Unit nginx.service entered failed state.
    
    Jan 31 00:21:38 3alamtaney systemd[1]: nginx.service failed.
    
    Hint: Some lines were ellipsized, use -l to show in full.
    

    nginx version: nginx/1.13.5
     
    Last edited: Jan 31, 2018
  12. eva2000

    eva2000 Administrator Staff Member

    33,648
    7,448
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,449
    Local Time:
    3:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    @gamal

    relevant info ?
    • CentOS Version: CentOS 7 64bit ?
    • Centmin Mod Version Installed:123.09beta01
    • Nginx Version Installed: ?
    • PHP Version Installed: ?
    • MariaDB MySQL Version Installed: ?
    • When was last time updated Centmin Mod code base ? : ?

    what's output for
    Code (Text):
    nginx -V
    

    set anything persistent config file at /etc/centminmod/custom_config.inc ?
    Code (Text):
    cat /etc/centminmod/custom_config.inc 
    
     
  13. gamal

    gamal New Member

    24
    2
    3
    Jan 31, 2018
    Ratings:
    +2
    Local Time:
    3:09 PM
    1.13.8
    Code:
    nginx -V
    
    nginx version: nginx/1.13.5
    
    Code:
    LETSENCRYPT_DETECT='y'
    
     
  14. eva2000

    eva2000 Administrator Staff Member

    33,648
    7,448
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,449
    Local Time:
    3:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    have you updated 123.09beta01 at all ? make sure you have latest updates first

    Upgrading Centmin Mod Code to Latest Version



    Getting Started Guide step 19 outlines also how to keep Centmin Mod code updated or how to switch version branches or you can run cmupdate command that was recently added.

    Centmin Mod LEMP stack's script code is constantly updated for improvements, bug fixes and security fixes so keeping the Centmin Mod code up to date is important. With Centmin Mod 1.2.3-eva2000.08) (123.08stable) and higher releases, a newly added centmin.sh menu option 23 allows much easier code updates and version branch swicthing via Git backed environment you can setup. For full details read the following links:
     
  15. gamal

    gamal New Member

    24
    2
    3
    Jan 31, 2018
    Ratings:
    +2
    Local Time:
    3:09 PM
    1.13.8
    ok now i have run the update; same errors but when i run nginx -v

    Code:
    nginx version: nginx/1.13.5
    
    built by clang 3.4.2 (tags/RELEASE_34/dot2-final)
    
    built with LibreSSL 2.5.5
    
    TLS SNI support enabled
    
    configure arguments: --with-ld-opt='-lrt -ljemalloc -Wl,-z,relro -Wl,-rpath,/usr/local/lib' --with-cc-opt='-m64 -mtune=native -DTCP_FASTOPEN=23 -g -O3 -fstack-protector -fuse-ld=gold --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wno-sign-compare -Wno-string-plus-int -Wno-deprecated-declarations -Wno-unused-parameter -Wno-unused-const-variable -Wno-conditional-uninitialized -Wno-mismatched-tags -Wno-sometimes-uninitialized -Wno-parentheses-equality -Wno-tautological-compare -Wno-self-assign -Wno-deprecated-register -Wno-deprecated -Wno-invalid-source-encoding -Wno-pointer-sign -Wno-parentheses -Wno-enum-conversion -Wno-c++11-compat-deprecated-writable-strings -Wno-write-strings -gsplit-dwarf' --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --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=dynamic --with-stream_ssl_module --with-http_realip_module --add-dynamic-module=../ngx-fancyindex-0.4.0 --add-module=../ngx_cache_purge-2.3 --add-module=../ngx_devel_kit-0.3.0 --add-module=../set-misc-nginx-module-0.31 --add-module=../echo-nginx-module-0.61 --add-module=../redis2-nginx-module-0.14 --add-module=../ngx_http_redis-0.3.7 --add-module=../memc-nginx-module-0.18 --add-module=../srcache-nginx-module-0.31 --add-module=../headers-more-nginx-module-0.32 --with-pcre=../pcre-8.41 --with-pcre-jit --with-zlib=../zlib-1.2.11 --with-http_ssl_module --with-http_v2_module --with-openssl=../libressl-2.5.5
    
    Code:
    cat /etc/centminmod/custom_config.inc 
    
    LETSENCRYPT_DETECT='y'
    
     
  16. eva2000

    eva2000 Administrator Staff Member

    33,648
    7,448
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,449
    Local Time:
    3:09 PM
    Nginx 1.13.x
    MariaDB 5.5
    in /usr/local/nginx/conf/nginx.conf just comment out with has in front the line
    Code (Text):
    #include /usr/local/nginx/conf/vts_http.conf;
    

    restart nginx though that shouldn't prevent nginx 1.13.8 from updating. You are specifying nginx version = 1.13.8 when running centmin.sh menu option 4 ?

    if nginx upgrade still fails need the upgrade log

    To troubleshoot, you need to check the the 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
     
  17. gamal

    gamal New Member

    24
    2
    3
    Jan 31, 2018
    Ratings:
    +2
    Local Time:
    3:09 PM
    1.13.8
    thank you for fast and reliable support @eva2000, after updating to nginx 1.13.8, my websites are back to life. :)
     
    • Like Like x 1
..