[GH-ISSUE #38] Installation Instructions for CentOS 7 #25

Closed
opened 2026-02-27 15:57:02 +03:00 by kerem · 1 comment
Owner

Originally created by @choclo on GitHub (Jul 31, 2015).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/38

CentOS7 Install Instructions

I recently installed webvirtcloud on CentOS7 bare metal and ran into some issues and misconfigurations that are not documented so I thought I'd share with the community.


Install software

There are some packages you need to install a bit different (well, different names) than ubuntu.

Note:

  • This assumes you are working as root, but if you are not, make sure to "sudo" every command.

rpm installation

yum -y install python-virtualenv python-devel libxml2-dev libvirt-devel glibc gcc nginx supervisor git libxml2 libxml2-devel git

Creating directories and cloning repo

mkdir /srv && cd /srv
git clone https://github.com/retspen/webvirtcloud && cd webvirtcloud

Start installation webvirtcloud

virtualenv venv
source venv/bin/activate
pip install -r conf/requirements.txt
cp conf/nginx/webvirtcloud.conf /etc/nginx/conf.d/
python manage.py migrate

Configure the supervisor for CentOS

Add the following after the [include] line (after *files = ... * actually):

vim /etc/supervisord.conf

[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

Edit the nginx.conf file

You will need to edit the main nginx.conf file as the one that comes from the rpm's will not work. Comment the following lines:

#    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 {
#        }
#    }
}

Also make sure file in /etc/nginx/conf.d/webvirtcloud.conf has the proper paths:

server {
    listen 80;

    server_name servername.domain.com;
    access_log /var/log/nginx/webvirtcloud-access_log; 

    location /static/ {
        root /srv/webvirtcloud;
        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;
    }
}

Change permissions so nginx can read the webvirtcloud folder:

chown -R nginx:nginx /srv/webvirtcloud

Add required user to the kvm group:

usermod -G kvm -a webvirtmgr

Install final required packages for libvirtd and others

wget -O - https://clck.ru/9V9fH | sudo sh

Please note this will not install gstfsd.ini correctly. You will need to download the file and install it manually:

curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/supervisor/gstfsd.conf > /etc/supervisord.d/gstfsd.ini

Let's restart nginx and the supervisord services:

systemctl restart nginx && systemctl restart supervisord

And finally, check everything is running:

supervisorctl status

gstfsd                           RUNNING    pid 24187, uptime 2:59:14
novncd                           RUNNING    pid 24186, uptime 2:59:14
webvirtcloud                     RUNNING    pid 24185, uptime 2:59:14

Done!!

Go to http://serverip and you should see the login screen.

Originally created by @choclo on GitHub (Jul 31, 2015). Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/38 # CentOS7 Install Instructions I recently installed webvirtcloud on CentOS7 bare metal and ran into some issues and misconfigurations that are not documented so I thought I'd share with the community. --- ## Install software There are some packages you need to install a bit different (well, different names) than ubuntu. > **Note:** > - This assumes you are working as root, but if you are not, make sure to "sudo" every command. #### rpm installation ``` yum -y install python-virtualenv python-devel libxml2-dev libvirt-devel glibc gcc nginx supervisor git libxml2 libxml2-devel git ``` #### Creating directories and cloning repo ``` mkdir /srv && cd /srv git clone https://github.com/retspen/webvirtcloud && cd webvirtcloud ``` #### Start installation webvirtcloud ``` virtualenv venv source venv/bin/activate pip install -r conf/requirements.txt cp conf/nginx/webvirtcloud.conf /etc/nginx/conf.d/ python manage.py migrate ``` #### Configure the supervisor for CentOS Add the following after the [include] line (after *_files = ... *_ actually): ``` vim /etc/supervisord.conf [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 ``` #### Edit the nginx.conf file You will need to edit the main nginx.conf file as the one that comes from the rpm's will not work. Comment the following lines: ``` # 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 { # } # } } ``` Also make sure file in **/etc/nginx/conf.d/webvirtcloud.conf** has the proper paths: ``` server { listen 80; server_name servername.domain.com; access_log /var/log/nginx/webvirtcloud-access_log; location /static/ { root /srv/webvirtcloud; 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; } } ``` Change permissions so nginx can read the webvirtcloud folder: ``` chown -R nginx:nginx /srv/webvirtcloud ``` Add required user to the kvm group: ``` usermod -G kvm -a webvirtmgr ``` #### Install final required packages for libvirtd and others ``` wget -O - https://clck.ru/9V9fH | sudo sh ``` **Please note this will not install gstfsd.ini correctly. You will need to download the file and install it manually:** ``` curl https://raw.githubusercontent.com/retspen/webvirtcloud/master/conf/supervisor/gstfsd.conf > /etc/supervisord.d/gstfsd.ini ``` Let's restart nginx and the supervisord services: ``` systemctl restart nginx && systemctl restart supervisord ``` And finally, check everything is running: ``` supervisorctl status gstfsd RUNNING pid 24187, uptime 2:59:14 novncd RUNNING pid 24186, uptime 2:59:14 webvirtcloud RUNNING pid 24185, uptime 2:59:14 ``` Done!! Go to http://serverip and you should see the login screen.
kerem closed this issue 2026-02-27 15:57:02 +03:00
Author
Owner

@soukron commented on GitHub (Jul 31, 2015):

This instructions almost worked for me.

Two notes:

  • python-libguestfs was needed to get gstfsd running
# yum install python-libguestfs
  • /srv/webvirtcloud must have httpd_sys_content_t context if SELinux is enabled
# semanage fcontext -a -t httpd_sys_content_t "/srv/webvirtcloud(/.*)"
# restorecon -Rv /srv/webvirtcloud
<!-- gh-comment-id:126718781 --> @soukron commented on GitHub (Jul 31, 2015): This instructions almost worked for me. Two notes: - python-libguestfs was needed to get gstfsd running ``` # yum install python-libguestfs ``` - /srv/webvirtcloud must have httpd_sys_content_t context if SELinux is enabled ``` # semanage fcontext -a -t httpd_sys_content_t "/srv/webvirtcloud(/.*)" # restorecon -Rv /srv/webvirtcloud ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtcloud#25
No description provided.