安装nginx前准备工作:

1:安装prce

yum install pcre pcre-devel -y

2:安装openssl

yum install openssl openssl-devel

3:若在“./configure”后方加入了“--with-http_gzip_static_module”

则需要安装“zlib-devel”即可。SSH执行以下命令:yum install zlib-devel -y

开始安装nginx

1:添加用户 useradd nginx -s /sbin/nologin  -M

2:配置./configure --user=nginx --group=nginx --prefix=/application/nginx1.6.2

--with-http_stub_status_module --with--http_ssl_modulemake

3:编译 make

4:安装 make install

5:检查语法  /application/sbin/nginx -t

6:启动nginx: /application/sbin/nginx

7;访问本机ip