First, the service side
1. Mount the disc image file
[[email protected] ~]# df filesystem 1k-blocks Used Available Use% Mounted on/dev/sda3 40185208 315028 37822180 1% /tmpfs 506144 76 506068 1% /dev/shm/dev/sda1 194241 27906 156095 16% /boot/dev/sda6 20027260 45024 18958236 1% /home/dev/sda2 60344404 2689168 54583236 5% /usr/dev/sda5 40185208 318824 37818384 1% /var/dev/sr0 3747454 3747454 0 100% /media/rhel-6.6 server.x86_64
2. copy Disc image file
[Email protected] ~]# mkdir-p/var/ftp/rhel6[[email protected] ~]# cp-rf/media/rhel-6.6\ server.x86_64/*/var/ftp/rhe L6 &[[email protected] ~]# du-sh/var/ftp/rhel6/3.6g/var/ftp/rhel6/
3, install VSFPTD, FTP software
[[email protected] ~]# yum-y install vsftpd >>/dev/null[[email protected] ~]# yum-y install FTP >>/dev/nu Ll[[email protected] ~]# Rpm-qa |grep vsftpdvsftpd-2.2.2-12.el6_5.1.x86_64[[email protected] ~]# Rpm-qa ftpftp-0.17-54. El6.x86_64
4. Delete the default gateway and DNS resolution
[Email protected] ~]# cd/etc/sysconfig/network-scripts/[[email protected] network-scripts]# vim ifcfg-eth0device= eth0hwaddr=00:0c:29:a3:da:45type=ethernetonboot=yesbootproto=staticipaddr=172.16.0.11netmask=255.255.0.0[[ Email protected] network-scripts]# service network Restart[[email protected] network-scripts]# ping baidu.comping: Unknown host baidu.com
5. Turn off firewall and SELinux
[[Email protected] ~]# service iptables stop[[email protected] ~]# setenforce 0[[email protected] ~]# getenforcepermissive
6. Verifying the FTP Service
[[email protected] ~] #service vsftpd restart[[email protected] ~] #ftp 172.16.0.11connected to 172.16.0.11 (172.16.0.11) .220 (vsftpd 2.2.2) Name ( 172.16.0.11:root): ftp331 please specify the password. Password:230 login successful. Remote system type is unix. Using binary mode to transfer files.ftp> ls227 entering passive Mode (172,16,0,11,50,82). 150 here comes the directory listing.drwxr-xr-x 2 0 0 4096 Jul 29 2014 pubdrwxr-xr-x 3 0 0 4096 sep 06 08:49 rhel6226&nbSp;directory send ok.ftp> cd rhel6250 directory successfully changed.ftp > ls ...... ..... ........................... ....... ..... .................. ......... dr-xr-xr-x 3 0 0 4096 Sep 06 08:49 Highavailabilitydr-xr-xr-x 3 0 0 4096 Sep 06 08:49 loadbalancerdr-xr-xr-x 2 0 0 266240 Sep 06 08:52 packages-r--r--r-- 1 0 0 16435 sep 06 08:52 readme-r--r--r-- 1 0 0 3375 sep 06 08:52 RPM-GPG-KEY-redhat-beta-r--r--r-- 1 0 0 3211 sep 06 08:52 rpm-gpg-key-redhat-release ........................................................................................... 226 directory send ok.ftp>
Second, the client
1. Edit the Yum source configuration file
[Email protected] yum.repos.d]# ls[[email protected] yum.repos.d]# vim Rhel6.repo [base]name=rhel6.localbaseurl=ftp:/ /172.16.0.11/rhel6/enabled=1gpgcheck=0
2. Delete the default gateway and DNS resolution
[Email protected] yum.repos.d]# VIM/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-ETH0DEVICE=ETH0HWADDR=00:0C:29:9D:C8: Fctype=ethernetonboot=yesbootproto=staticipaddr=172.16.0.12netmask=255.255.0.0[[email protected] yum.repos.d]# Service network Restart[[email protected] YUM.REPOS.D] #ping Baidu.comping:unknown host Baidu.com[[email protected] yum.repos.d]# Ping 172.16.0.11PING 172.16.0.11 (172.16.0.11) (+) bytes of data.64 bytes from 172.16.0.11:icmp_seq=1 tt L=64 time=1.27 ms
3. Clear and update the cache
[email protected] yum.repos.d]# yum clean all[[email protected] yum.repos.d]# yum Makecache
4. Verify the installation
[email protected] yum.repos.d]# yum list[[email protected] yum.repos.d]# Rpm-qa |grep gcc[[email protected] Yum.repos.d ]# yum-y Install gcc >>/dev/null[[email protected] yum.repos.d]# rpm-qa |grep gcclibgcc-4.4.7-11.el6.x86_64gcc-4. 4.7-11.el6.x86_64[[email protected] yum.repos.d]#
Add:
Additional packages that are included with the non-RHEL CD-ROM must include all the installation files that have dependencies, in addition to preparing the appropriate directories, manually creating the Repodata data files, and using the Createrepo tool to implement
Cases:
[[Email protected] ~] #mkdir-P/var/ftp/other[[email protected] ~] #createrepo-G/media/rhel-6.6\ server.x86_64/ Repodata/repomd.xml/var/ftp/other
This article is from the "top of the Purple Forbidden" blog, please make sure to keep this source http://1343138116.blog.51cto.com/6124664/1714940
Redhat Configuring the Local area network FTP software repository