centos7.X安装nginx – 东凭渭水流

1.安装nginx需要使用root用户

2.配置nginx源

	rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
	 
	# 运行如下
	[root@localhost ~]# rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
	获取http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
	警告:/var/tmp/rpm-tmp.lI2rbS: 头V4 RSA/SHA1 Signature, 密钥 ID 7bd9bf62: NOKEY
	准备中...                          ################################# [100%]
	正在升级/安装...
	   1:nginx-release-centos-7-0.el7.ngx ################################# [100%]
	   
	# 出现如上所示,则配置成功,也可以在/etc/yum.repos.d/ 下看到多了一个nginx.repo文件
	 
	[root@baize ~]# cd /etc/yum.repos.d/
	[root@baize yum.repos.d]# ls
	CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo    CentOS-Vault.repo          epel.repo          nginx.repo
	CentOS-CR.repo    CentOS-fasttrack.repo  CentOS-Sources.repo  CentOS-x86_64-kernel.repo  epel-testing.repo
	[root@baize yum.repos.d]# yum install -y nginx

3.安装nginx

yum install -y nginx

4.放行80端口

	firewall-cmd --permanent --add-port=80/tcp
	firewall-cmd --permanent --add-port=443/tcp
posted @ 2023-08-11 14:33  东凭渭水流  阅读(44)  评论(0编辑  收藏  举报