CentOS7.2にWebVirtMgr(KVMをWebブラウザから管理ツール)をインストール

OS環境
CentOS Linux release 7.2.1511 (Core)

1.依存パッケージをインストール
#yum -y install http://dl.Fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
#yum -y install Git Python-pip libvirt-python libxml2-python python-websockify supervisor nginx
#yum -y install gcc python-devel
#pip install numpy

2.webvirtmgr.gitをダウンロード
#mkdir /application/
#cd /application/
#git clone git://github.com/retspen/webvirtmgr.git
#git clone https://github.com/retspen/webvirtmgr.git
3.sqliteのインストール
#cd /application/
#wget http://www.sqlite.org/sqlite-3.5.6.tar.gz
#cd sqlite-3.5.6/
#./configure –disable-tcl
#make
#make install

4.webvirtmgrのインストール
#cd /application/webvirtmgr

### 必要モジュールのインストール
#pip install -r requirements.txt
### 初期設定
./manage.py syncdb

5.webvirtmgrの設定
#mkdir -pv /var/www
#cp -Rv /application/webvirtmgr /var/www/webvirtmgr

###webvirtmgr.confを設定
#vim /etc/nginx/conf.d/webvirtmgr.conf
server {
listen 80 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
}
}
#chown -R nginx:nginx /var/www/webvirtmgr
#vim /etc/supervisord.conf
[program:webvirtmgr]
command=/usr/bin/python2 /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/python2 /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

grep ‘^bind =’ /var/www/webvirtmgr/conf/gunicorn.conf.py
bind = ‘127.0.0.1:8000’

6.nginxの操作
###nginxを再起動
#systemctl restart nginx.service

#vi /etc/nginx/nginx.conf
### 下記部分をコメントアウトする
39 # listen 80 default_server;

#systemctl restart nginx.service
#systemctl start supervisord.service

###バックグラウンド動作する
#nohup /usr/bin/python2 /var/www/webvirtmgr/manage.py run_gunicorn -c /var/www/webvirtmgr/conf/gunicorn.conf.py &

Comments are closed.