centos7下编译带debug功能nginx

##查看内核版本

[yym@localhost code]$ uname -a
Linux localhost.localdomain 5.4.263-1.el7.elrepo.x86_64 #1 SMP Fri Dec 8 19:44:51 EST 2023 x86_64 x86_64 x86_64 GNU/Linux

[yym@localhost code]$ cat /proc/version
Linux version 5.4.263-1.el7.elrepo.x86_64 (root@68e0b5963fa3433dacf297ada3c1b494) (gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)) #1 SMP Fri Dec 8 19:44:51 EST 2023

##获取nginx源码

[yym@localhost code]$

##配置

[yym@localhost code]$ cd /home/yym/code/nginx-1.22.1

[yym@localhost code]$ ./configure --prefix=/home/yym/code/nginx_debug/ --with-http_addition_module --with-http_realip_module --with-http_stub_status_module --with-ipv6 --with-cc-opt='-O0 -g'

##报错

./configure: error: the HTTP rewrite module requires the PCRE library.

You can either disable the module by using --without-http_rewrite_module

option, or install the PCRE library into the system, or build the PCRE library

statically from the source with nginx by using --with-pcre= option

[yym@localhost code]$ ##yum install pcre.x86_64 ##阿里云yum源 还是失败

##使用原始yum源

##安装pcre pcre-devel

[yym@localhost code]$ yum install pcre pcre-devel

##报错

./configure: error: the HTTP gzip module requires the zlib library.

You can either disable the module by using --without-http_gzip_module

option, or install the zlib library into the system, or build the zlib library

statically from the source with nginx by using --with-zlib= option

##安装zlib-devel

[yym@localhost code]$ yum install -y zlib-devel

##编译

[yym@localhost code]$ make CFLAGS="-g -oO"

##安装

[yym@localhost code]$ make install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值