nginx ngx_http_limit_conn_module,nginx


环境: ubuntu 16.04  apt-get 模式安装nginx 

添加新模块 ngx_http_limit_conn_module 和 ngx_http_limit_req_module

1.下载nginx source  链接nginx/1.10.3

2. sudo nginx -V 

nginx version: nginx/1.10.3
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 
built with OpenSSL 1.0.2k  26 Jan 2017
TLS SNI support enabled
configure arguments: --with-cc-opt='-g .....

3. 解压nginx.tar.gz 复制 --with 后面配置参数 ./configure   复制 --with 后面配置参数 
加上  --add-module=ngx_http_limit_req_module --add-module=ngx_http_limit_reg_module 


tips:  
1.这里使用--add-module (使用--add-dynamic-module 应该也可以没有测试) 而非 --with-ngx....
2.如果出现 ./configure: error: no ngx_http_limit_req_module/config was found 错误
个人通过手动创建这个文件 mkdir ngx_http_limit_req_module && touch ngx_http_limit_req_module/config 解决
3. 可能出现的一些库不存在的处理
//limxslt
sudo apt-get install libxml2 libxml2-dev libxslt-dev


//the HTTP image filter module requires the GD library.


sudo apt-get install libgd2-xpm libgd2-xpm-dev 

//the GeoIP module requires the GeoIP library.


sudo apt-get install geoip-database libgeoip-dev


需要添加的module 根据自己的环境自行决定舍取.


相关内容

    暂无相关文章