使用wok kimchi插件管理kvm(编译安装)

来源:互联网 发布:mac口红国内专柜价格表 编辑:程序博客网 时间:2024/06/03 22:20

对于KVM(kernel-based virtual machine)大家并不陌生,它是基于内核的虚拟机,在测试或者生产环境中经常用到,由于管理起来不是很方便,我在这里推荐一个kvm web管理工具。

什么是Wok?

Wok基于cherrypy的web框架,可以通过一些插件来进行扩展,例如:虚拟化管理、主机管理、系统管理。它可以在任何支持HTML5的网页浏览器中运行。

什么是Kimchi?

Kimchi是一个基于HTML5的KVM管理工具,是Wok的一个插件(使用Kimchi前一定要先安装了wok),通过Kimchi可以更方便的管理KVM。

github地址:https://github.com/kimchi-project

当前环境介绍:

vm虚拟机安装的Centos7.4(桌面版安装),vm勾选虚拟化Inter VT-x/EPT或AMD-V/RVI(V)

临时关闭selinux

setenforce 0

永久关闭selinux

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

关闭防火墙(或自行开放相应端口)

systemctl stop firewalld.service

正文开始:


一、编译安装nginx

1、配置好yum源,安装依赖

yum install wget gcc gcc-c++ pcre pcre-devel openssl openssl-devel zlib zlib-devel epel-release

2、创建nginx启动用户
useradd -s /bin/false -M www

3、下载解压nginx
cd /usr/local/src/
wget http://nginx.org/download/nginx-1.12.2.tar.gz
tar zxf nginx-1.12.2.tar.gz

4、编译nginx
cd /usr/local/src/nginx-1.12.2
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module
make
make install

5、添加环境变量
ln -sv /usr/local/nginx/sbin/nginx /usr/local/sbin/
 我有几张阿里云幸运券分享给你,用券购买或者升级阿里云相应产品会有特惠惊喜哦!把想要买的产品的幸运券都领走吧!快下手,马上就要抢光了。
6、设置systemctl
vi /usr/lib/systemd/system/nginx.service

[Unit]
Description=nginx
After=network.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s stop
PrivateTmp=true
[Install]
WantedBy=multi-user.target

二、配置nginx

1、编辑nginx配置文件

vi /usr/local/nginx/conf/nginx.conf

http{
......
include vhost/*.conf;
}

2、创建虚拟机
mkdir /usr/local/nginx/conf/vhost
cd /usr/local/nginx/conf/vhost

vi wok.conf

client_max_body_size 4194304k;
proxy_connect_timeout 10m;
proxy_send_timeout 10m;
proxy_read_timeout 10m;
send_timeout 10m;

map httpupgradehttpupgradeconnection_upgrade {

default upgrade;'' close;

}
upstream websocket {

server 127.0.0.1:64667;

}

原文链接

原创粉丝点击