{"id":120,"date":"2011-11-15T17:41:30","date_gmt":"2011-11-15T09:41:30","guid":{"rendered":"http:\/\/www.sulabs.net\/?p=120"},"modified":"2017-01-09T10:35:59","modified_gmt":"2017-01-09T02:35:59","slug":"openvz-%e8%99%9a%e6%8b%9f%e5%8c%96%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88-centos-6-%e4%b8%8a%e7%9a%84%e9%83%a8%e7%bd%b2","status":"publish","type":"post","link":"https:\/\/www.sulabs.net\/?p=120","title":{"rendered":"OpenVZ \u865a\u62df\u5316\u89e3\u51b3\u65b9\u6848 CentOS 6 \u4e0a\u7684\u90e8\u7f72"},"content":{"rendered":"<p>\u8bb0\u5f97\u5728\u5b66\u751f\u65f6\u4ee3\u7684\u65f6\u5019\u5c1d\u8bd5\u5b89\u88c5\u4f53\u9a8c\u8fc7SWSoft \u7684\u4e00\u7cfb\u5217\u4ea7\u54c1\uff0cPlesk\u3001<a href=\"mailto:Prim@Hosting\">Prim@Hosting<\/a>\u3001Virutozzo \u7b49\u7b49\uff0c\u529f\u80fd\u4e0a\u7559\u4e0b\u4e86\u6df1\u523b\u7684\u6620\u50cf\uff0cOpenVZ \u662f virutozzo \u5f00\u6e90\u865a\u62df\u5316\u89e3\u51b3\u65b9\u6848\uff0c\u56fd\u5916\u5f88\u591aIDC\uff0cBurst\u3001VPST \u90fd\u4f7f\u7528\u4e86 OpenVZ\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u672c\u6b21\u4e5f\u6765\u5c1d\u8bd5\u6d4b\u8bd5\u4e86\u4e0b\uff0c\u6b65\u9aa4\u5f88\u7b80\u5355\uff0c\u5982\u4e0b\u3002<!--more--><br \/>\n\u672c\u65b9\u6848\u662f\u57fa\u4e8e CentOS 6.0 64\u4f4d\uff0cOpenVZ \u642d\u914d OVZ Web Panel \u9762\u677f\uff0cVtonf \u957f\u65f6\u95f4\u672a\u66f4\u65b0\uff0c\u672a\u4f5c\u8003\u8651\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u5c1d\u8bd5\u4e0b\u5b98\u65b9\u4e3b\u9875\u4e0a\u5217\u51fa\u7684\u5176\u5b83\u7ba1\u7406\u9762\u677f\u3002<\/p>\n<p>1. \u7cfb\u7edf\u5b89\u88c5<br \/>\nCentOS 6.0 Mininal \u6700\u5c0f\u5316\u5b89\u88c5\uff0c\u9ed8\u8ba4\u82f1\u6587\u8bed\u8a00\uff0c\u91c7\u7528 OVZ Web Panel \u65f6\u9ed8\u8ba4\u91c7\u7528 \/vz \u76ee\u5f55\u5b58\u50a8\u865a\u62df\u673a\u6587\u4ef6\u548c\u6a21\u677f\uff0c\u53ef\u4ee5\u5bf9\u8be5\u76ee\u5f55\u5355\u72ec\u505a\u4e00\u4e2a\u5927\u5206\u533a\u3002<\/p>\n<p>2. \u7cfb\u7edf\u8c03\u6574<br \/>\n(1)\u5b89\u88c5\u7cfb\u7edf\u4e00\u4e9b\u5fc5\u987b\u7684\u8f6f\u4ef6\u5305<br \/>\n# yum install gcc gcc-c++ flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libxml2-devel gettext-devel pcre-devel curl-devel openldap-devel libmcrypt libmcrypt-devel libmhash libmhash-devel libtool libtool-ltdl gd gd-devel libtool-ltdl-devel setuptool ntsysv system-config-network-tui system-config-firewall-tui perl automake autoconf cmake make<\/p>\n<p>(2)\u5173\u95ed SELinux\uff0c\u4fee\u6539 SELINUX=disabled<br \/>\n# vi \/etc\/selinux\/config<\/p>\n<p>(3) \u4fee\u6539\u7cfb\u7edf\u4e00\u4e9b\u53c2\u6570\u8bbe\u7f6e<br \/>\n# vi \/etc\/sysctl.conf<br \/>\n\u53c2\u7167\u4ee5\u4e0b\u53c2\u6570\u8fdb\u884c\uff0c\u5982\u672a\u7528\u5230 IPV6 \u53ef\u4e0d\u7528\u6dfb\u52a0 net.ipv6 \u76f8\u5173\u53c2\u6570<br \/>\nnet.ipv4.ip_forward = 1<br \/>\nnet.ipv6.conf.default.forwarding = 1<br \/>\nnet.ipv6.conf.all.forwarding = 1<br \/>\nnet.ipv4.conf.default.proxy_arp = 0<br \/>\nnet.ipv4.conf.all.rp_filter = 1<br \/>\nkernel.sysrq = 1<br \/>\nnet.ipv4.conf.default.send_redirects = 1<br \/>\nnet.ipv4.conf.all.send_redirects = 0<\/p>\n<p>(4) \u5173\u95ed\u7cfb\u7edf\u9632\u706b\u5899\u5f00\u673a\u542f\u52a8<br \/>\n# chkconfig --level 345 iptables off<\/p>\n<p>3 \u5b89\u88c5 OpenVZ<br \/>\n# cd \/etc\/yum.repos.d\u00a0\u00a0\u00a0\u00a0 \/\/\u8fdb\u5165\u5230 yum.repos \u76ee\u5f55<br \/>\n# wget <a href=\"http:\/\/download.openvz.org\/openvz.repo\">http:\/\/download.openvz.org\/openvz.repo<\/a>\u00a0\u00a0\u00a0 \/\/\u4e0b\u8f7d repo \u6587\u4ef6<br \/>\n# \u00a0yum search vzkernel\u00a0\u00a0\u00a0 \/\/\u641c\u7d22OpenVZ \u5185\u6838<br \/>\n#\u00a0 yum install vzkernel\u00a0\u00a0\u00a0\u00a0 \/\/\u5b89\u88c5 OpenVZ \u5185\u6838\uff0c\u5e76\u8bb0\u4e0b\u5185\u6838\u7248\u672c\u3002<br \/>\n\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u91cd\u542f\u7cfb\u7edf\uff0c\u6267\u884c uname -a \u67e5\u770b\u5185\u6838\u662f\u5426\u6b63\u786e\u5b89\u88c5<\/p>\n<p>4. \u5b89\u88c5\u00a0OVZ-Web-Panel \u7ba1\u7406\u9762\u677f<br \/>\n# wget <a href=\"http:\/\/ovz-web-panel.googlecode.com\/svn\/installer\/ai.sh\">http:\/\/ovz-web-panel.googlecode.com\/svn\/installer\/ai.sh<\/a>\u00a0\/\/\u4e0b\u8f7d\u5b89\u88c5\u811a\u672c<br \/>\n#\u00a0vi ai.sh<br \/>\n\/\/ \u56e0\u7ba1\u7406\u9762\u677f\u91c7\u7528 Ruby\u00a0\u7f16\u5199\u00a0\u548cSQLite \u6570\u636e\u5e93\uff0cgem \u6e90\u4e2dSqlite3 \u540d\u79f0\u53d1\u751f\u4e86\u4e00\u4e9b\u53d8\u5316\uff0c\u4e2d\u6709\u4e9b\u5730\u65b9\u8981\u505a\u4e0b\u6539\u52a8<br \/>\n\u67e5\u627e\u00a0 RUBY_SQLITE3_CMD=\"ruby -e \\\"require 'rubygems'\\\" -e \\\"require 'sqlite3\/database'\\\"\"\u00a0 \u7b2c7\u884c\u5de6\u53f3\u7684\u4f4d\u7f6e\uff0c\u5c06 \u5176\u4e2d\u7684 sqlite3\/database\u00a0 \u66f4\u6539\u4e3a sqlite3<br \/>\n\u67e5\u627e gem install sqlite3-ruby\u00a0\u00a0 \u5c06\u00a0 sqlite3-ruby\u00a0 \u66f4\u6539\u4e3a sqlite3 \u5b8c\u6210\u3002<\/p>\n<p>\u8fdb\u8fc7\u6f2b\u957f\u7684\u7b49\u5f85\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6d4f\u89c8 ip :3000 \u5373\u53ef<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bb0\u5f97\u5728\u5b66\u751f\u65f6\u4ee3\u7684\u65f6\u5019\u5c1d\u8bd5\u5b89\u88c5\u4f53\u9a8c\u8fc7SWSoft \u7684\u4e00\u7cfb\u5217\u4ea7\u54c1\uff0cPlesk\u3001Pri &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/www.sulabs.net\/?p=120\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[28],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-lamp","tag-openvz"],"_links":{"self":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=120"}],"version-history":[{"count":3,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":749,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=\/wp\/v2\/posts\/120\/revisions\/749"}],"wp:attachment":[{"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sulabs.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}