配置yum源
mkdir -p /etc/yum.repos.d/repo_bak/
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/repo_bak/
cd /etc/yum.repos.d
wget http://mirrors.myhuaweicloud.com/repo/mirrors_source.sh && sh mirrors_source.sh
清除原有yum缓存
yum clean all
执行生成新的缓存
yum makecache
安装
yum -y install nginx
启动
systemctl start nginx
查看状态
systemctl status nginx
yum方式安装后默认配置文件的路径
/etc/nginx/nginx.conf
nginx网站默认存放目录
/usr/share/nginx/html
网站默认主页路径
/usr/share/nginx/html/index.html
查到nginx master 进程的pid为2160805
ps aux | grep nginx
pid 为上面查询出来的nginx master进程号
netstat -anp | grep 2160805