##安装依赖包
[root@localhost ~]yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
##进入安装目录安装PCRE
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]#
wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
[root@localhost src]# tar zxf pcre-8.35.tar.gz
[root@localhost src]# cd pcre-8.35
##脚本安装
[root@localhost pcre-8.35]#./configure
[root@localhost pcre-8.35]#make && make install
安装nginx
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# wget http://nginx.org/download/nginx-1.6.2.tar.gz
[root@localhost ~]# tar -zxf nginx-1.6.2.tar.gz
[root@localhost ~]cd nginx-1.6.2
[root@localhost ~]./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35
[root@localhost ~]make && make install
##查看nginx版本
[root@localhost ~]# /usr/local/webserver/nginx/sbin/nginx -v
开启nginx
[root@localhost ~]# /usr/local/webserver/nginx/sbin/nginx
开启防火墙80端口 ,重启也生效
[root@localhost ~]# firewall-cmd --query-port=80/tcp --permanent
no
[root@localhost ~]# firewall-cmd --add-port=80/tcp --permanent
success
[root@localhost ~]# systemctl restart firewalld