VPS侦探论坛

 找回密码
 注册
查看: 9626|回复: 7

关于Nginx 状态监控

[复制链接]
发表于 2010-11-23 16:12:07 | 显示全部楼层 |阅读模式

我现在想装状态模块stub_status,
网页上提示:在编译Nginx的时候,需要添加以下参数:
--with-http_stub_status_module
请问具体是怎样编译?



在网上发现一款“监控X”(为了避免广告嫌疑,省略一字),可以监控服务器的状态。所以,想试试看。
有没有哪位高手使用过的?不知道耗不耗资源?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2010-11-23 16:49:48 | 显示全部楼层

回复 1# 的帖子



此模块默认已编译。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2010-11-23 23:09:31 | 显示全部楼层

军哥,我用IE打开:http://www.aad.com/status或:http://www.aad.com/nginx-status或:http://www.aad.com/server-status都提示:404 Not Found在上面的监控X里,则提示:您填写的URL不是正确的Nginx状态页面地址。能不能帮我看看原因?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2010-11-23 23:26:29 | 显示全部楼层



我查了下/usr/local/nginx/conf 下面的nginx.conf文件,里面有这么一段
location /status {
stub_status on;
access_log   off;
}
但是,用上面的地址都打不开。
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2010-11-29 14:36:18 | 显示全部楼层

回复 3# 的帖子


默认的状态信息是 http://域名/nginx_status

如果重新加的需要,重启nginx才会生效。

军哥运维代购:http://shop63846532.taobao.com/

发表于 2010-12-2 16:51:33 | 显示全部楼层

我的是重启也是404..压根就没生成那个目录......
是不是我做了空主机头有关系?
发表于 2010-12-2 16:52:01 | 显示全部楼层

  1. user  www www;

  2. worker_processes 4;
  3. worker_cpu_affinity 0001 0010 0100 1000;
  4. error_log  /home/wwwlogs/nginx_error.log  crit;

  5. pid        /usr/local/nginx/logs/nginx.pid;

  6. #Specifies the value for maximum file descriptors that can be opened by this process.
  7. worker_rlimit_nofile 51200;

  8. events
  9.         {
  10.                 use epoll;
  11.                 worker_connections 51200;
  12.         }

  13. http
  14.         {
  15.                 include       mime.types;
  16.                 default_type  application/octet-stream;

  17.                 server_names_hash_bucket_size 128;
  18.                 client_header_buffer_size 32k;
  19.                 large_client_header_buffers 4 32k;
  20.                 client_max_body_size 8m;

  21.                 sendfile on;
  22.                 tcp_nopush     on;

  23.                 keepalive_timeout 60;

  24.                 tcp_nodelay on;

  25.                 fastcgi_connect_timeout 300;
  26.                 fastcgi_send_timeout 300;
  27.                 fastcgi_read_timeout 300;
  28.                 fastcgi_buffer_size 64k;
  29.                 fastcgi_buffers 4 64k;
  30.                 fastcgi_busy_buffers_size 128k;
  31.                 fastcgi_temp_file_write_size 256k;

  32.                 gzip on;
  33.                 gzip_min_length  1k;
  34.                 gzip_buffers     4 16k;
  35.                 gzip_http_version 1.0;
  36.                 gzip_comp_level 2;
  37.                 gzip_types       text/plain application/x-javascript text/css application/xml;
  38.                 gzip_vary on;

  39.                 #limit_zone  crawler  $binary_remote_addr  10m;

  40. server
  41.         {

  42.         listen 80 default;
  43. return 500;

  44.                 location ~ .*\.(php|php5)?$
  45.                         {
  46.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  47.                                 fastcgi_index index.php;
  48.                                 include fcgi.conf;
  49.                         }

  50.                 location /status {
  51.                         stub_status on;
  52.                         access_log   off;
  53.                 }

  54.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  55.                         {
  56.                                 expires      30d;
  57.                         }

  58.                 location ~ .*\.(js|css)?$
  59.                         {
  60.                                 expires      12h;
  61.                         }
  62.   location /idc/nginx-status {
  63.             stub_status on;
  64.             access_log  off;
  65.         }
  66.                 log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
  67.              '$status $body_bytes_sent "$http_referer" '
  68.              '"$http_user_agent" $http_x_forwarded_for';
  69.                 access_log  /home/wwwlogs/access.log  access;
  70.         }

  71. include vhost/*.conf;
  72. }
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2011-2-24 16:27:57 | 显示全部楼层

测试成功   这样就可以了!

http://173.212.254.126/status

http://cs.henyoo.com/status
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-5-3 00:09 , Processed in 0.027924 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表