Advertisement
opexxx

installOpenVZ.sh

Nov 24th, 2013
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.69 KB | None | 0 0
  1. #!/bin/bash
  2. # run: source <(curl -s https://raw.github.com/qrpike/CentOS6---OpenVZ-Installer/master/installOpenVZ.sh)
  3.  
  4.  
  5. clear
  6. echo 'Going to install OpenVZ for you..'
  7.  
  8. echo 'installing wget..'
  9. yum install -y wget
  10.  
  11. echo 'now adding openvz Repo'
  12. cd /etc/yum.repos.d
  13. wget http://download.openvz.org/openvz.repo
  14. rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ
  15.  
  16. echo 'Installing OpenVZ Kernel'
  17. yum install -y vzkernel.x86_64
  18.  
  19. echo 'Installing additional tools'
  20. yum install -y vzctl vzquota ploop
  21.  
  22. echo 'Changing around some config files..'
  23. sed -i 's/kernel.sysrq = 0/kernel.sysrq = 1/g' /etc/sysctl.conf
  24. sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /etc/sysctl.conf
  25.  
  26. echo 'net.ipv4.conf.default.proxy_arp = 0' >> /etc/sysctl.conf
  27. echo 'net.ipv4.conf.all.rp_filter = 1' >> /etc/sysctl.conf
  28. echo 'net.ipv4.conf.default.send_redirects = 1' >> /etc/sysctl.conf
  29. echo 'net.ipv4.conf.all.send_redirects = 0' >> /etc/sysctl.conf
  30. echo 'net.ipv4.icmp_echo_ignore_broadcasts=1' >> /etc/sysctl.conf
  31. echo 'net.ipv4.conf.default.forwarding=1' >> /etc/sysctl.conf
  32.  
  33. echo 'Done with that, purging your sys configs'
  34. sysctl -p
  35.  
  36. sed -i 's/NEIGHBOUR_DEVS=detect/NEIGHBOUR_DEVS=all/g' /etc/vz/vz.conf
  37. sed -i 's/SELINUX=enabled/SELINUX=disabled/g' /etc/sysconfig/selinux
  38.  
  39. clear
  40.  
  41. echo "OpenVZ Is now Installed.."
  42.  
  43. echo ' - - - - - - - - - - - - - - - - - - - - - - '
  44. echo ' disable iptables to access VMs:$ /etc/init.d/iptables stop && chkconfig iptables off'
  45. echo ' - - - - - - - - - - - - - - - - - - - - - - '
  46. echo ' To download CentOS base template for openvz, run: '
  47. echo ' cd /vz/template/cache && wget http://download.openvz.org/template/precreated/centos-6-x86_64.tar.gz '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement