vi /etc/sysconfig/network-scripts/ifcfg-ens33
systemctl restart network
防火墙
systemctl stop firewalld
systemctl disable firewalld
vi /etc/selinux/config
setenforce 0
yum install gcc gcc-c++
mkdir /lnmp
cd /lnmp/
tar -zxvf zlib-1.2.12.tar.gz
tar -zxvf pcre-8.38.tar.gz
tar -zxvf nginx-1.8.0.tar.gz
cd nginx-1.8.0
./configure --prefix=/lnmp/nginx --with-pcre=/lnmp/pcre-8.38 --with-zlib=/lnmp/zlib-1.2.12
make && make install
域名解析
vi /lnmp/nginx/conf/nginx.conf
>> #gzip on;
>> upstream zhuangyuting{
>> server 192.168.6.52;
>> server 192.168.6.53;
>> server 192.168.6.54;
>> }
>> .......
>> location / {
>> # root html;
>> # index index.html index.htm;
>> proxy_pass http://zhuangyuting;
>> }
/lnmp/nginx/sbin/nginx -s reload
自动运行
vi /etc/rc.local
>> vi /etc/rc.local
chmod +x /etc/rc.d/rc.local