in Linux

RHCE6 Preperation (2) – yum source and auto mount

1, configure the YUM source to the instructor location.

in the folder, ‘/etc/yum.repos.d’, create the file,

vim serverX.repo

the content is as:

【serverX】
name=serverX
baseurl= the location of the YUM source

in my case the location of YUM source is “= http://instructor.example.com/pub/rhel6/dvd”
make sure you have network connection to http://instructor.example.com/pub/rhel6/dvd, this has already been done before.
enabled=1

gpgcheck=0 (without the gpg check)

Set the YUM source at Instructor computer, first insert the CentOS ISO image into the VirtualBox, as below,
VirtualBox_storage
set the automatic mount the CentOS ISO image by editing the configuration file, /etc/fstab, below is the result of command “cat /etc/fstab”
mount_CD
reboot the computer,
reboot
the last line as: “/dev/cdrom /var/ftp/pub/rhel6/dvd iso9660 auto,ro 0 0”
the folder /var/ftp/pub is linked to /var/www/html/pub, as below picture shows,
var.ftp.pub
so this DVD file can be accessed by http protocol from the student computer. Below pic shows the link:
access_dvd

2, set the selinux as enforcing mode,

edit the file /etc/sysconfig/selinux

SELINUX=enforcing

needs to reboot for SELinux take effect.

3,  enable the firewall,

iptables -F
iptables -X
iptables -Z
service iptables save

4, mount the example.iso to /mnt/iso, and auto mount at system boot time,

mkdir /mnt/iso
mount -o loop /root/examine.iso /mnt/iso

Write into the fstab file,

vim /etc/fstab
/root/examine.iso /mnt/iso iso9660 defaults,loop 0 0

to test the result,

mount -a
df -h


5, showmount -e localhost to show the directory shared in your system

if the command didn’t display anything, means the NFS service didn’t start,

if NFS service start fail, means rpcbind service didn’t start,

service rpcbind start
service nfs start
showmount -e localhost

Write a Comment

Comment

15 − 11 =