1.准备三台ubuntu版本的虚拟机
2.开始安装,下载,解压,以及编译nginx所需的环境依赖


这里需要注意我们创建了一个新的目录 /home/nginx,所以在编译中记得更改

然后再编译过程中我们会发现提示无法编译,原因是缺少c语言的插件,直接apt-get install gcc下载一个

重新编译还是不行,因为缺少了pcre正则表达库
那就继续安装(sudo apt install libpcre3 libpcre3-dev )

继续编译,仍旧缺少openssl库
下载安装openless库(sudo apt-get install openssl libssl-dev 执行编译并安装)
到这可以看到完成编译,安装位置在 /home/nginx, (但是未完全编译,真正编译需要用到 make && make install,此处仍旧缺少make命令,使用apt-get install make 下载关于make的命令,再继续
到这已经完成了百分之70了,ping一下验证之前操作

下来就是选中一个主机更改权重,如果采用一键安装 apt-get install nginx (配置文件在/etc/nginx下,日志文件在/var/log/nginx),手动则不变
可以改改个html试试

然后利用指令 cd /home/syf1/nginx/conf 再 vim nginx.conf 进更改权重
