下载nginx安装包并解压
在 /opt/soft 内下载Nginx
wget -c https://nginx.org/download/nginx-1.18.0.tar.gz
tar zxvf nginx-1.18.0.tar.gz -C /opt/module/
解压完之后, /opt/module/ ⽬录中会出现⼀个 nginx-1.18.0
的⽬录
安装Nginx
预先安装额外的依赖
yum -y install pcre-devel
yum -y install openssl openssl-devel
译安装Nginx
cd nginx-1.17.10
./configure
make && make install
#安装完成后,Nginx的可执⾏⽂件位置位于
/usr/local/nginx/sbin/nginx
启动Nginx
#其配置⽂件位于:
/usr/local/nginx/conf/nginx.conf
#启动
/usr/local/nginx/sbin/nginx
#停止
/usr/local/nginx/sbin/nginx -s stop
#重新加载conf
/usr/local/nginx/sbin/nginx -s reload