环境:
centos7 192.168.186.140 (负载均衡)
centos7 192.168.186.141 (web端)
centos7 192.168.186.142 (web端)
1. 关闭防火墙与setenforce
web端也要执行
[root@140 ~]# systemctl stop firewalld
[root@140 ~]# setenforce 0
2. 安装NGINX依赖包
[root@140 ~]# yum -y install gcc gcc-c++ openssl-devel openssl-devel
3. 上传NGINX源码包
[root@140 ~]# ll
总用量 960
-rw-r--r--. 1 root root 981687 10月 16 20:05 nginx-1.12.2.tar.gz
4.解压源码包
[root@140 ~]# tar xzf nginx-1.12.2.tar.gz
5.编译安装NGINX
[root@140 ~]# cd nginx-1.12.2/
[root@140 nginx-1.12.2]# ./configure && make && make install
6.修改NGINX配置文件
[root@140 nginx-1.12.2