下载
wget http://nginx.org/download/nginx-1.18.0.tar.gz
预先安装额外的依赖
yum -y install pcre-devel
yum -y install openssl openssl-devel
编译安装NGINX
nginx解压后放在/usr/local/nginx里,在/usr/local/nginx/nginx-1.18.0下,
./configure
make && make install
启动nginx:
/usr/local/nginx/sbin/nginx
如果想停⽌Nginx服务,可执⾏:
/usr/local/nginx/sbin/nginx -s stop
如果修改了配置⽂件后想重新加载Nginx,可执⾏:
/usr/local/nginx/sbin/nginx -s reload
注意其配置⽂件位于:
/usr/local/nginx/conf/nginx.conf