实验报告实现ftp liux的yum源搭建
实验步骤
一、准备两台liunxA与B
A:svr5.tarena.com ip:192.168.4.5 网关:192.168.4.254
DNS:192.168.4.5 网卡:VMnet1
B:svr6.tarena.com ip:192.168.4.6 网关:192.168.4.254
DNS:192.168.4.5 网卡:VMnet1
能够ping同且所有配置重启生效
二、所有虚拟机共同配置台虚拟机共同配置
1、关闭NetworkManager
[[email protected] /]# /etc/init.d/NetworkManagerstop
[[email protected] /]# chkconfig NetworkManager off
2、关闭防火墙
[[email protected] /]# iptables -F
[[email protected] /]# /etc/init.d/iptables save
iptables:将防火墙规则保存到/etc/sysconfig/iptables: [确定]
[[email protected] /]# /etc/init.d/iptables stop
[[email protected] /]# chkconfig iptables off
3、关闭Selinux
[[email protected] /]# getenforce //查看Selinux状态
Enforcing
[[email protected] /]# setenforce 0 //当前关闭Selinux
[[email protected] /]# getenforce //查看Selinux是否关闭Permissive为不启用
Permissive
永久关闭Selinux
[[email protected] /] vim/etc/selinux/config
......
......
SELINUX=permissive
三、制作逻辑卷
1、在svr5上新建20G分区
[[email protected] /]# fdisk /dev/sda
[[email protected] /]# partx -a /dev/sda
[[email protected] /]# ls /dev/sda*
...... /dev/sda6
[[email protected] /]# pvcreate /dev/sda6 //格式化物理卷
[[email protected] /]# vgcreate -s 1M myvg/dev/sda6 //创建卷组并设置pe单位1M
[[email protected] /]# lvcreate -L 15G -n mylv myvg//创建15G大小的逻辑卷
[[email protected] /]# mkfs.ext4 /dev/myvg/mylv //格式化逻辑卷才能使用。。
2、挂载光盘安装vsftpd
[[email protected] /]# mount /dev/cdrom /mnt/
[[email protected] /]# cd /mnt/Packages/
[[email protected] Packages]# ls *vsftpd*
vsftpd-2.2.2-11.el6_4.1.x86_64.rpm
[[email protected] Packages]# rpm -ivhvsftpd-2.2.2-11.el6_4.1.x86_64.rpm
[[email protected] Packages]# ls -ld /var/ftp/
drwxr-xr-x. 3 root root 4096 12月 11 16:14/var/ftp/
[[email protected] /]# /etc/init.d/vsftpd start
[[email protected] /]# mount /dev/myvg/mylv/var/ftp/
[[email protected] /]# grep myvg /etc/fstab
/dev/myvg/mylv /var/ftp ext4 defaults 0 0
[[email protected] /]# mkdir /var/ftp/rhel6dvd
[[email protected] /]# cp -r /mnt/* /var/ftp/rhel6dvd/
四、配置网络yum
[[email protected] /]# cd /etc/yum.repos.d/
[[email protected] yum.repos.d]# ls
rhel-source.repo
[[email protected] yum.repos.d]# cprhel-source.repo rhel6.repo
[[email protected] /]# cat/etc/yum.repos.d/rhel6.repo
[rhel-6]
name=Red Hat Enterprise Linux 6
baseurl=ftp://192.168.4.5/rhel6dvd
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[[email protected] /]# yum repolist
五、在客户端svr6上配置yum
[[email protected] /]# [email protected]:/etc/yum.repos.d/rhel6.repo /etc/yum.repos.d/
[[email protected] /]# yum repolist