|
|
|
@ -87,9 +87,9 @@ image::./imgs/nginx-src-structure.png[Nginx源码结构]
|
|
|
|
|
# -O0 -DNDEBUG 允许compiler debugging
|
|
|
|
|
# --with-debug 开启nginx debugging
|
|
|
|
|
# -fexec-charset=GBK 允许nginx输出中文
|
|
|
|
|
./configure --with-cc-opt="-O0 -DNDEBUG -fexec-charset=GBK -g3 -gdwarf-2" --with-debug --prefix=/opt/nginx --with-http_ssl_module --add-module=/workspaces/cpp-5/nginx_upstream_check_module
|
|
|
|
|
./configure --with-cc-opt="-O0 -DNDEBUG -fexec-charset=GBK -g3 -gdwarf-2 -fsanitize=address -DNGX_DEBUG_PALLOC=1" --with-debug --prefix=/opt/nginx --with-http_ssl_module --add-module=/workspaces/cpp-5/nginx_upstream_check_module
|
|
|
|
|
----
|
|
|
|
|
其中,+++--prefix+++表示nginx安装目录;+++--with-debug+++允许nginx打开debug模式,并与+++-O0 -g3 -DNDEBUG -gdwarf-2+++配合,避免由于编译优化导致部分调试信息丢失;+++--add-module+++指定开源模块的源码路径。
|
|
|
|
|
其中,+++--prefix+++表示nginx安装目录;+++--with-debug+++允许nginx打开debug模式,并与+++-O0 -g3 -DNDEBUG -gdwarf-2+++配合,避免由于编译优化导致部分调试信息丢失;+++--add-module+++指定开源模块的源码路径。 +++-fsanitize=address -DNGX_DEBUG_PALLOC=1+++将屏蔽nginx memory pool,并允许内存debug
|
|
|
|
|
|
|
|
|
|
使用以下命令执行脚本:
|
|
|
|
|
[source,shell]
|
|
|
|
@ -141,12 +141,12 @@ image::./imgs/debug-nginx.png[调试nginx]
|
|
|
|
|
|
|
|
|
|
参考:
|
|
|
|
|
|
|
|
|
|
1. 负载均衡:link:https://www.nginx.org.cn/article/detail/440[]
|
|
|
|
|
2. 高可用配置:link:https://blog.csdn.net/IT_10/article/details/89365436[]
|
|
|
|
|
3. nginx开发:link:https://tengine.taobao.org/book/[]
|
|
|
|
|
4. nginx开发入门:link:https://www.nginx.org.cn/article/detail/443[]
|
|
|
|
|
5. nginx中文文档:link:https://wizardforcel.gitbooks.io/nginx-doc/content/index.html[]
|
|
|
|
|
6. nginx开发:link:https://www.kancloud.cn/kancloud/master-nginx-develop/51798[]
|
|
|
|
|
1. 负载均衡解释:link:https://www.nginx.org.cn/article/detail/440[]
|
|
|
|
|
2. 高可用配置示例:link:https://blog.csdn.net/IT_10/article/details/89365436[]
|
|
|
|
|
3. nginx开发参考1:link:https://tengine.taobao.org/book/[]
|
|
|
|
|
4. nginx开发参考2:link:https://www.nginx.org.cn/article/detail/443[]
|
|
|
|
|
5. nginx中文配置手册:link:https://wizardforcel.gitbooks.io/nginx-doc/content/index.html[]
|
|
|
|
|
6. nginx开发参考3:link:https://www.kancloud.cn/kancloud/master-nginx-develop/51798[]
|
|
|
|
|
|
|
|
|
|
== 四. 开发流程
|
|
|
|
|
|
|
|
|
|