To be able to deploy new VM, you need a repository.
Install the Apache package:
# yum groupinstall -y "Web server"
Create the directories for the CentOS distribution and the updates:
# cd /var/www/html # mkdir centos updates conf
In the software requirements, it was specified to download the 2-DVD version of the CentOS6 distribution. It is now time to use them.
Copy the first DVD:
# mount -o loop CentOS-6.4-x86_64-bin-DVD1.iso /mnt # cd /mnt # tar cvf - . | (cd /var/www/html/centos; tar xvf -) # cd /; umount /mnt
Copy the second DVD:
# mount -o loop CentOS-6.4-x86_64-bin-DVD2.iso /mnt # cd /mnt # tar cvf - . | (cd /var/www/html/centos; tar xvf -) # cd /; umount /mnt
In order to create a new repository for the updates, install the createrepo package:
# yum install createrepo
Go into the directory where the repository configuration is:
# cd /etc/yum.repo.d
Create the local.repo file and type:
[base2] name=master - Base baseurl=http://192.168.1.5/centos/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 [updates2] name=master - Updates baseurl=http://192.168.1.5/updates/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Copy the local.repo file into the http directory to make it available to the new VM:
# cp local.repo /var/www/html/conf
Reset the directory for the updates:
# cd updates; createrepo .
Assign the SELinux attributes to the files:
# restorecon -R /var/www/html
Activate the Apache server at boot:
# chkconfig httpd on
Start the Apache server:
# service httpd start
Edit the /etc/sysconfig/iptables file and add the following line:
# iptable -A INPUT -p tcp -m state --state NEW -m tcp —dport 80 -j ACCEPT
Save the firewall configuration:
# server iptables restart
Clean up the yum configuration:
# yum clean all
Check the yum configuration:
# yum repolist
In addition, you can watch TheUrbanPenguin‘s videos about creating a local repository (6min) or creating a local mirror (11min).
Leave a Reply
You must be logged in to post a comment.