OpenVZ CPanel Installation Guide

CPanel and WHM, OpenVZ

This article will descibe in detail the steps required to setup a VE specifically designed to run WHM and CPanel from scratch. Please note, the intention of this article is to create a VE suitable for creation of a template cache tarball. You should not use this procedure to create each container, but rather use the template created from it to create the second and subsequent containers from that point forward:

First, you should create a VE suitable for use with CPanel, along with the appropriate filesystem mount points. Currently, we use the default CentOS 4.7 template and create custom configurations for each hardware node utilizing vzsplit. You can find details on using vzsplit elsewhere on this website:

vzctl create VPSID --ostemplate TEMPLATE_NAME --config CONFIG_NAME
vzctl set VPSID --onboot yes --save
vzctl set --hostname HOST_NAME --save
vzctl set VPSID --ipadd IP_ADDRESS --save
vzctl set VPSID --nameserver "IP_ADDRESS1 IP_ADDRESS2 IP_ADDRESS3" --save
cd /vz
mkdir vps
cd vps
mkdir VPSID
mkdir shm tmp
chmod 1777 tmp
cd /vz/root/VPSID
mkdir backup
cd /backup
mkdir VPSID
cd /etc/vz/conf

Next, you’ll need to create a script named /etc/vz/conf/VPSID.mount. When the container is started, the script will automatically mount /tmp and /dev/shm both non-executable and without SUID privileges to improve security:

mount -n --bind /backup/VPSID /vz/root/VPSID/backup
mount -n --bind -onosuid,noexec /vz/vps/VPSID/tmp /vz/root/VPSID/tmp
mount -n --bind -onosuid,noexec /vz/vps/VPSID/shm /vz/root/VPSID/dev/shm
exit ${?}

chmod 700 VPSID.mount
vzctl start VPSID
vzctl set VPSID --userpassword root:PASSWORD --save
vzctl enter VPSID

Though you can certainly do this later, now would be a good time to configure and update CPAN and install the LWP bundle:

cpan -i Bundle::CPAN
reload cpan
cpan -i Bundle::LWP

Before installing CPanel, you’ll want to install the nano editor and modify the content of /etc/yum.conf to prevent yum updates from interfering with the CPanel automated maintenance process:

yum install nano
nano /etc/yum.conf
exclude=apache* bind-chroot courier* dovecot* exim* httpd* mod_ssl* mysql* nsd* perl* php* proftpd* pure-ftpd* ruby* spamassassin* squirrelmail* wget*

Now you’re ready to install CPanel (Skip to the next section if you need the DNS only version):

cd /home
wget -N
sh latest

For the DNS only version of CPanel:

cd /home
wget -N
sh latest-dnsonly

At this point, you can go grab a cup of coffee and start working on something else as it will take a couple hours or more for a complete install.

Explore posts in the same categories: centos

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:


You are commenting using your account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )


Connecting to %s

%d blogger menyukai ini: