安装 kvm 管理面板
apt-get install nginx supervisor
apt-get update
apt-get install qemu-kvm libvirt-bin virtinst bridge-utils
apt-get install qemu-kvm libvirt-bin virtinst bridge-utils
apt-get install git python-pip python-libvirt python-libxml2 novnc
mkdir -p /var/www
cd /var/www
git clone git://github.com/retspen/webvirtmgr.git
cd webvirtmgr
pip install -r requirements.txt
./manage.py syncdb
./manage.py collectstatic
cd /var/www
git clone git://github.com/retspen/webvirtmgr.git
cd webvirtmgr
pip install -r requirements.txt
./manage.py syncdb
./manage.py collectstatic
server {
listen 80;
#listen 443 ssl;
server_name kvm.example.com;
#ssl_certificate certs/kvm.example.com.chained.crt;
#ssl_certificate_key certs/kvm.example.com.key;
access_log /var/log/nginx/$host.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;
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
}
}
listen 80;
#listen 443 ssl;
server_name kvm.example.com;
#ssl_certificate certs/kvm.example.com.chained.crt;
#ssl_certificate_key certs/kvm.example.com.key;
access_log /var/log/nginx/$host.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;
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
}
}
[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
stdout_logfile=/var/log/supervisor/webvirtmgr.log
redirect_stderr=true
user=www-data
[program:webvirtmgr-console]
command=/usr/bin/python /var/www/webvirtmgr/console/webvirtmgr-console -d
directory=/var/www/webvirtmgr
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/webvirtmgr-console.log
redirect_stderr=true
user=www-data
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
stdout_logfile=/var/log/supervisor/webvirtmgr.log
redirect_stderr=true
user=www-data
[program:webvirtmgr-console]
command=/usr/bin/python /var/www/webvirtmgr/console/webvirtmgr-console -d
directory=/var/www/webvirtmgr
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/webvirtmgr-console.log
redirect_stderr=true
user=www-data
<graphics type='%s' port='-1' autoport='yes' listen='0.0.0.0'>
<listen type='address' address='0.0.0.0'/>
</graphics>
<listen type='address' address='0.0.0.0'/>
</graphics>
<graphics type='%s' port='-1' autoport='yes'/>
elif console_socket or re.match('^127\.', console_host):
elif console_socket or (re.match('^127\.', console_host) and conntype != CONN_SOCKET):
WS_HOST = '0.0.0.0'
WS_PUBLIC_HOST = 'kvm.example.com'
WS_CERT = '/etc/nginx/certs/kvm.example.com.pem'
WS_PUBLIC_HOST = 'kvm.example.com'
WS_CERT = '/etc/nginx/certs/kvm.example.com.pem'
usermod -a -G libvirtd www-data
chown -R www-data:www-data /var/www/webvirtmgr
chown -R www-data:www-data /var/www/webvirtmgr
service supervisor restart
service nginx restart
service nginx restart
cd /var/lib/libvirt/boot
wget http://mirrors.kernel.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1511.iso
wget http://mirrors.kernel.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1511.iso