Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display_handler::shm_init() failed #2

Open
Joungkyun opened this issue Apr 15, 2017 · 1 comment
Open

display_handler::shm_init() failed #2

Joungkyun opened this issue Apr 15, 2017 · 1 comment

Comments

@Joungkyun
Copy link

Joungkyun commented Apr 15, 2017

OS: CentOS 6.9

Nginx info:

  • 1.12.0
  • build with dynamic module
    • /usr/lib64/nginx/ngx_http_stream_server_traffic_status_module.so
    • /usr/lib64/nginx/ngx_stream_server_traffic_status_module.so
      --add-dynamic-module=nginx-module-sts-0.1.0 --add-dynamic-module=nginx-module-stream-sts-0.1.0
  • order of load module
    • check 3 case and get same results.
load_module "/usr/lib64/nginx/ngx_stream_module.so";
load_module "/usr/lib64/nginx/ngx_stream_server_traffic_status_module.so";
load_module "/usr/lib64/nginx/ngx_http_stream_server_traffic_status_module.so";

or

load_module "/usr/lib64/nginx/ngx_stream_module.so";
load_module "/usr/lib64/nginx/ngx_stream_server_traffic_status_module.so";
load_module "/usr/lib64/nginx/ngx_http_stream_server_traffic_status_module.so";

or

load_module "/usr/lib64/nginx/ngx_http_stream_server_traffic_status_module.so";

nginx-module-stream-sts : 0.1.0 release version

nginx config:

load_module "/usr/lib64/nginx/ngx_http_geoip_module.so";
#load_module "/usr/lib64/nginx/ngx_http_image_filter_module.so";
#load_module "/usr/lib64/nginx/ngx_http_perl_module.so";
load_module "/usr/lib64/nginx/ngx_http_stream_server_traffic_status_module.so";
#load_module "/usr/lib64/nginx/ngx_http_vhost_traffic_status_module.so";
#load_module "/usr/lib64/nginx/ngx_http_xslt_filter_module.so";
#load_module "/usr/lib64/nginx/ngx_mail_module.so";
#load_module "/usr/lib64/nginx/ngx_stream_module.so";
#load_module "/usr/lib64/nginx/ngx_stream_geoip_module.so";
#load_module "/usr/lib64/nginx/ngx_stream_server_traffic_status_module.so";

http {
     ...
    stream_server_traffic_status on;
    stream_server_traffic_status_zone;
    ...

    server {

        listen     80 default_server;
        server_name  _;

        location / {
            try_files     $uri $uri/ =404;
            root          /usr/share/nginx/html;
            index         index.html index.php;
        }

        location ~ ^/(robots\.txt|favicon\.ico)($|/) {
            log_not_found off;
            access_log off;
        }

        localtion /status {
            stream_server_traffic_status_display;
            stream_server_traffic_status_display_format html;
        }

        # Error documents
        location ~ /nginx-error/error.html {
            internal;
            alias /usr/share/nginx/html/error.html;

            ssi on;
            set $hstatus $args;
            access_log off;
        }

        # Fancyindex
        location /fancyindex/ {
            alias /usr/share/nginx/fancyindex/;
        }

        #
        # logging off
        #
        location = /robots.txt {
            log_not_found off;
            access_log    off;
        }

        location = /favicon.ico {
            log_not_found off;
            access_log    off;
        }

        location ~ \.(dat|cfg|orig|org|bak|rpmsave|save|,v|tpl|la?ng|modules?|engines?|install|inc|ini|ph)$ {
            deny all;
        }

        location ~ \.(htaccess|htgroup|htpasswd) {
            deny all;
        }

        location ~ /(temp|sessions?|class(es)?)/ {
            deny all;
        }
    }
}

And access http://domain.com/status, occurs follow error:

[error] 10391#0: *1 display_handler::shm_init() failed, client: 192.168.0.1, server: _, request: "GET /status HTTP/1.1", host: "domain.com"
@vozlt
Copy link
Owner

vozlt commented Apr 17, 2017

Hi, Thanks for reporting.
Please make sure you use the server_traffic_status_zone directive.
The directive server_traffic_status_zone in stream block is essential because the shared memory zone using in nginx-module-sts, nginx-module-stream-sts is allocated by that directive.
The process finding shared memory zone is as follows:

  1. nginx-module-stream-sts -> server_traffic_status_zone -> Allocate shared memory zone
  2. nginx-module-sts -> stream_server_traffic_status_display -> Find shared memory zone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants