脚本宝典收集整理的这篇文章主要介绍了centos 6.8安装nginx,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
记录安装nginx过程
1.下载4个压缩包:
pcre,rewrITe模块要用到,下载地址:https://ftp.pcre.org/pub/pcre/
zlib,gzip模块要用到,下载地址:http://www.zlib.net/zlib-1.2....
oPEnssl,ssl模块用到,下载地址:https://www.openssl.org/source/
nginx,下载地址:http://nginx.org/en/download....
2.将它们放到/usr/local/下
3.安装pcre
# cd /usr/local/
# tar -zxvf pcre-8.38.tar.gz
# cd pcre-8.38
# ./configure
# make
# make install
4.安装zlib
# cd /usr/local/
# tar -zxvf zlib-1.2.11.tar.gz
# cd zlib-1.2.11
# ./configure
# make
# make install
5.安装openssl
# cd /usr/local/
# tar -zxvf openssl-1.0.2l.tar.gz
# cd openssl-1.0.2l
# ./configure
# make
# make install
6.安装nginx
# cd /usr/local/
# tar -zxvf nginx-1.12.1.tar.gz
# cd nginx-1.12.1
# ./configure --PRefix=/usr/local/nginx --with-pcre=/usr/local/pcre-8.38 --with-zlib=/usr/local/zlib-1.2.11 --with-openssl=/usr/local/openssl-1.0.2l
# make
# make install
7.安装完成,启动nginx
# /usr/local/nginx/sbin/nginx
笔记:中间如果有报错You need a C++ compiler for C++ support,需要安装gcc+:
# yum install -y gcc gcc-c++
以上是脚本宝典为你收集整理的centos 6.8安装nginx全部内容,希望文章能够帮你解决centos 6.8安装nginx所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。