CentOS HowTo: Difference between revisions
(Restored content from Wayback Machine) Tag: Manual revert |
(Restored content from Wayback Machine) Tag: Manual revert |
||
| Line 3: | Line 3: | ||
<div class="logo"> | <div class="logo"> | ||
[[Linux-VServer|[[File:http://linux-vserver.org/ | [[Linux-VServer|[[File:http://wiki.linux-vserver.org/skins/common/images/wiki.png|[Home]]]]] | ||
</div> | </div> | ||
| Line 11: | Line 11: | ||
<div id="toolbar-top"> | <div id="toolbar-top"> | ||
[[Linux-VServer]] | [[RecentChanges]] | [http://linux-vserver.org/?action=prefs Preferences] | [http://tavi.sourceforge.net/FormattingRules FormattingRules] | [[Linux-VServer]] | [[RecentChanges]] | [http://oldwiki.linux-vserver.org/?action=prefs Preferences] | [http://tavi.sourceforge.net/FormattingRules FormattingRules] | ||
</div> | </div> | ||
| Line 21: | Line 21: | ||
<div id="body"> | <div id="body"> | ||
<span id="centos-4-specific-hints"></span> | <div style="margin: 2em auto 2em auto; padding: 10px; background-color: #F9ECCD; border: 1px solid #004433; text-align: center;"> | ||
= CentOS 4 Specific Hints = | |||
<div class="floatleft"> | |||
<span> [[Image:Icon-Caution.png|[[File:http://wiki.linux-vserver.org/images/1/1f/Icon-Caution.png|57x52px]]]] </span> | |||
</div> | |||
'''We currently migrate to MediaWiki from our old installation, but not all content has been migrated yet. Take a look at the [http://wiki.linux-vserver.org/Wiki_Team Wiki Team] page for instructions how to help or browse through our new wiki at [http://wiki.linux-vserver.org wiki.linux-vserver.org] to find the information already migrated.''' | |||
</div> | |||
<span id="centos-4-scientific-linux-sl-4-specific-hints"></span> | |||
= CentOS 4 & Scientific Linux (SL) 4 Specific Hints = | |||
This is meant to help those with this distribution, successfully install Linux-VServer. | This is meant to help those with this distribution, successfully install Linux-VServer. | ||
| Line 38: | Line 49: | ||
make modules_install | make modules_install | ||
make install</pre> | make install</pre> | ||
* '''Disable SELinux''' | * '''Disable SELinux''' | ||
| Line 99: | Line 60: | ||
== B. Tool Hints == | == B. Tool Hints == | ||
* NB Install dietlibc first, in order for util-vserver to link against that rather than glibc: | |||
<pre class="code">yum install dietlibc</pre> | |||
* Install beecrypt if you want to be able to use vhashify: | |||
<pre class="code">yum install beecrypt-devel</pre> | |||
* Many like to configure the tools with the following options: | * Many like to configure the tools with the following options: | ||
| Line 107: | Line 74: | ||
<span id="c.-adding-centos-4-support-into-the-tools"></span> | <span id="c.-adding-centos-4-support-into-the-tools"></span> | ||
== C. Adding CentOS 4 Support into the tools == | == C. Adding CentOS 4 Support into the tools == | ||
if you have the x86_64 architecture, substitute lib64 for lib in the next section. --psg | |||
<pre class="code">cd /usr/lib/util-vserver/distributions | <pre class="code">cd /usr/lib/util-vserver/distributions | ||
cp fc3 centos4 | cp -Rpv fc3 centos4 | ||
cd centos4 | cd centos4 | ||
mkdir pubkeys | mkdir pubkeys | ||
cp /usr/share/rhn/RPM-GPG-KEY-centos4 ./pubkeys/ (Should be there from a | cp /usr/share/rhn/RPM-GPG-KEY-centos4 ./pubkeys/ (Should be there from CentOS install or on CD1 if not using a CentOS host) | ||
ln -s ../redhat/initpre . | ln -s ../redhat/initpre . | ||
ln -s ../redhat/initpost . | ln -s ../redhat/initpost . | ||
| Line 118: | Line 87: | ||
rm -f 01 02 03 | rm -f 01 02 03 | ||
vi 01 (put the contents of this into it: http://linux-vserver.org/CentOS_min_install) | vi 01 (put the contents of this into it: http://linux-vserver.org/CentOS_min_install) | ||
#EDIT 03.05.2006: CentOS 4.3 compatible package list downloadable from http://pegasi.fi/CentOS_min_install-4.3 | |||
#Done with Perl and 4.3 DVD, please update the list if incorrectness occurs, Pekka.Kuronen(at)pegasi.fi | |||
#ADD 12.05.2006: Scientific Linux (SL) 4.3 compatible package list downloadable from | |||
#http://www.cnaf.infn.it/~apagano/Scientific_Linux_min_install-4.3 | |||
#Done with 4.3 DVD, please update the list if incorrectness occurs, alfredo.pagano(at)cnaf.infn.it | |||
cd ../yum | cd ../yum | ||
vi | vi yum.conf and replace with: | ||
[main] | [main] | ||
| Line 134: | Line 108: | ||
gpgcheck=1 | gpgcheck=1 | ||
cd yum.repos.d | cd ../yum.repos.d | ||
rm -f *.repo | rm -f *.repo | ||
cp /etc/yum.repos.d/ | cp /etc/yum.repos.d/CentOS-Base.repo . (in centos-yumconf RPM from CD1 if not using CentOS as host) | ||
vi CentOS-Base.repo (replace $releasever with 4.0 everywhere. In Vi use: .,$s/$releasever/4/g) | |||
cp -Rpv /etc/vservers/.distributions/fc3 /etc/vservers/.distributions/centos4 | |||
mkdir /vservers | |||
chmod 000 /vservers | |||
mkdir /vservers/.pkg</pre> | |||
<span id="d.-vserver-creation"></span> | <span id="d.-vserver-creation"></span> | ||
== D. VServer creation == | == D. VServer creation == | ||
| Line 146: | Line 126: | ||
First, let's create a minimal install of CentOS. We set this up earlier by putting the rpm packages to pkgs/01 | First, let's create a minimal install of CentOS. We set this up earlier by putting the rpm packages to pkgs/01 | ||
<pre class="code">vserver min-centos4 build -m yum --hostname domain.com --interface domain=eth0:192.168.0.136/24 --initstyle sysv --context 500 --force -- -d centos4</pre> | EDIT 03.05.2006: With CentOS[[CentOS?action=edit|?]] 4.3 do not update yum, it will not work. If already updated, install original yum with --force | ||
<pre class="code">vserver min-centos4 build -m yum --hostname domain.com --interface domain=eth0:192.168.0.136/24 --initstyle sysv \ | |||
--context 500 --force -- -d centos4</pre> | |||
This should take some time to install depending on your Internet connection. | This should take some time to install depending on your Internet connection. | ||
The /etc/resolv.conf file is not created. Manually create it, putting in your DNS servers or copy it from your host: | |||
<pre class="code">cp /etc/resolv.conf /vservers/min-centos4/etc/</pre> | |||
If you would like to be able to update the rpm packages (yum, etc.) from within the vserver copy in the rpm database and associated files: | |||
<pre class="code">cp /vservers/.pkg/min-centos4/rpm/state/* /vservers/min-centos4/.rpmdb/</pre> | |||
Next remove the network script before you try and start it: | |||
<pre class="code">rm -f /vservers/min-centos4/etc/rc[06].d/K90network</pre> | |||
Fix usual /proc permisions: | |||
<pre class="code">/path/to/util-vserver-0.30.208/scripts/vprocunhide</pre> | |||
Once it is created, you can start it: | Once it is created, you can start it: | ||
<pre class="code">vserver min-centos4 start</pre> | <pre class="code">vserver min-centos4 start</pre> | ||
(Note that sometimes the 'minilogd' process causes the above command to fail. If this is the case, use: | |||
<pre class="code">chcontext --xid 500 ps aux</pre> | |||
to identify the process, and then: | |||
<pre class="code">vkill -c 500 (pid)</pre> | |||
to kill the process, replacing (pid) by the pid of the minilogd process.) | |||
Then you can enter it: | Then you can enter it: | ||
<pre class="code">vserver min-centos4 enter</pre> | <pre class="code">vserver min-centos4 enter</pre> | ||
Next, update it with the latest patches: | |||
<pre class="code">yum update</pre> | |||
Next, clean up the startup & shutdown scripts: | |||
<pre class="code">chkconfig gpm off | |||
chkconfig pcmcia off | |||
chkconfig smartd off | |||
chkconfig haldaemon off | |||
chkconfig nfslock off | |||
chkconfig network off | |||
chkconfig portmap off | |||
chkconfig bluetooth off | |||
chkconfig rpcidmapd off | |||
chkconfig iptables off | |||
chkconfig anacron off | |||
rm -f /etc/rc[06].d/S01* | |||
exit</pre> | |||
Setup the vserver to start and stop automatically on reboot: | |||
<pre class="code">cd /etc/init.d/ | |||
mv vservers-default vservers | |||
chkconfig --add vservers | |||
chkconfig vservers on | |||
echo "default" > /etc/vservers/min-centos4/apps/init/mark</pre> | |||
You can now test that it starts and stops with: | |||
<pre class="code">service vservers start | |||
vserver-stat | |||
service vservers stop | |||
vserver-stat</pre> | |||
</div> | </div> | ||
| Line 177: | Line 211: | ||
</div> | </div> | ||
Document last modified | Document last modified Thu, 08 Jun 2006 05:32:58<br /> | ||
<div class="form"> | <div class="form"> | ||
Latest revision as of 03:48, 11 November 2025
We currently migrate to MediaWiki from our old installation, but not all content has been migrated yet. Take a look at the Wiki Team page for instructions how to help or browse through our new wiki at wiki.linux-vserver.org to find the information already migrated.
CentOS 4 & Scientific Linux (SL) 4 Specific Hints[edit]
This is meant to help those with this distribution, successfully install Linux-VServer.
A. Kernel Issues[edit]
- Get and compile kernel
The CentOS default Kernel release is highly patched already and thus are not compatible with the patches supplied by linux-vserver.org. For this reason, we are going to use a vanilla-kernel (read: an unmodified original linux kernel) from kernel.org. For this part see http://linux-vserver.org/Step-by-Step+Guide+2.6
- Compile the kernel with:
make menuconfig make make modules_install make install
- Disable SELinux
- SELinux conflicts with Linux-VServer. Disable it in /etc/selinux/config (SELINUX=disabled)
- Reboot
- If it boots, you did it right, otherwise, go back and check everything.
B. Tool Hints[edit]
- NB Install dietlibc first, in order for util-vserver to link against that rather than glibc:
yum install dietlibc
- Install beecrypt if you want to be able to use vhashify:
yum install beecrypt-devel
- Many like to configure the tools with the following options:
./configure --prefix=/usr --sysconfdir=/etc --with-vrootdir=/vservers make make check make install
C. Adding CentOS 4 Support into the tools[edit]
if you have the x86_64 architecture, substitute lib64 for lib in the next section. --psg
cd /usr/lib/util-vserver/distributions cp -Rpv fc3 centos4 cd centos4 mkdir pubkeys cp /usr/share/rhn/RPM-GPG-KEY-centos4 ./pubkeys/ (Should be there from CentOS install or on CD1 if not using a CentOS host) ln -s ../redhat/initpre . ln -s ../redhat/initpost . cd pkgs rm -f 01 02 03 vi 01 (put the contents of this into it: http://linux-vserver.org/CentOS_min_install) #EDIT 03.05.2006: CentOS 4.3 compatible package list downloadable from http://pegasi.fi/CentOS_min_install-4.3 #Done with Perl and 4.3 DVD, please update the list if incorrectness occurs, Pekka.Kuronen(at)pegasi.fi #ADD 12.05.2006: Scientific Linux (SL) 4.3 compatible package list downloadable from #http://www.cnaf.infn.it/~apagano/Scientific_Linux_min_install-4.3 #Done with 4.3 DVD, please update the list if incorrectness occurs, alfredo.pagano(at)cnaf.infn.it cd ../yum vi yum.conf and replace with: [main] cachedir=@YUMCACHEDIR@ reposdir=@YUMETCDIR@/yum.repos.d debuglevel=2 logfile=@YUMLOGDIR@/log pkgpolicy=newest distroverpkg=centos-release tolerant=1 exactarch=1 retries=20 obsoletes=1 gpgcheck=1 cd ../yum.repos.d rm -f *.repo cp /etc/yum.repos.d/CentOS-Base.repo . (in centos-yumconf RPM from CD1 if not using CentOS as host) vi CentOS-Base.repo (replace $releasever with 4.0 everywhere. In Vi use: .,$s/$releasever/4/g) cp -Rpv /etc/vservers/.distributions/fc3 /etc/vservers/.distributions/centos4 mkdir /vservers chmod 000 /vservers mkdir /vservers/.pkg
D. VServer creation[edit]
- Build a new minimal vserver
First, let's create a minimal install of CentOS. We set this up earlier by putting the rpm packages to pkgs/01
EDIT 03.05.2006: With CentOS? 4.3 do not update yum, it will not work. If already updated, install original yum with --force
vserver min-centos4 build -m yum --hostname domain.com --interface domain=eth0:192.168.0.136/24 --initstyle sysv \ --context 500 --force -- -d centos4
This should take some time to install depending on your Internet connection.
The /etc/resolv.conf file is not created. Manually create it, putting in your DNS servers or copy it from your host:
cp /etc/resolv.conf /vservers/min-centos4/etc/
If you would like to be able to update the rpm packages (yum, etc.) from within the vserver copy in the rpm database and associated files:
cp /vservers/.pkg/min-centos4/rpm/state/* /vservers/min-centos4/.rpmdb/
Next remove the network script before you try and start it:
rm -f /vservers/min-centos4/etc/rc[06].d/K90network
Fix usual /proc permisions:
/path/to/util-vserver-0.30.208/scripts/vprocunhide
Once it is created, you can start it:
vserver min-centos4 start
(Note that sometimes the 'minilogd' process causes the above command to fail. If this is the case, use:
chcontext --xid 500 ps aux
to identify the process, and then:
vkill -c 500 (pid)
to kill the process, replacing (pid) by the pid of the minilogd process.)
Then you can enter it:
vserver min-centos4 enter
Next, update it with the latest patches:
yum update
Next, clean up the startup & shutdown scripts:
chkconfig gpm off chkconfig pcmcia off chkconfig smartd off chkconfig haldaemon off chkconfig nfslock off chkconfig network off chkconfig portmap off chkconfig bluetooth off chkconfig rpcidmapd off chkconfig iptables off chkconfig anacron off rm -f /etc/rc[06].d/S01* exit
Setup the vserver to start and stop automatically on reboot:
cd /etc/init.d/ mv vservers-default vservers chkconfig --add vservers chkconfig vservers on echo "default" > /etc/vservers/min-centos4/apps/init/mark
You can now test that it starts and stops with:
service vservers start vserver-stat service vservers stop vserver-stat