安装依赖环境:
# yum -y install gcc gcc-c++ autoconf automake
# yum -y install zlib zlib-devel openssl openssl-devel pcre-devel
新建用户组和用户:
# sudo groupadd -r www
# sudo useradd -s /sbin/nologin -g www -r www
创建安装目录
# mkdir /usr/local/tools
# cd /usr/local/tools
# wget
http://nginx.org/download/nginx-1.10.1.tar.gz# tar -zxvf nginx-1.10.1.tar.gz
# cd nginx-1.10.1
# ./configure --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --user=www --group=www --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module
# make && make install