ubantu22下nginx1.22.1编译安装

发布时间:2023年12月26日

##获取源码

wget http://nginx.org/download/nginx-1.22.1.tar.gz

##报错configure: error: the HTTP rewrite module requires the PCRE library安装依赖

apt-get install libpcre3 libpcre3-dev
./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=<path> option.

##报错configure: error: the HTTP gzip module requires the zlib library安装依赖

apt install zlib1g-dev
./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=<path> option.

##配置

./configure --prefix=/home/yym/sjjf_nginx/nginx_debug/ --with-http_addition_module --with-http_realip_module --with-http_stub_status_module --with-ipv6 --with-cc-opt='-O0 -g'

##编译

make CFLAGS="-g -oO"

##安装

make install

文章来源:https://blog.csdn.net/u014200244/article/details/135203914
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。