Fork me on GitHub

利用http和ftp搭建yum本地源

1      yum自建本地源

1.1    配置ftp的yum源:

S端:

配置本地yum源,

yum -y install vsftpd

cp /usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE/vsftpd.conf /etc/vsftpd/vsftpd.conf

sed -i 's/anon_max_rate=50000/anon_max_rate=5000000/g' /etc/vsftpd/vsftpd.conf

systemctl start vsftpd;systemctl enable vsftpd

mkdir /var/ftp/rhel

mount  /dev/cdrom  /var/ftp/rhel

 

C端的配置:

cat <<EOF  >/etc/yum.repos.d/base.repo

[ftp]

name=ftp

baseurl=ftp://192.168.100.162/rhel

enabled=1

gpgcheck=0

EOF

yum clean all

yum repolist

 

 

1.2    配置httpd的yum源

S端:

yum  -y  install  httpd

mkdir  /var/www/html/rhel

mount  /dev/cdrom  /var/www/html/rhel

systemctl start httpd;systemctl enable httpd

C端:

cat <<EOF >/etc/yum.repos.d/base.repo

[http-base]

name=http-base

baseurl=http://192.168.100.162/rhel/

enabled=1

gpgcheck=0

EOF

yum clean all

yum repolist

posted @ 2020-12-24 17:55  创始人  阅读(244)  评论(0编辑  收藏  举报