1 . 安装依赖包 :
yum install -y gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
2 . 下载源码包:`wget http://nginx.org/download/nginx-1.8.1.tar.gz
3 . 解压:tar zxvf nginx-1.8.1.tar.gz
4 . 进入解压后目录:cd nginx-1.8.1/
5 . 编译配置:
./configure --prefix=/usr/local/nginx --pid-path=/var/local/nginx/nginx.pid --lock-path=/var/lock/nginx/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --http-client-body-temp-path=/var/temp/nginx/client --http-proxy-temp-path=/var/temp/nginx/proxy --http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --http-scgi-temp-path=/var/temp/nginx/scgi
6 . 编译:make
7 . 安装:make install