解压:
tar -zxvf nginx-1.18.0.tar.gz
安装:
cd /mnt/nginx-1.18.0
yum install gcc gcc-c++ automake pcre pcre-devel zlip zlib-devel openssl openssl-devel
./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-pcre
make install
cd /usr/local/nginx/sbin/
id nginx
useradd -s /sbin/nologin -M nginx
id nginx
mkdir -p /var/tmp/nginx/client/
#创建nginx日志文件路径
mkdir -p /mnt/logs/nginx/
cd /usr/local/nginx/sbin/
#启动
./nginx
#重启
./nginx -s reload
#停止
./nginx -s stop
#看进程
ps -ef|grep nginx