jarland
The ocean is digital
I shared this on 96forum but might as well share here as well. This is a script I put together from a combination of a script on github and from Tim's (Hostigation) cent6.sh script. This script will take you from a fresh CentOS 6 install to an OpenVZ node in one move. Keep in mind that securing it is your next goal, not a feature
I think this is safe from summer hosts, since SolusVM is still easier.
I think this is safe from summer hosts, since SolusVM is still easier.
Code:
#!/bin/bash
yum update -y
yum install -y wget
cd /etc/yum.repos.d
wget http://download.openvz.org/openvz.repo
rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ
yum install -y vzkernel.x86_64
yum install -y vzctl vzquota
sed -i 's/kernel.sysrq = 0/kernel.sysrq = 1/g' /etc/sysctl.conf
sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /etc/sysctl.conf
echo 'net.ipv4.conf.default.proxy_arp = 0' >> /etc/sysctl.conf
echo 'net.ipv4.conf.all.rp_filter = 1' >> /etc/sysctl.conf
echo 'net.ipv4.conf.default.send_redirects = 1' >> /etc/sysctl.conf
echo 'net.ipv4.conf.all.send_redirects = 0' >> /etc/sysctl.conf
echo 'net.ipv4.icmp_echo_ignore_broadcasts=1' >> /etc/sysctl.conf
echo 'net.ipv4.conf.default.forwarding=1' >> /etc/sysctl.conf
sysctl -p
sed -i 's/NEIGHBOUR_DEVS=detect/NEIGHBOUR_DEVS=all/g' /etc/vz/vz.conf
sed -i 's/SELINUX=enabled/SELINUX=disabled/g' /etc/sysconfig/selinux
cd /vz/template/cache
wget http://download.openvz.org/template/precreated/centos-6-x86_64.tar.gz
yum install -y ntp
ntpdate -u us.pool.ntp.org
chkconfig ntpd on
service iptables stop
service ip6tables stop
chkconfig iptables off
chkconfig ip6tables off
reboot
Last edited by a moderator: