ベストアンサー
0
iQi - 面白いアプリを開発中
以下の一行の内容を実行すれば、OKです。
実行ScriptCode:https://github.com/H2so4/CentO ... l.sh/
Manual installation (if for some reason the one liner doesn’t work):
Copy the following script into a file, e.g. openvz-kernel-owp-install.sh
Change permissions and run it:
以下の内容は公式サイトの説明です。
yum pre-setup
vzctl現在のバージョンは4.7で、>=4.4であれば、sysctl.confなどが自動設定してもらいますので、そのままにしておきます。
ツールをインストール
Reboot into OpenVZ
Download OS templateshttp://openvz.org/Download/template/cache
curl -s -L http://goo.gl/sqKjXF|sudo bash
実行ScriptCode:https://github.com/H2so4/CentO ... l.sh/
Manual installation (if for some reason the one liner doesn’t work):
Copy the following script into a file, e.g. openvz-kernel-owp-install.sh
Change permissions and run it:
chmod +x ./openvz-kernel-owp-install.sh
sudo ./openvz-kernel-owp-install.sh
以下の内容は公式サイトの説明です。
yum pre-setup
wget -P /etc/yum.repos.d/ http://ftp.openvz.org/openvz.repo
rpm --import http://ftp.openvz.org/RPM-GPG-Key-OpenVZ
yum install vzkernel
vzctl現在のバージョンは4.7で、>=4.4であれば、sysctl.confなどが自動設定してもらいますので、そのままにしておきます。
ツールをインストール
yum install vzctl vzquota ploop
Reboot into OpenVZ
reboot
Download OS templateshttp://openvz.org/Download/template/cache
/vz/template/cache/
1
or
Lubo - PHP言語が得意です
{ 賛成 }: lujian
curl -s -L http://goo.gl/sqKjXF|sudo bash
or
!/bin/bash
run: source <(curl -s https://raw.github.com/qrpike/ ... nVZ.sh)
clear
echo 'Going to install OpenVZ for you..'
echo 'installing wget..'
yum install -y wget
echo 'now adding openvz Repo'
cd /etc/yum.repos.d
wget -P /etc/yum.repos.d/ http://ftp.openvz.org/openvz.repo
rpm --import http://ftp.openvz.org/RPM-GPG-Key-OpenVZ
echo 'Installing OpenVZ Kernel'
yum install -y vzkernel.x86_64
echo 'Installing additional tools'
yum install -y vzctl vzquota
echo 'Changing around some config files..'
sed -i 's/kernel.sysrq = 0/kernel.sysrq = 1/g' /etc/sysctl.conf
sed -i 's/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/g' /etc/sysctl.conf
echo 'net.ipv4.conf.default.proxy_arp = 0' >> /etc/sysctl.conf
echo 'net.ipv4.conf.all.rp_filter = 1' >> /etc/sysctl.conf
echo 'net.ipv4.conf.default.send_redirects = 1' >> /etc/sysctl.conf
echo 'net.ipv4.conf.all.send_redirects = 0' >> /etc/sysctl.conf
echo 'net.ipv4.icmp_echo_ignore_broadcasts=1' >> /etc/sysctl.conf
echo 'net.ipv4.conf.default.forwarding=1' >> /etc/sysctl.conf
echo 'Done with that, purging your sys configs'
sysctl -p
sed -i 's/NEIGHBOUR_DEVS=detect/NEIGHBOUR_DEVS=all/g' /etc/vz/vz.conf
sed -i 's/SELINUX=enabled/SELINUX=disabled/g' /etc/sysconfig/selinux
echo 'Now downloading CentOS6 x86_64 template....'
cd /vz/template/cache
wget http://download.openvz.org/template/precreated/centos-6-x86_64.tar.gz
/bin/cp /etc/rc.local /tmp/rc.local
cat > /etc/rc.local << EOF
!/bin/bash
wget -O - http://ovz-web-panel.googlecode.com/svn/installer/ai.sh | sh
modprobe vzcpt
modprobe nf_conntrack_ftp
modprobe ip_nat_ftp
/bin/cp -f /tmp/rc.local /etc/rc.local
EOF
BARE MINIMUM OpenVZ iptables config - CENTOS 6.4
cat > /etc/sysconfig/iptables << EOF
*nat
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A POSTROUTING -o eth+ -j MASQUERADE
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type echo-request -j REJECT --reject-with icmp-host-prohibited
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT
-A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
-A FORWARD -p icmp -m icmp --icmp-type echo-request -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -p icmp -j ACCEPT
-A FORWARD -i lo -j ACCEPT
-A FORWARD -o eth+ -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
EOF
reboot
echo ' - - - - - - - - - - - - - - - - - - - - - - '
echo ' The server will reboot now and install OpenVZ Web panel'
echo ' '
echo 'When the server boots, it will run the OpenVZ Web panel installation which can take up to 10 minutes'
echo 'This script is executed by backing up/replacing /etc/rc.local with a new file containing the installation script.'
echo 'Once complete, the original /etc/rc.local file is replaced'
echo ' - - - - - - - - - - - - - - - - - - - - - - '
echo '..... well.... that should do it.'
echo 'oh, and ur welcome...'