nginx 笔记
(1) 安装依赖
yum install gcc gcc-c++ autoconf automake -y
yum install zlib zlib-devel openssl openssl-devel pcre pcre-devel -y
yum install wget vim -y
(2) 下载nginx
wget http://nginx.org/download/nginx-1.18.0.tar.gz
(3) 安装
tar -zxvf nginx-1.18.0.tar.gz -C /usr/local/
cd /usr/local/nginx-1.18.0
./configure --prefix=/usr --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 --lock-path=/var/lock/nginx.lock
--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
make && make install
(4) 启动nginx
nginx -c /etc/nginx/nginx.conf
ps -ef |grep nginx
kill - QUIT "nginx 主进程号" #从容停止nginx
kill - TERM "nginx 主进程号" #立即停止nginx
nginx -t #检查nginx语法
kill - HUP "nginx主进程号" #平滑重启
nginx -s reload #平滑重载