KVM Web management tool webvirtmgr installation and use
[Abstract: More and more KVM host hosts are required to control the status of the host. There with webvirtmgr to hold the governance. The graphical web makes it easier to censor the KVM host's environmental warfare control 1 device supported hardware source Yum-y Installhttp]
The growing number of KVM host hosts in the production environment requires the host's state to be regulated. It is managed here with Webvirtmgr. Graphical web that makes it easier to view KVM host scenarios and operations
1 Installing the Supported software sources
Yum-y Install http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
2 Installing related software
Yum-y install git python-pip libvirt-python libxml2-python python-websockify Supervisor Nginx
3 Download related webvirtmgr codes from Git-hub
cd/usr/local/src/
git clone git://github.com/retspen/webvirtmgr.git
4 Installing Webvirtmgr
CD webvirtmgr/
Pip Install-r requirements.txt
5 Installing the Database
Yum Install Python-sqlite2
6 Configuring the Environment for Django
./manage.py syncdb
You just installed Django's auth system, which means you don ' t has any superusers defined.
Would to create one now? (yes/no): Yes
Username (leave blank to use ' root '): admin
Email address: [Email protected]
password:*********
Password (again):* ********
./manage.py collectstatic #生成配置文件
./manage.py Createsuperuser #添加管理员账号
7 Copy Web to related directory
Cd..
Mkdir-pv/var/www
CP-RV Webvirtmgr/var/www/webvirtmgr
8 Setting up SSH
Ssh-keygen
Ssh-copy-id 192.168.2.32
SSH 192.168.2.32-l localhost:8000:localhost:8000-l localhost:6080:localhost:6080
9 编辑nginx配置文件
vim/etc/nginx/conf.d/webvirtmgr.conf Add the following content to the file
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 $remote _addr;
Proxy_connect_timeout 600;
Proxy_read_timeout 600;
Proxy_send_timeout 600;
Client_max_body_size 1024M; # Set Higher depending on your needs
}
}
Mv/etc/nginx/conf.d/default.conf/etc/nginx/conf.d/default.conf.bak
10 Start Nginx
/etc/init.d/nginx restart
11 Modifying firewall rules
/usr/sbin/setsebool Httpd_can_network_connect True
12 Setting Supervisor
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
Modify/var/www/webvirtmgr/conf/gunicorn.conf.py
bind = "0:8,000"
13 Set Boot up
Chkconfig Supervisord on
Vim/etc/rc.local
/usr/sbin/setsebool Httpd_can_network_connect True
14 START process
/etc/init.d/supervisord restart
15 Viewing processes
NETSTAT-LNPT can see that 6080 and 8000 have started
Web Access
http://192.168.0.194/login/
This article from "Nicol Lock Silk Sorrow" blog, please make sure to keep this source http://smoke520.blog.51cto.com/9256117/1795697
KVM Web management tool webvirtmgr installation and use