centos 6.x和7.x 下nginx安装与配置

本文详细介绍如何在Linux环境下从零开始安装Nginx及其所需依赖库,包括gcc、pcre、zlib和openssl等,并引入了两个额外的Nginx模块:headers-more-nginx-module和ngx_http_substitutions_filter_module,用于增强Nginx的功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、安装gcc(命令:yum install gcc)

  备注:可以输入gcc -v 查询版本信息,看系统是否自带安装

二、安装pcre(命令: yum install pcre-devel)

三、安装zlib

四、安装openssl

综合命令:

  yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel

五、下载nginx

下载nginx额外模块:

  headers-more-nginx-module-0.29(请求头设置模块)、ngx_http_substitutions_filter_module-master(内容替换模块)

  解压缩到nginx目录下

六、解压缩后进入nginx目录执行

  ./configure --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --add-module=<NGINX_DIR>/headers-more-nginx-module-0.29 --add-module=<NGINX_DIR>/ngx_http_substitutions_filter_module-master

七、继续执行:make

八:执行:make install

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值