#安装编译工具及库文件
>yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
#下载 PCRE 安装包
https://sourceforge.net/projects/pcre/files/pcre/
#解压pcre
>tar zxvf pcre-8.35.tar.gz
#进入安装包目录
>cd pcre-8.35
#编译安装
>./configure
>make && make install
#nginx下载地址
http://nginx.org/download/
#解压nginx
>tar -vxf nginx-1.9.9.tar.gz
#编译
> cd nginx-1.9.9/
>./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module
//--with-pcre=/usr/local/src/pcre-8.35
--without-http_rewrite_module
>make && make install
#创建 Nginx 运行使用的用户 www
>/usr/sbin/groupadd www
>/usr/sbin/useradd -g www www
#修改配置文件
>vi /usr/local/webserver/nginx/conf/nginx.conf
user www www;
port 8090
#测试配置文件
>/usr/local/webserver/nginx/sbin/nginx -t
#启动
/usr/local/webserver/nginx/sbin/nginx
#其他命令
/usr/local/webserver/nginx/sbin/nginx -s reload # 重新载入配置文件
/usr/local/webserver/nginx/sbin/nginx -s reopen # 重启 Nginx
/usr/local/webserver/nginx/sbin/nginx -s stop # 停止 Nginx