安装依赖包
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel

image.png

安装正则匹配库
wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
tar zxvf pcre-8.35.tar.gz
cd pcre-8.35
./configure
make && make install

查看版本

pcre-config –-version

image.png

下载nginx包

官网地址:http://nginx.org/download
wget http://nginx.org/download/ngi...

tar zxvf nginx-1.14.2.tar.gz
cd nginx-1.14.2
./configure --prefix=/opt/nginx --with-http\_stub\_status\_module --with-http\_ssl\_module --with-pcre=/usr/local/src/pcre-8.35
make && make install

查看版本是否安装成功

/opt/nginx/sbin/nginx -v

image.png

再sbin目录下执行./nginx 然后再浏览器输入你的IP地址你就可以看到如下网页
image.png


LeeYonghu
4 声望0 粉丝