linux shell openvz (vps)
2013-04-26 07:00
148 查看
# the first script is install openvz #!/bin/bash #this script install openvz(vps)# #Attention openvz you must downlown in the Internet,so you linux host must be can surf the Internet cd /etc/yum.repos.d/ yum -y install wget wget http://download.openvz.org/openvz.repo rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ ker=`uname -m` CONF=/etc/vz/vz.conf if [ $ker==i686 ];then yum -y install vzkernel vzctl vzquota else yum -y install ovzkernel vzctl.x86_64 vzquota.x86_64 fi cat >> /etc/sysctl.conf << EOF 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 EOF sysctl -p #sed -i '/NEIGHBOUR_DEVS/d' $CONF ## echo "NEIGHBOUR_DEVS=all" >> $CONF sed -i -e 's/NEIGHBOUR_DEVS/#NEIGHBOUR_DEVS/' -e '/\<NEIGHBOUR_DEVS\>/ a NEIGHBOUR_DEVS=all' $CONF setenforce 0 #sed -i 's/enforcing/disabled/g' /etc/sysconfig/selinux echo "###now,reboot the linux server####" reboot the second script is crate a new vps #!/bin/bash #this script is crate a vps host# cd /vz/template/cache ##please download a os tar package for vps# wget http://download.openvz.org/template/precreated/contrib/centos-5-i386-default.tar.gz vzctl create 101 --ostemplate centos-5-i386-default --config basic ##set the vps os ip,dns,hostname,port number,boot from the rev.### vzctl set 101 --onboot yes –-save vzctl set 101 --hostname supervm1.jie.com --save vzctl set 101 --ipadd 192.168.4.78 --save vzctl set 101 --diskspace 10G:10G --save vzctl set 101 --nameserver 192.168.4.10 --nameserver 8.8.8.8 --save vzctl set 101 --numothersock 120 --save vzctl start 101 ##set vps password vzctl exec 101 passwd echo "####the vps root passwd####" vzlist -a 两个脚本 一个是搭建vps,一个是在vps上面安装一个centos
相关文章推荐
- Linux&nbsp;shell&nbsp;很坑的空格
- [转]linux&nbsp;shell&nbsp;if&nbsp;参数
- [转]linux&nbsp;shell&nbsp;if&nbsp;参数
- linux vps搭建 (Openvz)
- Linux Shell自定义快捷指令
- Linux shell脚本全面学习
- Linux shell中的竖线(|)——…
- linux shell 中"2>&1"含义
- 【转】linux shell awk获得外部变…
- 检测Linux VPS是Xen、OpenVZ还是KVM架构的方法 判断VPS是Xen、OpenVZ还是KVM真假的方法
- 【原创】Linux Shell/Bash&nb…
- 检测Linux VPS是Xen、OpenVZ还是KVM真假方法
- linux shell脚本用while&nbsp…
- [转]linux&nbsp;shell&nbsp;if&nbsp;参数
- Linux&nbsp;Shell&nbsp;按m&nbsp;n输入的两个数&nbsp;截…
- Linux&nbsp;shell实现斐波那契数列编程
- Linux Shell 中的反引号,单引号,…
- Linux shell I/O重定向详解
- linux&nbsp;下用shell&nbsp;写入多行文本
- 在Linux Shell中运行SQL*Plus浏览…