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的更多相关文章
随机推荐
- 根据xml配置使用反射动态生成对象
web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="htt ...
- win 右键菜单栏出现sublime打开方式
win + r 输入 regedit 看图操作
- MongoDB limit 选取 skip跳过 sort排序 方法
MongoDB limit 选取 skip跳过 sort排序 在mysql里有order by MongoDB用sort代替order by > db.user.find() { " ...
- css自动换行如何设置?url太长会撑开页面
我们更新文章时如果有引用其他文章一般会带一个原文url,但这个链接如果太长的话会把内容的版块撑开,整个排版乱了.那我们能不能设置css自动换行呢?如下图所示,其实只要两个样式就能搞定 word-wra ...
- H3C 网管交换机快速配置指南(转)
H3C交换机,5XXX,3XXX,还有部分2XXX系列都带有网管功能,可以帮助网络维护非常好的控制网络.基本的配置顺序: Console接口连接,开启Telnet登陆功能,Telnet后进行具体设置. ...
- 【1】vue/cli 3.0 脚手架 及cube-ui 安装
安装 Vue CLI 需要 Node.js 8.9 或更高版本 (推荐 8.11.0+).你可以使用 nvm 或 nvm-windows在同一台电脑中管理多个 Node 版本. 检查node版本: $ ...
- C++的string
string中find()返回值是字母在母串中的位置(下标记录),如果没有找到,返回npos. string的substr(pos=0, count=npos)返回字符串[pos, pos+count ...
- ssm框架整合
1.1 整合的思路 1.1.1 Dao层 使用mybatis框架.创建SqlMapConfig.xml.(可以是任意名字) 创建一个applicationContext-dao.xml (通过sp ...
- 解决Linux 下 root用户删除文件提示:Operation not permitted
问题描述 用最高权限rm文件,居然报错Operation not permitted.查看权限也没有问题.可想而知有可能文件被保护了.用命令lsattr检查一下就知道. [root@linux roo ...
- dblink连接操作远程数据库
在一个数据库中需要操作远程数据库时,需要创建远程数据库的连接. 连接代码如下: create public database link 连接名 connect to 远程数据库用户名 identifi ...