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

一、安装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目录下

扫描二维码关注公众号,回复: 3934070 查看本文章

六、解压缩后进入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

猜你喜欢

转载自blog.csdn.net/ATadpole/article/details/83618229