Install and use KVM Web management tool webjavasmgr

Source: Internet
Author: User

Install and use KVM Web management tool webjavasmgr

Install and use kvm web management tool webjavasmgr

[Abstract: Production of KVM host more and more, need to control the host status. There, we use websitemgr for governance. Graphical WEB makes it easier to inspect the environment war operations of kvm host machine. The hardware source yum-y installhttp supported by device 1]

As more and more KVM hosts exist in the production environment, you need to adjust the host status. Here we use webjavasmgr for management. Graphical WEB allows you to view the situation and operations of kvm host more conveniently.

1. Install supported software sources
Yum-y install http://dl.Fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
2. Install related software
Yum-y install git python-pip libvirt-python libxml2-python python-websockify supervisor nginx
3. Download the related web‑mgr code from git-hub.
Cd/usr/local/src/
Git clone git: // github.com/ret#/webjavasmgr.git
4. Install webjavasmgr
Cd websitemgr/
Pip install-r requirements.txt
5. Install the database
Yum install python-sqlite2
6. Configure django Environment
./Manage. py syncdb
You just installed Django's auth system, which means you don't have any superusers defined.
Wocould you like to create one now? (Yes/no): yes
Username (leave blank to use 'root'): admin
Email address: 2733176200@qq.com
Password :*********
Password (again ):*********
 
./Manage. py collectstatic # generate the configuration file
./Manage. py createsuperuser # Add an Administrator Account
 
7. Copy the web to the relevant directory
Cd ..
Mkdir-pv/var/www
Cp-Rv web1_mgr/var/www/web1_mgr
 
8. Set 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. Edit the nginx configuration file
Vim/etc/nginx/conf. d/webjavasmgr. conf Add the following content to the file.
Server {
Listen 80 default_server;
 
Server_name $ hostname;
# Access_log/var/log/nginx/webbench mgr_access_log;
 
Location/static /{
Root/var/www/web1_mgr/web1_mgr; # 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_timeouts 600;
Client_max_body_size 1024 M; # 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. Modify firewall rules
/Usr/sbin/setsebool httpd_can_network_connect true
 
 
12. Set a supervisor
Chown-R nginx: nginx/var/www/web1_mgr
Vim/etc/supervisord. conf # Add at the end of the file
[Program: webjavasmgr]
Command =/usr/bin/python/var/www/web1_mgr/manage. py run_gunicorn-c/var/www/web1_mgr/conf/gunicorn. conf. py
Directory =/var/www/web1_mgr
Autostart = true
Autorestart = true
Logfile =/var/log/supervisor/web‑mgr. log
Log_stderr = true
User = nginx
 
[Program: webjavasmgr-console]
Command =/usr/bin/python/var/www/webbench Mgr/console/webbench Mgr-console
Directory =/var/www/web1_mgr
Autostart = true
Autorestart = true
Stdout_logfile =/var/log/supervisor/webvirtmgr-console.log
Redirect_stderr = true
User = nginx
 
 
Modify/var/www/webjavasmgr/conf/gunicorn. conf. py
Bind = "0: 8000"
 
13 set startup
Chkconfig supervisord on
Vim/etc/rc. local
/Usr/sbin/setsebool httpd_can_network_connect true
 
 
 
14. Start the process
/Etc/init. d/supervisord restart
 
15 view Processes
Netstat-lnpt: You can see that 6080 and 8000 have been started.
 
16 web Access
Http: // 192.168.0.194/login/

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.