下载nginx源码
解压nginx压缩包
进入到nginx解压目录
编译检查
./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid --with-http_ssl_module
安装依赖
安装zlib
sudo apt-get install zlib1g-dev
安装pcre
sudo apt-get install libpcre3 libpcre3-dev
安装ssl
apt-get install libssl-dev
安装gcc
sudo apt-get install build-essential
编译
make & make install
启动
cd /usr/local
./nginx/nginx
配置
cat /usr/local/nginx.conf
更新
./nginx/nginx -s reload
停止
./nginx/nginx -s stop