网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 操作系统 > Linux
本月文章推荐
.如何解决在PUTTY下Linux显示乱码.
.Linux网络安全之经验谈(1).
.利用Linux Shell只对更新的文件进.
.关于Linux操作系统“暴力破解”软.
.Linux 指令篇:DOS相容指令--mdel.
.Linux命令Man解释:groupmod :修改.
.Redhat红帽发布升级版企业Linux .
.在Linux操作系统下配置CVS 集成c.
.实例说明:Linux系统终端scp命令.
.新手学堂:Linux操作系统下用户过.
.Linux 的中文化问题简介.
.在Ubuntu下添加程序链接至菜单项.
.Linux 核心--15.Linux内核资源.
.Linux系统中atime ctime mtime之.
.linux磁盘管理命令--fdformat.
.Suse系统下FTP Telnet xmanager网.
.Linux操作系统下文件保护与彻底删.
.Linux系统中网络配置详解.
.Linux操作系统上安装Flash Media.
.技巧:多系统下更改引导装载程序.

Linux系统下配置OPENVZ虚拟机的过程解析

发表日期:2008-3-7


在Linux 下配置OPENVZ 实例


推荐使用Fedora Core 4/5/3 或者RHEL/CentOS 4。


1. 下载安装文件


根据您的内核版本在这里:http://openvz.org/download/kernel/ 下载。

# rpm -ihv vzkernel-name*.rpm


2.修改grub.conf 文件

 

title OpenVZ (2.6.8-022stab029.1) root (hd0,0) kernel
/vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5 initrd /initrd-2.6.8-022stab029.1.img
 


3.修改、etc/sysyctl.conf文件:

 

/etc/sysctl.conf:
# On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
# Enables source route verification
net.ipv4.conf.all.rp_filter = 1
# Enables the magic-sysrq
key kernel.sysrq = 1
#net.ipv4.tcp_ecn = 0
# we do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
 


4. 如果你运行了iptables防火墙和SELinux,先关闭和禁止。


编辑/etc/sysconfig/selinux:

SELINUX=disabled。

另外还要关闭iptables防火墙。


5.安装OpenVZ管理软件


根据您的版本在这里:http://openvz.org/download/utils/ 下载。

# rpm –Uhv vzctl*.rpm vzquota*.rpm vzpkg*.rpm


6.重新启动VZ


# /etc/init.d/vz start


7.安装模板

 

# rpm –ihv vztmpl-fedora-core-3-1.0-2.noarch.rpm
# vzpkgcache
Creating cache for fedora-core-3 OS template
Setting up install process
Packing cache file fedora-core-3.tar.gz ...
Cache file fedora-core-3.tar.gz [130M] created.
 


8.为虚拟服务器创建一个非零ID

 

# vzctl create 101
Creating VPS private area: /vz/private/101
VPS is mounted
Postcreate action done
VPS is unmounted
VPS private area was created
 


9.设置为零参数

 

# vzctl set 101 --hostname test101.my.org --save
Hostname for VPS set: test101.my.org
Saved parameters for VPS 101
# vzctl set 101 --ipadd 10.0.186.1 --save
Adding IP address(es): 10.0.186.1
Saved parameters for VPS 101
# vzctl set 101 --nameserver 192.168.1.165 --save
File resolv.conf was modified
Saved parameters for VPS 101
 


10.设置root用户口令


# vzctl set 101 --userpasswd root:test


11.启动SSH守护进程


# vzctl exec 101 service sshd start


12.启动VPS

 

# vzctl start 101
Starting VPS ...
VPS is mounted
Adding IP address(es): 10.0.186.101 Hostname for VPS 101 set: test.my.org
VPS start in progress...
 


13.加载防火墙


前面关闭的防火墙,出于安全考虑这里还要加载

 

# vzctl set 101 --iptables iptable_filter
--iptables ipt_length --iptables ipt_limit
--iptables iptable_mangle --iptables ipt_REJECT --save

上一篇:新手看招:RHEL5系统下配置YUM源的方法 人气:1303
下一篇:配置记录FTP传输情况的Linux FTP服务器 人气:1119
浏览全部Linux的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐