Installation guide
34
Managing EZ Templates
Managing Repositories for Commercial Linux Distributions
Commercial Linux distributions (e.g., Red Hat Enterprise Linux and SUS Linux Enterprise Server) do
not have official repositories. So if you are going to run a commercial Linux distribution inside your
Containers, you should create a special repository which will store the software packages of this
distribution and enable you to update the packages inside your Containers.
In the example below, we will create the repository which will store the RPM packages included in
the Red Hat Enterprise Linux 4 distribution. Besides, we will consider the situation explaining to you
how to keep your repository up-to-date by getting the updated packages from the Red Hat
Enterprise Linux 4 website. In our example, we presume the following:
• The Node where the repository will be located is running Red Hat Enterprise Linux 4 (RHEL 4).
• The package repository will be stored inside Container 111.
• Container 111 can be accessed from other networks.
• The apache web server is running inside Container 111 and the default document root for
apache is /var/www/html, i.e. the apache web server stores its sites in the
/vz/root/111/var/www/html directory on the Hardware Node.
• The apache user and group inside Container 111 are apache.
• The http protocol will be used to access the RHEL 4 packages repository.
To create a repository for RHEL 4, do the following:
1 Install the redhat-as4-x86 OS EZ template on the Node, if it is not yet installed:
# vzpkg install template redhat-as4-x86-tmpl-4.7.0-3.noarch.rpm
Preparing... ################################## [100%]
1:redhat-as4-x86-tmpl ################################## [100%]
2 Create the Container where the repository storing the RHEL 4 packages will be located and
assign an IP address and hostname to it. Let us use the centos-6-x86 OS EZ template to
base your Container on. For example, to create Container 111 having the IP address of
144.134.134.144 and the hostname of my_repo for housing the repository, you can
execute the following commands:
# vzctl create 111 --ostemplate centos-6-x86 --ipadd 144.134.134.144 --hostname my_repo
3 Make sure that Container 111 is running and the httpd service is started in the Container:
# vzlist -a
CTID NPROC STATUS IP_ADDR HOSTNAME
1 42 running 10.163.163.1 localhost
111 - stopped 144.134.134.144 my_repo
...
# vzctl start 111
Starting Container ...
Container is mounted
...
Container start in progress...
# vzctl exec 111 service httpd status
httpd is running...
Container 111 should be running to be able to perform the commands listed below.