
一、安装工具
yum -y install zlib zlib-devel openssl openssl-devel pcre-devel cc-c++ autoconf automake
yum -y install gcc automake autoconf libtool make pcre* openssl* zlib zlib-devel bzip2-devel
二、创建用户
groupadd -r nginx
useradd -s /sbin/nologin -g nginx -r nginx
id nginx
三、编译安装
tar zxvf nginx-1.10.1
cd nginx-1.10.1
./configure \
#--prefix=/usr/local/lnmp/nginx-1.10.1 \
#--sbin-path=/usr/sbin/nginx \
#--conf-path=/etc/nginx/nginx.conf \
#--error-log-path=/var/log/nginx/error.log \
#--pid-path=/var/run/nginx/nginx.pid \
#--user=nginx \
#--group=nginx \
--prefix=/usr/local/lnmp/nginx-1.10.1 \
--with-http_ssl_module \
--with-http_flv_module \
--with-http_gzip_static_module \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/tmp/nginx/client \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi \
--with-http_stub_status_module
make && make install
四、创建缺少的目录
mkdir -p /var/tmp/nginx/{client,proxy,fastcgi,uwsgi,scgi}