Installation guide

36
Managing EZ Templates
3 Create the /vz/root/111/var/www/html/download/mirrors/updates-released-
as4 mirror list file and make it point to the repository inside Container 111 where the updated
versions of the RHEL 4 packages are stored:
# echo "http://144.134.134.144/download/redhat/updates/as4/i386/" > \
/vz/root/111/var/www/html/download/mirrors/updates-released-as4
This command makes the
/vz/root/111/var/www/html/download/mirrors/updates-released-as4 file on
the Node and adds the
http://144.134.134.144/download/redhat/updates/as4/i386 string to the file.
4 On the Node, create an empty RPM database. For example:
# mkdir -p /var/repo/redhat-as4
# rpm --initdb --dbpath /var/repo/redhat-as4
# rpm --dbpath /var/repo/redhat-as4 --import /usr/share/ \
rhn/RPM-GPG-KEY
5 Install the RPMs from the official RHEL 4 disks in the created database:
# find /vz/root/111/var/www/html/download/redhat/as4/i386/os/ \
RedHat/RPMS -name '*.rpm' | xargs rpm -ihv --justdb\
--dbpath /var/repo/redhat-as4 --ignoresize --force --nodeps
Installing all RPM packages for the RHEL 4 distribution may take a rather long run; please wait
until the installation process completes. After that, you can start using the up2date utility to
update the created repository.
For example, the following session updates the RPM packages in your local repository inside
Container 111:
Obtain a list of RPM packages
# up2date -l --tmpdir=/tmp/up2date --dbpath /var/repo/redhat-as4/ | \
awk 'BEGIN { stage = 0; } \
stage == 0 && /^--*$/ {stage = 1; next; } \
stage == 1 && /^$/ { stage = 2; next } \
stage == 1 { print $1; }' \
> /tmp/pkgs-list
Download them:
# cat /tmp/pkgs-list | xargs up2date -d --tmpdir=/tmp/up2date \
--dbpath /var/repo/redhat-as4/
# rpm -ivh --justdb --dbpath /var/repo/redhat-as4/ --ignoresize \
--force --nodeps /tmp/up2date/*.rpm
# mv /tmp/up2date/*.rpm /vz/root/111/var/www/html/download/redhat/ \
updates/as4/i386/
# createrepo /vz/root/111/var/www/html/download/redhat/updates \
/as4/i386
You can also make a script to automatically perform the aforementioned operations and set this
script to be run as a cron job.
Creating Proxy Servers for EZ Templates
This section describes the process of creating caching proxy servers to efficiently manage OS and
application EZ templates in your network.