源码编译安装nginx

nginx版本:1.22

安装依赖包:

#yum -y install pcre-devel openssl openssl-devel  GeoIP-devel.x86_64

#cd nginx-1.22.0/

#./configure --prefix=/export/server/nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_geoip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module

#make && make install

添加stream模块

查看编译安装命令

#./nginx -V

#./configure --prefix=/export/server/nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_geoip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-stream

#执行make (不要执行make install)

# make

备份nginx源文件

cp nginx nginx.bak

覆盖源nginx文件

cp -fp objs/nginx /export/server/nginx/sbin/

查看编译模块

/export/server/nginx/sbin/nginx -V

 

posted @ 2022-09-13 09:47  fighting-go  阅读(41)  评论(0)    收藏  举报