SELINUX=disabled
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1
bu işlemler ardından OpenVZ kurulum dosyaları için depo tanımlamasını indiriyoruz.
wget -O /etc/yum.repos.d/openvz.repo http://download.openvz.org/openvz.repo
rpm –import http://download.openvz.org/RPM-GPG-Key-OpenVZ
mcedit /etc/yum.repos.d/openvz.repo dosyaya girrerek RHEL6 paketlerine izin veriyoruz. Diğerlerini kapatıyoruz. Genelde RHEL6 olarak geliyor zaten. Kontrol edilmesi iyidir.
yum install vzkernel vzctl vzquota
kurulumun ardından sunucuyu başlatıyoruz.
reboot
Template olarak kullanacağımız işletim sistemini bu linkten seçerek indireceğiz. Ben debian 7 64Bit kullanmak istediğim için onun şablonunu indiriyorum. İndirme işlemi /vz/template/cache dizini altına yapılır ve indirilen dosya açılmaz.
cd /vz/template/cache
wget http://download.openvz.org/template/precreated/debian-7.0-x86_64.tar.gz
Bu işlem sonrasında artık sanal linuxu oluşturabiliriz.
vzctl create 101 –ostemplate debian-7.0-x86_64 –config vswap-1g
vzctl set 101 –save –name server101
vzctl set 101 –save –onboot yes
vzctl set 101 –save –hostname srv.linuxuzmani.com
vzctl set 101 –save –ipadd 192.168.1.101
vzctl set 101 –save –nameserver 8.8.8.8 –nameserver 8.8.4.4
vzctl set 101 –save –cpus 4
vzctl set 101 –save –ram 8G
vzctl set 101 –save –swap 4G
vzctl set 101 –save –diskspace 50G
vzctl start 101
Root şifresini belirliyoruz.
vzctl exec 101 passwd
vzctl enter 101 diyerek Centos üzerinden veya ssh ile ip adresinden yeni sanal sunucumuza giriş yapabiliriz