centos 编译安装 nginx

一、安装前准备

yum install zlib openssl pcre openssl-devel pcre-devel zlib-devel

二、安装

./configure 
--prefix=/usr/local/nginx \
--error-log-path=/var/log/nginx/error.log \
--user=nginx \
--group=nginx \
--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/ \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi/ 
--http-scgi-temp-path=/var/tmp/nginx/scgi/
make && make install

以上的配置用户是nginx,所在用户组是nginx

三、配置用户nginx

groupadd nginx
useradd -g nginx nginx

四、运行

cd /usr/local/nginx/sbin
./nginx

五、补充

现在openresty已经包含了很多模块,安装即可以快速的应用.

原文地址:https://www.cnblogs.com/zhuangzebo/p/3115183.html