Centos 7 installs WebVirtMgr, manages independent servers, and creates KVM VPS

Centos 7 installs WebVirtMgr, manages independent servers, and creates KVM VPS

Control terminal: 1.1.1.1
Server: 2.2.2.2

The following was used successfully under Centos 7.2.

1. Install WebVirtMgr on the control end

1. Install necessary applications

 sudo yum -y install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm sudo yum -y install git python-pip libvirt-python libxml2-python python-websockify supervisor nginx sudo yum -y install gcc python-devel sudo pip install numpy

2. Install and set up Python and Django

 git clone git://github.com/retspen/webvirtmgr.git cd webvirtmgr sudo pip install -r requirements.txt ./manage.py syncdb ./manage.py collectstatic

Then, set your username and password.

Additional users can be added :

 ./manage.py createsuperuser

3. Set up Nginx

a. Use: Port 8000

 ssh-keygen ssh-copy-id 1.1.1.1 ssh 1.1.1.1 -L localhost:8000:localhost:8000 -L localhost:6080:localhost:6080

b. Nginx settings

 cd .. sudo mv webvirtmgr /var/www/

Add webvirtmgr.conf configuration file

 vi /etc/nginx/conf.d/webvirtmgr.conf

Add the following content:

 server { listen 80 default_server; server_name $hostname; #access_log /var/log/nginx/webvirtmgr_access_log; location /static/ { root /var/www/webvirtmgr/webvirtmgr; 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 600; proxy_read_timeout 600; proxy_send_timeout 600; client_max_body_size 1024M; # Set higher depending on your needs } }

Add Nginx configuration:

 vi /etc/nginx/nginx.conf

Added content:

 include /etc/nginx/conf.d/*.conf;

Restart nginx

 /bin/systemctl restart nginx.service

c. Upgrade SELinux

 /usr/sbin/setsebool httpd_can_network_connect true sudo chkconfig supervisord on

d. Upgrade webvirtmgr

 cd /var/www/webvirtmgr sudo git pull sudo ./manage.py collectstatic sudo service supervisord restart

4. Set up Supervisor
a. Operation

 sudo chown -R nginx:nginx /var/www/webvirtmgr

b. Add configuration

 vi /etc/supervisord.d/webvirtmgr.ini

Add to:

 [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

Restart Supervisor

 /bin/systemctl stop supervisord.service /bin/systemctl start supervisord.service

2. Install KVM on the server

3. Use WebVirtMgr's web method to manage KVM VPS

IV. Other issues

1. pip may not exist, install pip

 wget https://bootstrap.pypa.io/get-pip.py python get-pip.py

Reference: https://github.com/retspen/webvirtmgr/wiki/Install-WebVirtMgr
http://www.linuxidc.com/Linux/2016-10/136589p2.htm

<<:  SpeedyKVM 12GB RAM KVM VPS Seattle Review

>>:  SpeedyKVM: $3.8/month/2.6G memory/1TB hard disk/5TB traffic/KVM/Dallas

Recommend

ihc: $6.2/month/1GB RAM/10GB SSD space/unlimited traffic/KVM/Russia

IHC, a Russian hosting company, provides various ...

On a VPS, collect 1024 image blocks and automatically publish them to WordPress

Environmental requirements : python3, PHP, Mysql....

ValHost: $48/year/4 cores/4GB memory/150GB space/4TB traffic/KVM

ValHost, a Czech hosting company, officially stat...

GreenValueHost: $4.95/month/100GB space/1000GB traffic/10 sites

Introduction GreenValueHost is an American hostin...

Chicago VPS: $5/month/5GB RAM/100GB storage/2TB bandwidth/OpenVZ/Los Angeles

ChicagoVPS, there are 2 special prices now, which...

Recent website overview

I didn't have time to manage the website whil...

G-CORE 512MB RAM 500Mbps Bandwidth Russia Khabarovsk KVM VPS Review

Details : G-CORE: 9.6 yuan/month/512MB memory/7GB...