ubantu22下nginx1.22.1编译安装

##获取源码

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= 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= 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

你可能感兴趣的:(nginx,服务器,运维)