ubuntu16.04 nginx安装

1、gcc、g++依赖库
apt-get install build-essential
apt-get install libtool

2、安装 pcre依赖库(http://www.pcre.org/)
sudo apt-get install libpcre3 libpcre3-dev

3、安装 zlib依赖库(http://www.zlib.net)
apt-get install zlib1g-dev

4、安装ssl依赖库(ubuntu16.04 LTS 已经安装过了)
apt-get install openssl

5、安装nginx
cd /home/ubuntu/dev
sudo tar -zxvf nginx-1.10.2
cd nginx-1.10.2/
sudo ./configure sudo make sudo make install 6、启动、停止、重载配置、测试配置文件是否正确 ubuntu@VM-85-8-ubuntu:~$ cd /usr/local/nginx/sbin ## 启动 ubuntu@VM-85-8-ubuntu:/usr/local/nginx/sbin$ sudo ./nginx ## 停止 ubuntu@VM-85-8-ubuntu:/usr/local/nginx/sbin$ sudo ./nginx -s stop ## 检测配置文件是否正确 ubuntu@VM-85-8-ubuntu:/usr/local/nginx/sbin$ sudo ./nginx -t #重载配置文件 ubuntu@VM-85-8-ubuntu:/usr/local/nginx/sbin$ sudo ./nginx -s reload

 

posted on 2017-06-26 14:59  Ruthless  阅读(436)  评论(0编辑  收藏  举报