1、添加源

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
通过yum search nginx看看是否已经添加源成功。如果成功则执行下列命令安装Nginx。

2、安装Nginx

yum install -y nginx

3、启动Nginx并设置开机自动运行

systemctl start nginx.service
systemctl enable nginx.service
重启
systemctl restart nginx.service

4、目录

/etc/nginx
Last modification:February 13th, 2020 at 03:48 pm
如果觉得我的文章对你有用,请随意赞赏