nginx下载地址:https://nginx.org/download/
1.下载
wget https://nginx.org/download/nginx-1.18.0.tar.gz
2.安装依赖
yum -y install gcc gcc-c++ make automake autoconf pcre pcre-devel zlib zlib-devel openssl openssl-devel libtool
3. 解压
tar -vxf nginx-1.18.0.tar.gz
4. 配置信息
./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --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 --with-stream --with-pcre
5. 安装
make && make install
6. 启动
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
标签:http,log,自定义,nginx,--,Nginx,var,path,安装
From: https://www.cnblogs.com/taozhengquan/p/18375621