Nginx模块如何调试
来源:互联网 发布:珠三角物流网络 编辑:程序博客网 时间:2024/06/07 19:05
编写nginx.conf,将nginx设置为单进程调试模式
为了方便使用调试器, 可以单进程非daemon方式启动, 使用参数:
编写模块ngx_module_echo
在ngx_module_echo
回到nginx的源码目录进行安装:
然后运行一下看看,先测一下配置文件的正确性:
运行之:
在另一个终端执行一个curl:
- worker_processes 1;
- error_log logs/error.log debug; # 记录调试日志
- master_process off; # 单进程模式
- daemon off;
- pid /tmp/nginx_debug.pid;
- events {
- worker_connections 1024;
- }
- http {
- include /etc/nginx/mime.types;
- sendfile on;
- keepalive_timeout 65;
- tcp_nodelay on;
- server {
- listen 80;
- server_name localhost;
- access_log /tmp/access.log;
- error_log /tmp/error.log debug;
- location /hello {
- echo "helloworld";
- }
- }
- }
为了方便使用调试器, 可以单进程非daemon方式启动, 使用参数:
- daemon off;
- master_process off;
编写模块ngx_module_echo
在ngx_module_echo
回到nginx的源码目录进行安装:
- ~/nginx-0.8.9/#./configure --add-module=/home/doyoueat/ngx_module_echo/ --with-debug
- make
- sudo make install
然后运行一下看看,先测一下配置文件的正确性:
- ~/nginx-0.8.9/#./objs/nginx -c /home/doyoueat/ngx_module_echo/nginx.conf -t
- the configuration file /home/doyoueat/ngx_module_echo/nginx.conf syntax is ok
- configuration file /home/doyoueat/ngx_module_echo/nginx.conf test is successful
运行之:
- ~/nginx-0.8.9/#./objs/nginx -c /home/renlu/ngx_module_echo/nginx.conf
在另一个终端执行一个curl:
- ~#curl http://127.0.0.1/hello
- helloworld
0 0
- Nginx模块如何调试
- Linux使用eclipse编译,调试Nginx模块
- Linux使用eclipse编译,调试Nginx模块
- How to debug NginX? 如何调试NginX
- nginx 如何安装 nginx_lua_module 模块 以及 echo-nginx-module 模块
- nginx模块_使用gdb调试nginx源码
- nginx模块_使用gdb调试nginx源码
- nginx模块_使用gdb调试nginx源码
- nginx模块_使用gdb调试nginx源码
- nginx模块_使用gdb调试nginx源码
- 如何安装nginx第三方模块
- 如何安装nginx第三方模块
- 如何安装nginx第三方模块
- nginx-如何将自己的HTTP模块编译进nginx
- mtk Android如何调试recovery模块
- NGINX模块
- nginx模块
- nginx模块
- 史上最全的Java&Android面试题搜集整理
- MFC Radio Button 使用 分组 RadioButton 用法
- Spring中加载配置文件的方式
- resources中的color 设置
- 从零开始,DIY一个jQuery(1)
- Nginx模块如何调试
- 欢迎使用CSDN-markdown编辑器
- muduo : TcpServer
- Tomcat的8005、8009,8080端口解释
- 文件操作
- Oracle/SQL 修改字段类型和长度
- 100. Same Tree
- poj 1251
- 2629 Identity Card