From b17d7bce0e17f37059a4910ec53e549f7b585455 Mon Sep 17 00:00:00 2001 From: Pavel Sukhanov <31385755+ps78674@users.noreply.github.com> Date: Thu, 9 Nov 2017 13:32:41 +0300 Subject: [PATCH] Created CentOS 7.0 installation (markdown) --- CentOS-7.0-installation.md | 95 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 CentOS-7.0-installation.md diff --git a/CentOS-7.0-installation.md b/CentOS-7.0-installation.md new file mode 100644 index 0000000..d404bd7 --- /dev/null +++ b/CentOS-7.0-installation.md @@ -0,0 +1,95 @@ +1. Install dependencies: + ``` + sudo yum -y install python-virtualenv python-devel libvirt-devel glibc gcc nginx supervisor libxml2 libxml2-devel git + ``` + +2. Create working directory and repo into it: + ``` + sudo mkdir /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 && semodule -i .pp + ``` + + + +