一、安装依赖环境

yum -y install gcc automake autoconf libtool make

yum -y install gcc gcc-c++  pcre-devel openssl openssl-devel

 

二、安装 PCREzlib

PCRE 作用是让 Nginx 支持 Rewrite 功能

1、下载 PCRE 安装包,下载地址: http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz

2、解压安装包:tar -xvzf pcre-8.35.tar.gz

3、进入安装包目录cd pcre-8.35

4、编译安装

./configure

 nginx部署

make && make install

 nginx部署

5、查看pcre版本

 pcre-config --version

 nginx部署 

6zlib是为了gzip压缩,安装zlib

1wget http://www.zlib.net/zlib-1.2.8.tar.gz

2cd zlib-1.2.8

3./configure  --prefix=/usr/local/zlib

4make && make install

 

三、安装openssl

wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz

tar -zxvf openssl-1.0.1t.tar.gz


四、安装 Nginx

1、下载 Nginx,下载地址:http://nginx.org/download/nginx-1.6.2.tar.gz

wget http://nginx.org/download/nginx-1.6.2.tar.gz

nginx部署 

2、解压安装包

tar zxvf nginx-1.6.2.tar.gz

3、进入安装包目录

cd nginx-1.6.2

4、安装

./configure --prefix=/home/wl/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/home/wl/pcre-8.35 --with-openssl=/home/wl/openssl-1.0.1t --with-http_stub_status_module

nginx部署

make

nginx部署

make install

nginx部署 

5、查看nginx版本

/home/wl/nginx/sbin/nginx -v

nginx部署

 

五、Nginx 配置

检查配置文件nginx.conf的正确性命令:

/home/wl/nginx/sbin/nginx -t

nginx部署

 

六、启动 Nginx

Nginx启动命令如下:

/home/wl/nginx/sbin/nginx

 nginx部署


七、访问站点

从浏览器访问我们配置的站点ipport

 nginx部署

相关文章: