Java教程

FTP - YUM 源配置

本文主要是介绍FTP - YUM 源配置,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

**

Ftp yum源配置

一、 环境需要
1、2台centos A和B
2、配置两台主机的ip
3、关闭防火墙(2台)

	[root@localhost ~]# systemctl stop firewalld
	[root@localhost ~]# systemctl disable firewalld

关闭selinux

[root@localhost ~]# vim /etc/sysconfig/selinux

把SELINUX=enforcing改为SELINUX=diaabled如图
在这里插入图片描述
二、 安装主机A安装yum
1、 挂载镜像
1.1先在opt下创建centos目录

[root@localhost ~]# mdkir /opt/centos
[root@localhost ~]# mdkir /opt/yum
	**1.2把镜像挂载到/opt/centos 下**
[root@localhost ~]# mount -o loop /dev/cdrom /opt/centos

在这里插入图片描述
1.3配置yum源
备份yum源

[root@localhost ~]# mv /etc/yum.repos.d/* /opt/yum
		写配置文件
		[root@localhost ~]# vim /etc/yum.repos.d/local.repo
		[root@localhost ftp]# cat /etc/yum.repos.d/local.repo 
		[centos]
		name=centos
		baseurl=file:///opt/centos
		gpgcheck=0
		enabled=1
		[root@localhost ftp]# yum makecache
		[root@localhost ftp]# yum repolist

在这里插入图片描述
成功。

三、 主机A安装ftp服务
*1、 下载vsftpd

[root@localhost ftp]# yum -y install vsftpd
		**2、修改配置文件**
[root@ localhost ~]# vi /etc/vsftpd/vsftpd.conf
添加anon_root=/opt

保存退出
3、启动

[root@localhost ftp]# systemctl retsatr vsftpd
[root@localhost ftp]# systemctl enabled vsftpd

四、主机B配置
1、配置yum源
备份yum源

[root@localhost ~]# mv /etc/yum.repos.d/* /opt/yum
写配置文件
[root@localhost ~]# vim /etc/yum.repos.d/local.repo
[root@localhost ftp]# cat /etc/yum.repos.d/local.repo 
[ftpyum]
name=ftpyum
baseurl=ftp://主机A的ip /centos
gpgcheck=0
enabled=1
[root@localhost ftp]# yum makecache
[root@localhost ftp]# yum repolist
 

在这里插入图片描述

成功配置主机B通过ftp服务主机A的yum提供服务******

这篇关于FTP - YUM 源配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!