一个微型的kvm管理平台 ,基于django开发,非常轻量级,功能简单明了。
测试环境:
centos 6.x
webvirtmgr 最新版本
完全照搬官方文档,但补全了一些关键点。完全按官方文档是没有办法配置成功的。
1.安装依赖软件包
yum -y install epel-release
yum -y install git python-pip libvirt-python libxml2-python python-websockify supervisor nginx
2.下载webvirtmgr代码
git clone git://github.com/retspen/webvirtmgr.git
cd webvirtmgr
pip install -r requirements.txt
./manage.py syncdb
会自动创建一个管理用户,根据提示一直next就可以了。
./manage.py collectstatic
3.相较官方文档做一个修改,这里不使用nginx直接用supervisord管理webvirtmgr进程
cd ..
mv webvirtmgr /var/www/ #随意指定,前后一致即可
chkconfig supervisord on
修改/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=root
[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=root
###下面是三个关键的地方
修改webvirtmgr配置文件,官方文档没有这一步,会报错。
vim /var/www/webvirtmgr/conf/gunicorn.conf.py
bind = '192.168.196.129:8000' #ip替换成你自己的主机IP
复制local_settings文件
cd /var/www/webvirtmgr/webvirtmgr/local
cp local_settings.py.example local_settings.py
关闭selinux,已经关闭可忽略
setenforce 0
永久关闭
vim /etc/selinux/config
SELINUX=disabled
启动supervisord
/etc/init.d/supervisord start
4.浏览器访问192.168.196.129:8000,进行WEB界面的配置
测试环境:
centos 6.x
webvirtmgr 最新版本
完全照搬官方文档,但补全了一些关键点。完全按官方文档是没有办法配置成功的。
1.安装依赖软件包
yum -y install epel-release
yum -y install git python-pip libvirt-python libxml2-python python-websockify supervisor nginx
2.下载webvirtmgr代码
git clone git://github.com/retspen/webvirtmgr.git
cd webvirtmgr
pip install -r requirements.txt
./manage.py syncdb
会自动创建一个管理用户,根据提示一直next就可以了。
./manage.py collectstatic
3.相较官方文档做一个修改,这里不使用nginx直接用supervisord管理webvirtmgr进程
cd ..
mv webvirtmgr /var/www/ #随意指定,前后一致即可
chkconfig supervisord on
修改/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=root
[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=root
###下面是三个关键的地方
修改webvirtmgr配置文件,官方文档没有这一步,会报错。
vim /var/www/webvirtmgr/conf/gunicorn.conf.py
bind = '192.168.196.129:8000' #ip替换成你自己的主机IP
复制local_settings文件
cd /var/www/webvirtmgr/webvirtmgr/local
cp local_settings.py.example local_settings.py
关闭selinux,已经关闭可忽略
setenforce 0
永久关闭
vim /etc/selinux/config
SELINUX=disabled
启动supervisord
/etc/init.d/supervisord start
4.浏览器访问192.168.196.129:8000,进行WEB界面的配置