To set up a local yum server (for example, if you have a network of systems that do not have Internet access):
Choose one of the systems to be the yum server, and create a local yum repository on it as described in Section 2.9, “Creating a Local Yum Repository Using an ISO Image”.
Install the Apache HTTP server from the local yum repository.
# yum install httpdIf SELinux is enabled in enforcing mode on your system:
Use the semanage command to define the default file type of
the repository root directory hierarchy as
httpd_sys_content_t:
# /usr/sbin/semanage fcontext -a -t httpd_sys_content_t "/var/OSimage(/.*)?"Use the restorecon command to apply the file type to the entire repository.
# /sbin/restorecon -R -v /var/OSimageThe semanage and restorecon commands are
provided by the policycoreutils-python and
policycoreutils packages.
Create a symbolic link in /var/www/html that points to the
repository:
# ln -s /var/OSimage /var/www/html/OSimageEdit the HTTP server configuration file,
/etc/httpd/conf/httpd.conf, as follows:
Specify the resolvable domain name of the server in the argument to
ServerName.
ServerName server_addr:80If the server does not have a resolvable domain name, enter its IP address instead.
Verify that the setting of the Options directive in the
<Directory "/var/www/html"> section specifies
Indexes and FollowSymLinks to allow you to
browse the directory hierarchy, for
example:
Options Indexes FollowSymLinks
Save your changes to the file.
Start the Apache HTTP server, and configure it to start after a reboot.
#service httpd start#chkconfig httpd on
If you have enabled a firewall on your system, configure it to allow incoming HTTP connection requests on TCP port 80.
For example, the following command configures iptables to allow
incoming HTTP connection requests and saves the change to the firewall
configuration:
#iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT#service iptables save
Edit the repository file on the server (for example,
/etc/yum.repos.d/OL63.repo):
[OL63]
name=Oracle Linux 6.3 x86_64
baseurl=http://server_addr/OSimage/OL6.3_x86_64
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY
gpgcheck=1
enabled=1 Replace server_addr with the IP address or resolvable
host name of the local yum server.
On each client, copy the repository file from the server to the
/etc/yum.repos.d directory.
In the /etc/yum.repos.d directory, edit any other repository
files, such as public-yum-ol6.repo or
ULN-base.repo, and disable all entries by setting
enabled=0.
On the server and each client, test that you can use yum to access the repository.
# yum repolist
Loaded plugins: refresh-packagekit, security
...
repo id repo name status
OL63 Oracle Linux 6.3 x86_64 25,459
repolist: 25,459