一、下载相关的依赖库
pcre 下载地址 http://120.52.73.43/jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gz
openssl 下载地址 https://www.openssl.org/source/openssl-1.0.2h.tar.gz
zlib 下载地址 http://zlib.net/zlib-1.2.8.tar.gz
nginx 下载地址 http://nginx.org/download/nginx-1.10.0.tar.gz
二、解压相关依赖库源码包
cd /tmp
tar -zxf nginx-1.10..tar.gz
tar -zxf pcre-8.38.tar.gz
tar -zxf zlib-1.2..tar.gz
tar -zxf openssl-1.0.2h.tar.gz
三、编译安装Nginx
cd /tmp/nginx-1.10.
./configure --prefix=/usr/local/nginx --pid-path=/usr/local/nginx/logs/nginx.pid --error-log-path=/usr/local/nginx/logs/error.log --http-log-path=/usr/local/nginx/logs/access.log --with-http_ssl_module --with-pcre=/tmp/pcre-8.38 --with-zlib=/tmp/zlib-1.2. --with-openssl=/tmp/openssl-1.0.2h
四、执行make和make install 安装
make && sudo make install
五、验证nginx是否安装成功
/usr/local/nginx/sbin/nginx -v
执行结果:nginx version: nginx/1.10.0
六、启动nginx
/usr/local/nginx/sbin/nginx
浏览器访问localhost: