1、准备yum源

vi /etc/yum.repo.d/nginx.repo

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/rhel/7/$basearch/
gpgcheck=0
enable=1

准备好了源之后,更新源

$ yum clean all
$ yum makecache
2、安装nginx

$ yum install -y nginx
安装成功之后可以通过 $ nginx -v查看版本

[root@docker php-5.5.38]# nginx -v
nginx version: nginx/1.13.0
3、启动nginx并通过浏览器查看页面

$ nginx
$ systemctl stop firewalld //关闭防火墙
$ systemctl disable firewalld //禁止开机启动


相关文章:

  • 2021-10-17
  • 2021-08-25
  • 2022-01-11
  • 2021-08-18
  • 2022-01-23
  • 2022-12-23
  • 2021-09-04
猜你喜欢
  • 2021-08-16
  • 2021-11-30
  • 2022-02-01
  • 2021-08-06
  • 2018-07-26
相关资源
相似解决方案