Setting up a simple Web/Mail Server in OpenVZ

- 16 Jun 2009

Here are the steps I continue to use over and over to build utilities/project servers in OpenVZ. Utilities servers host web apps, mailing applications, etc for my company. We usually build them as self-contained little appliance-like servers. My vision and goal is simple == better every day!

First, we create the virtual machine:

cid=1164
cd /vz/template/cache/
wget http://download.openvz.org/template/precreated/centos-5-x86_64.tar.gz
vzctl create ${cid} --ostemplate centos-5-x86_64 --config vps.basic
vzctl set ${cid} --hostname [HOSTNAMEHERE] --save
vzctl set ${cid} --ipadd [IP] --save
vzctl set ${cid} --nameserver [IP] --save
vzctl start ${cid}
vzctl exec ${cid} passwd
vzctl enter ${cid}

Now that we are in the virtual machine and away from the HN we add the REMI repo and apply the updates directly on the box.

wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
/bin/rm epel-release-5-3.noarch.rpm remi-release-5.rpm

yum --enablerepo remi -y update
yum --enablerepo remi -y install httpd php php-devel php-pear php-gd php-xsl php-mbstring php-mcrypt php-mysql mysql

Add Postfix and switch it on via system-switch-mail

yum --enablerepo remi -y install postfix system-switch-mail
system-switch-mail

Now… customer configurations and setups…


Related Posts: Extracting Smarty variables from source » Installing vzdump on CentOS 5.4 (32-bit) » Dumping Addresses from phplist » Adding NRPE (Nagios) to CentOS \/ RHEL Servers » Adding the REMI Repository to CentOS / RHEL / RedHat »

comments powered by Disqus