记录安装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

8.访问服务器ip查看是否成功,完

笔记:中间如果有报错You need a C++ compiler for C++ support,需要安装gcc+:

# yum install -y gcc gcc-c++

叽里呱啦
167 声望0 粉丝