1、Mac连接远程服务器
ssh -l root 服务器IP
然后输入你的服务器密码登陆
2、安装依赖
yum install gcc-c++
yum install -y openssl openssl-devel
yum install -y zlib zlib-devel
yum install -y pcre pcre-devel
3、安装nginx
wget http://nginx.org/download/nginx-1.16.0.tar.gz
tar -zxvf nginx-1.16.0.tar.gz
cd nginx-1.16.0
./configure && make && make install
4、添加至全局变量
ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx