ubuntu下eclipse调试nginx(转)

)Nginx最新代码:

wget http://www.nginx.org/download/nginx-0.9.4.tar.gz   tar -xvf nginx-0.9.4.tar.gz   cd nginx-0.9.4

2)建立Makefile

利用nginx提供的configrue脚本生成Makefile文件:

./configure –without-http_rewrite_module –without-http-cache  –with-debug

注意:这里要指定moduel目录(Nginx源码目录下),还要指定debug编译.

注意:Eclipse 中执行Build project时会执行make clean all,会删除Makefile,故此时应该再执行 configure生成Makefile

可以先make一次,编译出objs/nginx文件。

3)Eclipse中建工程

A)打开eclipse,“File”->“New”->“Makefile  Project with Existing Code”

目录选定为解压出来的源码目录

C-C++ - nginx-0.9.4-src-core-nginx.c - Eclipse

B)配置运行项参数,打开Run configurations 对话框:

C/C++ Application中选择objs/nginx(如果没有,先make一次)

Argruments中填:-c /usr/local/nginx/conf/nginx.conf 指定运行时配置文件,下面还要修改此配置文件。 (因为本人make install过,并且自己修改过配置文件,所以直接使用这个配置文件)

C)修改上一步指定的nginx.conf文件(以下为非完整文件):

不多说,可以参考 这里

好了.直接按F11,看看是不是可以调试了?

 原文:

http://www.cloved.cn/312.html

这篇文章给了不少帮助,make,可以参考以前的一篇文章 编译nginx(需要下载其他三个库的源码)

原文地址:https://www.cnblogs.com/xewnwsl2001/p/2060279.html