在阿里云镜像网站下载epel源

阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区icon-default.png?t=M4ADhttps://developer.aliyun.com/mirror/在centos  yum源里没有提供rpm包,epel源里提供了nginx  rpm包。

找到对应版本的epel源配置

安装wget工具

yum -y install wget     wget是liunx的命令下载工具

下载阿里提供的epel源

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

安装nginx 

 yum -y install nginx

启动nginx

 systemctl start nginx

 关闭翻火墙

 systemctl stop firewalld

访问nginx默认网页

nginx rpm安装配置文件路径默认在

 /etc/nginx/nginx.conf

默认网页文件在:

/usr/share/nginx/html/

日志文件在:

/var/log/nginx/ 

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐