1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 15:15:22 +00:00
7 CentOS 7 installation
catborise edited this page 2023-08-15 16:58:22 +03:00
  1. Install dependencies:

    sudo yum install -y epel-release
    sudo yum -y install python-virtualenv python-devel libvirt-devel glibc gcc nginx supervisor libxml2 libxml2-devel git
    
  2. Create working directory and clone repo into it:

    sudo mkdir -p /srv && cd /srv
    sudo git clone https://github.com/retspen/webvirtcloud && cd webvirtcloud
    
  3. Edit 'conf/requirements.txt':

    • change libvirt-python to version, installed in your system (yum info libvirt-python, for now it's 3.2.0);
    • uncomment libxml2-python from retspen repo / comment gnome version.
  4. Install webvirtcloud:

    sudo virtualenv venv
    sudo source venv/bin/activate
    sudo venv/bin/pip install --upgrade pip
    sudo venv/bin/pip install -r conf/requirements.txt
    sudo cp conf/nginx/webvirtcloud.conf /etc/nginx/conf.d/
    sudo venv/bin/python manage.py migrate
    
  5. Edit '/etc/supervisord.conf': Add the following after the [include] line (after **files = ... ** actually):

    [program:webvirtcloud]
    command=/srv/webvirtcloud/venv/bin/gunicorn webvirtcloud.wsgi:application -c /srv/webvirtcloud/gunicorn.conf.py
    directory=/srv/webvirtcloud
    user=nginx
    autostart=true
    autorestart=true
    redirect_stderr=true
    
    [program:novncd]
    command=/srv/webvirtcloud/venv/bin/python /srv/webvirtcloud/console/novncd
    directory=/srv/webvirtcloud
    user=nginx
    autostart=true
    autorestart=true
    redirect_stderr=true
    
  6. Edit the '/etc/nginx/nginx.conf': Comment out 'server' section:

    #    server {
    #        listen       80 default_server;
    #        listen       [::]:80 default_server;
    #        server_name  _;
    #        root         /usr/share/nginx/html;
    #
    #        # Load configuration files for the default server block.
    #        include /etc/nginx/default.d/*.conf;
    #
    #        location / {
    #        }
    #
    #        error_page 404 /404.html;
    #            location = /40x.html {
    #        }
    #
    #        error_page 500 502 503 504 /50x.html;
    #            location = /50x.html {
    #        }
    #    }
    
  7. Change owner for working directory:

    sudo chown -R nginx:nginx /srv/webvirtcloud
    
  8. Enable end start services:

    sudo systemctl enable nginx
    sudo systemctl enable supervisord
    sudo systemctl start nginx
    sudo systemctl start supervisord
    
    
  9. SELinux. You can disable / switch to permissive mode or check 'denied' messaget in '/var/log/audit/audit.log' and create custom selinux modules:

    • check last message with
      cat /var/log/audit/audit.log | grep denied | tail -1
      
    • create and install module:
      cat /var/log/audit/audit.log | grep denied | tail -1 | audit2allow -M <MODULE_NAME> && semodule -i <MODULE_NAME>.pp