Learn about Centmin Mod LEMP Stack 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

    2,767
    245
    63
    May 31, 2014
    Ratings:
    +436
    Local Time:
    12:39 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

    30,569
    6,854
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,274
    Local Time:
    8:39 AM
    Nginx 1.13.x
    MariaDB 5.5
    whoops forgot to add a conditional check for this
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,569
    6,854
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,274
    Local Time:
    8:39 AM
    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

    2,767
    245
    63
    May 31, 2014
    Ratings:
    +436
    Local Time:
    12:39 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

    30,569
    6,854
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,274
    Local Time:
    8:39 AM
    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

    2,767
    245
    63
    May 31, 2014
    Ratings:
    +436
    Local Time:
    12:39 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

    30,569
    6,854
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,274
    Local Time:
    8:39 AM
    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

    2,767
    245
    63
    May 31, 2014
    Ratings:
    +436
    Local Time:
    12:39 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

    30,569
    6,854
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,274
    Local Time:
    8:39 AM
    Nginx 1.13.x
    MariaDB 5.5
    ok will investigate :)
     
  10. pamamolf

    pamamolf Well-Known Member

    2,767
    245
    63
    May 31, 2014
    Ratings:
    +436
    Local Time:
    12:39 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