The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.
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 1.9, “Creating a Local Yum Repository Using an ISO Image”.
Install the Apache HTTP server from the local yum repository.
#
yum install httpd
If 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/OSimage
NoteThe semanage and restorecon commands are provided by the
policycoreutils-python
andpolicycoreutils
packages.Create a symbolic link in
/var/www/html
that points to the repository:#
ln -s /var/OSimage /var/www/html/OSimage
Edit 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 specifiesIndexes
andFollowSymLinks
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
Disable all existing yum repositories on the server and each client system.
In the
/etc/yum.repos.d
directory, edit any existing repository files and disable all entries by settingenabled=0
. If you have theyum-utils
package installed, as described in Section 1.3.4, “Using Yum Utilities to Manage Configuration”, you can disable all repositories by running:#
yum-config-manager --disable \*
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=1Replace
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.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