全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 4315|回复: 19

[已解决] 求助,折腾limit_req_module导致tenginge不能正常启动~!

[复制链接]
发表于 2013-5-11 17:58:56 | 显示全部楼层 |阅读模式
  1. user  www www;

  2. worker_processes auto;

  3. error_log  /home/wwwlogs/nginx_error.log  crit;

  4. pid        /usr/local/nginx/logs/nginx.pid;
  5. google_perftools_profiles /tmp/tcmalloc;

  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 50m;

  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.                 limit_req_zone $binary_remote_addr zone=one:3m rate=1r/s;
  41.               limit_req_zone $binary_remote_addr $uri zone=two:3m rate=1r/s;
  42.               limit_req_zone $binary_remote_addr $request_uri zone=three:3m rate=1r/s;

  43.                 #log format
  44.                 log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
  45.              '$status $body_bytes_sent "$http_referer" '
  46.              '"$http_user_agent" $http_x_forwarded_for';

  47. server
  48.         {
  49.                 listen       80;
  50.                 server_name www.mf8.biz;
  51.                 index index.html index.htm index.php;
  52.                 root  /home/www/default;

  53.                 location ~ .*\.(php|php5)?$
  54.                         {
  55.                                 try_files $uri =404;
  56.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  57.                                 fastcgi_index index.php;
  58.                                 include fcgi.conf;
  59.                         }
  60.                        
  61.               sysguard on;

  62.               sysguard_load load=10.5 action=/loadlimit;
  63.               sysguard_mem swapratio=20% action=/swaplimit;

  64.               location /loadlimit {
  65.                       return 503;
  66.              }

  67.               location /swaplimit {
  68.                       return 503;
  69.              }

  70.              location / {
  71.                       limit_req zone=one burst=5;
  72.                       limit_req zone=two forbid_action=@test1;
  73.                       limit_req zone=three burst=3 forbid_action=@test2;
  74.               }
  75.               
  76.                   location /off {
  77.                          limit_req off;
  78.               }

  79.               location @test1 {
  80.                       return 503;
  81.               }

  82.               location @test2 {
  83.                      return 503;
  84.               }

  85.                 location /status {
  86.                         stub_status on;
  87.                         access_log   off;
  88.                 }

  89.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  90.                         {
  91.                                 expires      30d;
  92.                         }

  93.                 location ~ .*\.(js|css)?$
  94.                         {
  95.                                 expires      12h;
  96.                         }

  97.                 access_log  /home/wwwlogs/access.log  access;
  98.         }
  99. include vhost/*.conf;
  100. }
复制代码
折腾那个Tengine的ngx_http_limit_req_module模块出错了,求助~~~

模块的内容:http://tengine.taobao.org/document_cn/http_limit_req_cn.html
发表于 2013-5-11 18:43:18 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2013-5-11 19:16:45 | 显示全部楼层
没玩过
发表于 2013-5-11 19:21:40 | 显示全部楼层
什么错误提示???

发表于 2013-5-11 19:55:07 | 显示全部楼层
@小灰灰
 楼主| 发表于 2013-5-12 13:48:27 | 显示全部楼层
lazyzhu 发表于 2013-5-11 19:21
什么错误提示???

./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --with-http_limit_req_module=shared --with-http_sysguard_module --with-http_concat_module --with-google_perftools_module编译环境
发表于 2013-5-12 14:02:56 | 显示全部楼层
--with-http_limit_req_module=shared

需要加

dso {
     load http_limit_req_module.so;
}
 楼主| 发表于 2013-5-12 14:07:12 | 显示全部楼层
本帖最后由 ivmm 于 2013-5-12 14:08 编辑
lazyzhu 发表于 2013-5-12 14:02
--with-http_limit_req_module=shared

需要加


--with-http_limit_req_module=shared  用了无法编译啊

应该+在那个位置?
发表于 2013-5-12 14:08:25 | 显示全部楼层
ivmm 发表于 2013-5-12 14:07
--with-http_limit_req_module=shared  用了无法编译啊

默认就编译,不用加任何东西
 楼主| 发表于 2013-5-12 14:16:23 | 显示全部楼层
lazyzhu 发表于 2013-5-12 14:08
默认就编译,不用加任何东西

其实这个在编译里早+了。。

主要是
需要加

dso {
      load http_limit_req_module.so;
}

应该放在那个位置?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-21 08:28 , Processed in 0.068548 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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