niginx模块开发第一个示例

来源:互联网 发布:js原型面试题 编辑:程序博客网 时间:2024/06/07 08:05

niginx模块开发第一个示例


参考书籍 《深入理解nginx 模块开发与架构解析》


模块 ngx_http_mytest_module


代码  https://www.cnblogs.com/hanerfan/p/6126832.html


执行 congiure

./configure --add-module=/home/tan/code_study/ngx_http_mytest_module --prefix=/home/tan/nginx_test

如果编译为debug版本需要加 --with-debug

如果提示错误 ./configure: error: can not detect int size,需先执行  export CFLAGS="-Werror" 后执行

./configure --add-module=/home/tan/code_study/ngx_http_mytest_module --prefix=/home/tan/nginx_test --with-cpu-opt=pentiumpro