、gcc、g++依赖库
apt-get install build-essential
apt-get install libtool
、安装 pcre依赖库(http://www.pcre.org/)
sudo apt-get install libpcre3 libpcre3-dev
、安装 zlib依赖库(http://www.zlib.net)
apt-get install zlib1g-dev
、安装ssl依赖库(ubuntu16. LTS 已经安装过了)
apt-get install openssl
、安装nginx
cd /home/ubuntu/dev
sudo tar -zxvf nginx-1.10.2
cd nginx-1.10.2/
sudo ./configure
sudo make
sudo make install
、启动、停止、重载配置、测试配置文件是否正确
ubuntu@VM---ubuntu:~$ cd /usr/local/nginx/sbin
## 启动
ubuntu@VM---ubuntu:/usr/local/nginx/sbin$ sudo ./nginx
## 停止
ubuntu@VM---ubuntu:/usr/local/nginx/sbin$ sudo ./nginx -s stop
## 检测配置文件是否正确
ubuntu@VM---ubuntu:/usr/local/nginx/sbin$ sudo ./nginx -t
#重载配置文件
ubuntu@VM---ubuntu:/usr/local/nginx/sbin$ sudo ./nginx -s reload