mirror of
https://github.com/retspen/webvirtcloud
synced 2024-11-01 03:54:15 +00:00
Created CentOS 7.0 installation (markdown)
commit
b17d7bce0e
1 changed files with 95 additions and 0 deletions
95
CentOS-7.0-installation.md
Normal file
95
CentOS-7.0-installation.md
Normal file
|
@ -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`<br />
|
||||
autostart=true`<br />
|
||||
autorestart=true`<br />
|
||||
redirect_stderr=true`<br />
|
||||
|
||||
[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
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue