1、安装prce(重定向支持)和openssl(https支持,如果不需要https可以不安装。)
yum -y install pcre* openssl*
2、解压编译
[root@localhost ~]# cd /data/software
[root@localhost software]# tar -zxvf nginx-1.11.1.tar.gz
[root@localhost software]# mv nginx-1.11.1 /data/server
[root@localhost software]# cd /data/server/nginx-1.11.1
3、安装
[root@localhost nginx-1.11.1]# ./configure --prefix=/usr/local/nginx-1.11.1 --with-http_ssl_module --with-http_stub_status_module --with-pcre
4、[root@localhost nginx-1.11.1]#make && make install
5、更改端口
vi /usr/local/nginx-1.11.1/conf/nginx.conf
6、 开启外部访问的8081端口
[root@localhost mysql-5.7.12]# sudo firewall-cmd --zone=public --add-port=8081/tcp --permanent
[root@localhost ~]# sudo firewall-cmd --reload
7、 开启nginx进程
[root@localhost nginx-1.11.1]# /usr/local/nginx-1.11.1/sbin/nginx
重启或关闭进程
/usr/local/nginx-1.11.1/sbin/nginx -s reload
/usr/local/nginx-1.11.1/sbin/nginx -s stop
8、 测试是否正常运行
yum -y install pcre* openssl*
2、解压编译
[root@localhost ~]# cd /data/software
[root@localhost software]# tar -zxvf nginx-1.11.1.tar.gz
[root@localhost software]# mv nginx-1.11.1 /data/server
[root@localhost software]# cd /data/server/nginx-1.11.1
3、安装
[root@localhost nginx-1.11.1]# ./configure --prefix=/usr/local/nginx-1.11.1 --with-http_ssl_module --with-http_stub_status_module --with-pcre
4、[root@localhost nginx-1.11.1]#make && make install
5、更改端口
vi /usr/local/nginx-1.11.1/conf/nginx.conf
6、 开启外部访问的8081端口
[root@localhost mysql-5.7.12]# sudo firewall-cmd --zone=public --add-port=8081/tcp --permanent
[root@localhost ~]# sudo firewall-cmd --reload
7、 开启nginx进程
[root@localhost nginx-1.11.1]# /usr/local/nginx-1.11.1/sbin/nginx
重启或关闭进程
/usr/local/nginx-1.11.1/sbin/nginx -s reload
/usr/local/nginx-1.11.1/sbin/nginx -s stop
8、 测试是否正常运行
http://10.1.1.245:8081/在浏览器输入地址