(RHEL5.5)
1、准备软件仓库文件(YUM服务器端)
(1)配置网卡,挂载光盘
[root@localhost ~]# service network restart
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth0: [确定]
[root@localhost ~]# mount /dev/cdrom /media/
mount: block device /dev/cdrom is write-protected, mounting read-only
(2)安装vsftp服务,给予777权限,复制media下所有的带目录复制,并保留权限,到/var/ftp/pub下
[root@localhost ~]# cd /media/Server/
[root@localhost Server]# rpm –ivh vsftp*
[root@localhost Server]# chmod 777 /var/ftp/pub///给予777权限
[root@localhost Server]# cp -rp /media/* /var/ftp/pub/
(3)安装createerepo文件
[root@localhost ~]# cd /media/Server/
[root@localhost Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
(4)重新调整YUM仓库文件
[root@localhost Server]# cd /var/ftp/pub/
[root@localhost pub]# ls
Cluster README-te.html RELEASE-NOTES-U5-en
ClusterStorage README-zh_CN.html RELEASE-NOTES-U5-en.html
README-ru.html RELEASE-NOTES-U5-as.html Server
README-si.html RELEASE-NOTES-U5-bn.html TRANS.TBL
README-ta.html RELEASE-NOTES-U5-de.html VT
[root@localhost pub]# cd Server/ //由于RHEL5有4个库,所有修改路径后,要对这四个库的文件位置重新做调整
[root@localhost Server]# cd ..
[root@localhost pub]# createrepo -g Server/repodata/comps-rhel5-server-core.xml ./
[root@localhost pub]# createrepo -g VT/repodata/comps-rhel5-vt.xml ./
[root@localhost pub]# createrepo -g Cluster/repodata/comps-rhel5-cluster.xml ./
[root@localhost pub]# createrepo -g ClusterStorage/repodata/comps-rhel5-cluster-st.xml ./
查看生成的数据文件的总数
[root@localhost pub]# ls -lhrepodata/
总计 13M
-rw-r--r-- 1 root root 106K 04-19 12:28 comps-rhel5-cluster-st.xml
-rw-r--r-- 1 root root 101K 04-19 14:41 comps-rhel5-cluster.xml
-rw-r--r-- 1 root root 1006K 04-19 12:07 comps-rhel5-server-core.xml
-rw-r--r-- 1 root root 101K 04-19 12:13 comps-rhel5-vt.xml
-rw-r--r-- 1 root root 2.7M 04-19 14:41 filelists.xml.gz
-rw-r--r-- 1 root root 7.6M 04-19 14:41 other.xml.gz
-rw-r--r-- 1 root root 858K 04-19 14:41 primary.xml.gz
-rw-r--r-- 1 root root 1.2K 04-19 14:41 repomd.xml
让vsftpd开机自动启动
[root@localhost ~]# chkconfig vsftpd on
[root@localhost ~]# service vsftpd start
验证
[root@localhost ~]# ftp 192.168.1.1
Connected to 192.168.1.1.
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (192.168.1.1:root): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>dir
227 Entering Passive Mode (192,168,1,1,192,162)
150 Here comes the directory listing.
drwxrwxrwx 9 0 0 4096 Apr 19 04:28 pub
226 Directory send OK.