KVM_webvirtmgr
一、webvirtmgr安装前说明:
1:操作做系统:centos7.2_x86_64
2:安装参考出处1:https://github.com/retspen/webvirtmgr/wiki/Install-WebVirtMgr
3:安装参考出处2:https://blog.csdn.net/xiegh2014/article/details/53053420
3:webvirtmgr源码包下载链接:git clone git://github.com/retspen/webvirtmgr.git https://github.com/retspen/webvirtmgr
二、防火墙设置
、sed -i "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config 、systemctl disable firewalld.service
三、安装
一、环境包
、yum install epel-release -y //yum包
、yum -y install git python-pip libvirt-python libxml2-python python-websockify supervisor nginx
、yum -y install gcc python-devel
、pip install numpy
、yum install qemu-kvm qemu-img libvirt virt-install libvirt-python virt-manager python-virtinst libvirt-client virt-viewer -y //kvm相关包
二、webvirtmgr、sqlite 安装
、指定安装位置
mkdir /application/
、sqlite安装
cd /application/
wget http://www.sqlite.org/sqlite-3.5.6.tar.gz
cd sqlite-3.5./
./configure --disable-tcl
make
make install
、webvirtmgr安装
cd /application/
git clone git://github.com/retspen/webvirtmgr.git
tar -xvf webvirtmgr.tar.gz
cd webvirtmgr
pip install -r requirements.txt
./manage.py syncdb
./manage.py collectstatic //生成配置文件
./manage.py createsuperuser //添加管理员账号
、拷贝 djabgo 服务到指定路径
mkdir -pv /var/www
cp -Rv /application/webvirtmgr /var/www/webvirtmgr
5、设置SSH
ssh-keygen
ssh-copy-id server@ip
ssh server@ip -L localhost:8000:localhost:8000 -L localhost:6080:localhost:6080
6、设置ngix服务下webvirtngr管理
vim /etc/nginx/conf.d/webvirtmgr.conf server {
listen default_server; server_name $hostname;
#access_log /var/log/nginx/webvirtmgr_access_log; location /static/ {
root /var/www/webvirtmgr/webvirtmgr; # or /srv instead of /var
expires max;
} location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout ;
proxy_read_timeout ;
proxy_send_timeout ;
client_max_body_size 1024M; # Set higher depending on your needs
}
} 7、修改权限及修改supervisord 配置文件
chown -R nginx:nginx /var/www/webvirtmgr vim /etc/supervisord.conf [program:webvirtmgr]
command=/usr/bin/python /var/www/webvirtmgr/manage.py run_gunicorn -c /var/www/webvirtmgr/conf/gunicorn.conf.py
directory=/var/www/webvirtmgr
autostart=true
autorestart=true
logfile=/var/log/supervisor/webvirtmgr.log
log_stderr=true
user=nginx [program:webvirtmgr-console]
command=/usr/bin/python /var/www/webvirtmgr/console/webvirtmgr-console
directory=/var/www/webvirtmgr
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/webvirtmgr-console.log
redirect_stderr=true
user=nginx 8、检测ngix配置中代理服务是否设置正确
grep '^bind =' /var/www/webvirtmgr/conf/gunicorn.conf.py 正确显示:bind = '127.0.0.1:8000'
9、启动相关服务
systemctl restart nginx.service
#Job for nginx.service failed because the control process exited with error code. See " 错误提示
修改:vim /etc/nginx/nginx.conf 注释掉39行 # listen default_server; systemctl restart nginx.service
systemctl start supervisord.service 10、后台运行
nohup /usr/bin/python2 /var/www/webvirtmgr/manage.py run_gunicorn -c /var/www/webvirtmgr/conf/gunicorn.conf.py & 、KVM被管理端配置
vim /etc/sysconfig/libvirtd
LLIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
LIBVIRTD_ARGS="--listen" vi /etc/libvirt/libvirtd.conf
listen_tls =
listen_tcp =
tcp_port = ""
listen_addr = "0.0.0.0"
auth_tcp = "none"
启动服务: systemctl restart libvirtd.service
12:设置开机启动
chkconfig supervisord on
vim /etc/rc.local
/usr/sbin/setsebool httpd_can_network_connect true
13、 启动进程
/etc/init.d/supervisord restart
15查看进程
netstat -lnpt 即可以看到6080和8000已经启动
16 web访问
http://192.168.0.194/login/
KVM_webvirtmgr的更多相关文章
随机推荐
- LeetCode 700 Search in a Binary Search Tree 解题报告
题目要求 Given the root node of a binary search tree (BST) and a value. You need to find the node in the ...
- 《mongoDB》查询
一:简单查询 db.collection.find(query, projection) - query :可选,使用查询操作符指定查询条件 - projection :可选,使用投影操作符指定返回的 ...
- 第一章:HTML5的基础
HTML5基础 1.DoctYpe声明 <!DCTYPE html>必须放在第一行. <title> <title> 百度</title> <me ...
- es手动创建索引,修改索引,删除索引
1.创建索引 创建索引的语法PUT /my_index{ "settings": { ... any settings ... }, "mappings": { ...
- MySQL常用SQL语句优化
推荐阅读这篇博文,索引说的非常详细到位:http://blog.linezing.com/?p=798#nav-3-2 在数据库日常维护中,最常做的事情就是SQL语句优化,因为这个才是影响性能的最主要 ...
- VS 2017 安装测试
3月7日, VS 出了新的版本2017 安装效果如下: 不过官方说会改变VS 2015附件python 的方式,变成类似C++ 一样集成python语言包到VS中. 目前没有看见,大家如果有兴趣可以安 ...
- what's the python之变量、基本数据类型
what's the 变量? Python 中的变量赋值不需要类型声明. 变量在内存中创建,包括变量的标识,名称和数据. 变量在使用前都必须赋值,变量赋值以后该变量才会被创建. 等号(=)用来给变量赋 ...
- chkdsk 命令对Raid盘检测和查错、修复
C:\Documents and Settings\Administrator>chkdsk /?检查磁盘并显示状态报告. CHKDSK [volume[[path]filename]]] [/ ...
- vue-preview的使用
使用vue-preview做图片缩率图1.安装 npm i vue-preview -S2.如果使用vue-cli生成的项目,需要修改webpack.base.conf.js文件中的loaders,添 ...
- golang 对struct进行Serialize的方法,即将存取二进制文件到struct的方法
方法一: serialize 的标准方法: 使用gob 和 base64 或 base58. 方法二: 下面是自己实现的 serialize 方法,不推荐自己实现,应该用标准方法. 代码如下: pac ...