[root@server1 ~]# mount /dev/cdrom /media/ //先將 REDHAT ENTERPRISE 5.1 光碟掛載在/media/
[root@server1 ~]# mkdir -p /var/ftp/pub/
[root@server1 ~]# cp -a /media/* /var/ftp/pub/
[root@server1 ~]# echo '/var/ftp/pub *(ro,no_root_squash)' >> /etc/exports
[root@server1 ~]# service portmap restart
正在停止 portmap: [ 確定 ]
正在啟動 portmap: [ 確定 ]
[root@server1 ~]# service nfs start
正在啟動 NFS 服務: [ 確定 ]
正在啟動 NFS quotas: [ 確定 ]
正在啟動 NFS 系統程式: [ 確定 ]
正在啟動 NFS mountd: [ 確定 ]
[root@server1 ~]# chkconfig nfs on
[root@server1 ~]# showmount -e localhost
Export list for localhost:
/var/ftp/pub *
[root@server1 ~]# showmount -e 192.168.0.254
Export list for 192.168.0.254:
/var/ftp/pub *
[root@server1 ~]# cd /var/ftp/pub/
[root@server1 pub]# for d in Cluster/ ClusterStorage/ Server/ VT/; do
> mkdir -p ~/backup/${d}/
> cp ${d}/repodata/comps-rhel5-*.xml ~/backup/${d}/
> done
[root@server1 pub]# ls ~/backup/
Cluster ClusterStorage Server VT
[root@server1 pub]# find /var/ftp/pub -iname "*createrepo*" -exec rpm -ivh {} \;
warning: /var/ftp/pub/Server/createrepo-
Preparing... ########################################### [100%]
1:createrepo ########################################### [100%]
[root@server1 pub]# rpm -q createrepo
createrepo-
[root@server1 pub]# for d in Cluster/ ClusterStorage/ Server/ VT/; do
> rm -rf ${d}/repodata/;
> cd ${d}/;
> createrepo -g ~/backup/${d}/comps-rhel5-*.xml ./;
> cd ../;
>done
32/32 - Cluster_Administration-ko-KR-
Saving Primary metadata
Saving file lists metadata
Saving other metadata
36/36 - gnbd-
Saving Primary metadata
Saving file lists metadata
Saving other metadata
2159/2159 - gfs2-utils-
Saving Primary metadata
Saving file lists metadata
Saving other metadata
31/31 - Virtualization-zh-TW-
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@server1 pub]# cp /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/server1.repo
[root@server1 pub]# vi /etc/yum.repos.d/server1.repo
[Cluster]
named=Red Hat Enterprise Linux 5 Cluster
baseurl=file:///var/ftp/pub/Cluster
enabled=1
gpgcheck=0
[ClusterStorage]
named=Red Hat Enterprise Linux 5 ClusterStorage
baseurl=file:///var/ftp/pub/ClusterStorage
enabled=1
gpgcheck=0
[Server]
named=Red Hat Enterprise Linux 5 Server
baseurl=file:///var/ftp/pub/Server
enabled=1
gpgcheck=0
[VT]
named=Red Hat Enterprise Linux 5 VT
baseurl=file:///var/ftp/pub/VT
enabled=1
gpgcheck=0
[root@server1 pub]# yum list
[root@server1 pub]# yum -y install vsftpd
[root@server1 pub]# service vsftpd start
[root@server1 pub]# chkconfig vsftpd on
[root@server1 pub]# chkconfig --list vsftpd
[root@server1 pub]# netstat -tupln | grep --color vsftpd
tcp 0 0
[root@server1 pub]# yum -y install httpd
[root@server1 pub]# service httpd start
[root@server1 pub]# chkconfig httpd on
[root@server1 pub]# chkconfig --list httpd
[root@server1 pub]# netstat -tupln | grep --color :80
tcp 0 0 :::80 :::* LISTEN 9038/httpd
[root@server1 pub]# yum -y install nmap
[root@server1 pub]# nmap localhost
[root@server1 pub]# nmap 192.168.0.254
[root@server1 pub]# ln -s /var/ftp/pub/ /var/www/html/
[root@server1 pub]# links -dump http://192.168.0.254/pub
沒有留言:
張貼留言