There are three ways to deploy the YUM repository:FTP,HTTP , and native mode.
-- Service Side :
Mkidr/data # directory to store RPM packages (all packages)
Chown-r apache.apache/data #FTP with HTTP Common directory, so permissions are modified to Apache
yum install-y Createrepo #createrepo yum
createrepo-v/data # Create rpm package for /data/ directory yum index (per update in directory 1 packages for this operation)
Yum install-y vsftpd #FTP Way
cd/etc/vsftpd/
Vim vsftpd.conf # modified as follows
Anonymous_enable=yes # turn on anonymous access
Anon_root=/data # plus anonymous access directory (default is /var/ftp/pub)
Vim ftpusers # Add user
Apache
Vim user_list # Add user
Apache
Service VSFTPD Restart
Chkconfig vsftpd on
Note: The following are the workarounds for "425 Failed to establish connection" in vsftpd
VI/ETC/VSFTPD/VSFTP.CONF # implementing enable PASV Connection
Pasv_enable=yes
pasv_min_port=6000
pasv_max_port=7000
Iptables-a input-p TCP--dport 20:21-j ACCEPT
Iptables-a input-p TCP--dport 6000:7000-j ACCEPT
Service iptables Restart # remember to restart services
Service VSFTPD Restart
Yum install httpd-y #HTTP Way
Cd/etc/httpd/conf
Vim httpd.conf # modified as follows
KeepAlive on
#Include conf.d/*.conf # Comment this line
servername www.example.com:80 # remove annotations (no alarms)
DocumentRoot "/data" # modified into rpm Package storage directory
<directory "/data" > # Modified into rpm Package storage directory
Order Allow,deny
Enable directory Access from all #
</Directory>
-- Client :
# Intranet Linux Client Configuration and installation Test #
backup /ETC/YUM.REPOS.D in repo file or repo file plus parameters: enabled=0 (this repo does not work).
Vim Local_yum.repo # Edit the yum source configured on the server side
[Vsftp]
Name=local_yum
baseurl= ftp://192.168.131.10
Enabled=1
Gpgcheck=0
Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-6
[HTTPD]
Name=local_yum
baseurl= http://192.168.131.10
Enabled=1
Gpgcheck=0
Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-6
Yum Clean All
Yum Install vsftp # Test if you can download the installation (possibly latency)
Yum repolist # query The installation packages that the Yum source contains
This article is from the "Sail" blog, please be sure to keep this source http://9625010.blog.51cto.com/9615010/1831796
Local Yum Source Warehouse (intranet)