kvm虚拟化web管理端

一. webvirtualcloud部署

1.关闭防火墙

systemctl  stop  firewalld

修改配置文件:selinux=disabled (要重启生效)

2.安装epel-release

yum  -y  install  epel-release

yum -y install python3-virtualenv python3-devel libvirt-devel glibc gcc \

    nginx supervisor python3-lxml git python3-libguestfs iproute-tc \

    cyrus-sasl-md5 python3-libguestfs

3.克隆

进入srv目录: cd   /srv

进行克隆:git clone https://github.com/retspen/webvirtcloud

进入webvirtcloud目录:cd  webvirtcloud

升级本地的pip:pip3 install -i https://mirrors.ustc.edu.cn/pypi/web/simple pip -U

配置pip源:pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/web/simple

升级一些安装包:pip install -U setuptools virtualenv

4.修改配置文件

修改脚本:cp webvirtcloud/settings.py.template webvirtcloud/settings.py

创建python虚拟环境:virtualenv -p $(which python3) /srv/envs/webvirtcloud

进入虚拟环境:source /srv/envs/webvirtcloud/bin/activate

执行脚本生成加密字符串:python /srv/webvirtcloud/conf/runit/secret_generator.py

将字符串添加进脚本中:SECRET_KEY = "X^*tIo&S|GhwygIp3}X)qs{wkcAy=vay~.%4^kU#,iKZs*\`&V"

5.安装第三方仓库

安装仓库:pip install -r conf/requirements.txt

数据预处理: python manage.py makemigrations

进行数据迁移:python manage.py migrate

6.编辑webvirtcloud.ini文件

vim /etc/supervisord.d/webvirtcloud.ini

[program:webvirtcloud]

command=/srv/envs/webvirtcloud/bin/gunicorn webvirtcloud.wsgi:application -c /srv/webvirtcloud/gunicorn.conf.py

directory=/srv/webvirtcloud

user=root

autostart=true

autorestart=true

redirect_stderr=true

[program:novncd]

command=/srv/envs/webvirtcloud/bin/python /srv/webvirtcloud/console/novncd

directory=/srv/webvirtcloud

user=root

autostart=true

autorestart=true

redirect_stderr=true

7.设置开机启动webvirtcloud

开机启动:systemctl enable  supervisord

现在启动:systemctl start  supervisord

加载:supervisorctl reload

更新: supervisorctl update

重新启动: supervisorctl restart all

查看启动状态:supervisorctl status

8.配置nginx

编辑配置文件:cp conf/nginx/webvirtcloud.conf /etc/nginx/conf.d/

开机启动:systemctl enable --now nginx

9.修改nginx配置文件

vim  /etc/nginx/nginx.conf

注释掉server,然后再重启服务就可以了

10避免支持USB设备时报错

  • 33
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值