"CentOS Horizon 수동 설치"의 두 판 사이의 차이

잔글 (Jmnote님이 우분투 Horizon 수동 설치 문서를 CentOS Horizon 수동 설치 문서로 이동했습니다)
잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 2명의 중간 판 23개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;manual installation of horizon on Ubuntu
;manual installation of horizon on CentOS
;우분투 Horizon 수동 설치
;CentOS Horizon 수동 설치


==사전작업 1==
==사전작업 1==
* horizon 제외 packstack 설치
* horizon 제외 packstack 설치
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller ~]# netstat -tnlp
[root@controller ~]# netstat -tnlp
Active Internet connections (only servers)
Active Internet connections (only servers)
45번째 줄: 45번째 줄:
tcp6      0      0 :::16509                :::*                    LISTEN      21273/libvirtd       
tcp6      0      0 :::16509                :::*                    LISTEN      21273/libvirtd       
tcp6      0      0 :::35357                :::*                    LISTEN      13657/httpd   
tcp6      0      0 :::35357                :::*                    LISTEN      13657/httpd   
</source>
</syntaxhighlight>


==사전작업 2==
==사전작업 2==
52번째 줄: 52번째 줄:
* [[리눅스 pip 설치]]
* [[리눅스 pip 설치]]
* [[리눅스 gcc 설치]]
* [[리눅스 gcc 설치]]
<source lang='console'>
* [[리눅스 git 설치]]
<syntaxhighlight lang='bash'>
yum install python-devel python-pip gcc git
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@controller ~]# python -V
[root@controller ~]# python -V
Python 2.7.5
Python 2.7.5
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller ~]# rpm -q python-devel
[root@controller ~]# rpm -q python-devel
python-devel-2.7.5-48.el7.x86_64
python-devel-2.7.5-48.el7.x86_64
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller ~]# pip -V
[root@controller ~]# pip -V
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller ~]# gcc --version
[root@controller ~]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
70번째 줄: 74번째 줄:
This is free software; see the source for copying conditions.  There is NO
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</source>
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@controller ~]# git --version
git version 1.8.3.1
</syntaxhighlight>


==git clone==
==git clone==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller ~]# cd /usr/local/
[root@controller ~]# cd /usr/local/
[root@controller local]# git clone https://git.openstack.org/openstack/horizon -b stable/ocata --depth=1
[root@controller local]# git clone https://git.openstack.org/openstack/horizon -b stable/ocata --depth=1
82번째 줄: 90번째 줄:
Receiving objects: 100% (2891/2891), 3.82 MiB | 620.00 KiB/s, done.
Receiving objects: 100% (2891/2891), 3.82 MiB | 620.00 KiB/s, done.
Resolving deltas: 100% (841/841), done.
Resolving deltas: 100% (841/841), done.
</source>
</syntaxhighlight>


==pip install==
==pip install==
* pip로 django 및 Python 라이브러리 등을 설치함
* pip로 django 및 Python 라이브러리 등을 설치함
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller local]# cd horizon
[root@controller local]# cd horizon
[root@controller horizon]# pip install -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata .
[root@controller horizon]# pip install -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata .
92번째 줄: 100번째 줄:
Ignoring dnspython3: markers u"python_version=='3.5'" don't match your environment
Ignoring dnspython3: markers u"python_version=='3.5'" don't match your environment
Processing /usr/local/horizon
Processing /usr/local/horizon
Requirement already satisfied (use --upgrade to upgrade): Babel===2.3.4 in /usr/lib/python2.7/site-packages (from -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata (line 2))
Collecting Django===1.8.17 (from -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata (line 4))
  Downloading Django-1.8.17-py2.py3-none-any.whl (6.2MB)
    100% |████████████████████████████████| 6.2MB 167kB/s
Collecting Pint===0.7.2 (from -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata (line 16))
  Downloading Pint-0.7.2.tar.gz (149kB)
    100% |████████████████████████████████| 153kB 2.6MB/s
... (생략)
... (생략)
   Running setup.py install for horizon ... done
   Running setup.py install for horizon ... done
Successfully installed django-compressor-2.1 django-openstack-auth-3.1.1 django-pyscss-2.0.2 enum34-1.1.6 horizon-0.0.0 netaddr-0.7.19 pathlib-1.0.1 pyScss-1.3.4 pymongo-3.4.0 python-heatclient-1.8.1 pytz-2016.10 rcssmin-1.0.6 requests-2.12.5 rjsmin-1.0.12
Successfully installed django-compressor-2.1 django-openstack-auth-3.1.1 django-pyscss-2.0.2 enum34-1.1.6 horizon-0.0.0 netaddr-0.7.19 pathlib-1.0.1 pyScss-1.3.4 pymongo-3.4.0 python-heatclient-1.8.1 pytz-2016.10 rcssmin-1.0.6 requests-2.12.5 rjsmin-1.0.12
</source>
</syntaxhighlight>


==설정파일 생성==
==설정파일 생성==
* 예제 파일을 복제하여 [[호라이즌 local_settings.py|local_settings.py]] 파일 생성 후 일부수정
* 예제 파일을 복제하여 [[호라이즌 local_settings.py|local_settings.py]] 파일 생성 후 일부수정
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller horizon]# cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
[root@controller horizon]# cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
[root@controller horizon]# cat openstack_dashboard/local/local_settings.py | grep ^DEBUG
[root@controller horizon]# cat openstack_dashboard/local/local_settings.py | grep ^DEBUG
113번째 줄: 128번째 줄:
}
}
[root@controller horizon]# vi openstack_dashboard/local/local_settings.py
[root@controller horizon]# vi openstack_dashboard/local/local_settings.py
</source>
</syntaxhighlight>
<source lang='Python'>
<syntaxhighlight lang='Python'>
#WEBROOT = '/'
#WEBROOT = '/'
WEBROOT = '/dashboard/'
WEBROOT = '/dashboard/'
132번째 줄: 147번째 줄:
# 아래는 신규 추가
# 아래는 신규 추가
COMPRESS_OFFLINE = True
COMPRESS_OFFLINE = True
</source>
</syntaxhighlight>
 
==비밀키저장소 파일==
<source lang='console'>
[root@controller horizon]# touch openstack_dashboard/local/.secret_key_store
[root@controller horizon]# chown apache. openstack_dashboard/local/.secret_key_store
[root@controller horizon]#
</source>


==메시지 컴파일==
==메시지 컴파일==
* US English 외의 다국어 지원을 위한 것
* US English 외의 다국어 지원을 위한 것
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller horizon]# ./manage.py compilemessages
[root@controller horizon]# ./manage.py compilemessages
processing file django.po in /usr/local/horizon/horizon/locale/fi_FI/LC_MESSAGES
processing file django.po in /usr/local/horizon/horizon/locale/fi_FI/LC_MESSAGES
152번째 줄: 160번째 줄:
processing file django.po in /usr/local/horizon/openstack_dashboard/locale/mr/LC_MESSAGES
processing file django.po in /usr/local/horizon/openstack_dashboard/locale/mr/LC_MESSAGES
processing file django.po in /usr/local/horizon/openstack_dashboard/locale/pl_PL/LC_MESSAGES
processing file django.po in /usr/local/horizon/openstack_dashboard/locale/pl_PL/LC_MESSAGES
</source>
</syntaxhighlight>


==정적 asset 적용==
==정적 asset 적용==
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller horizon]# ./manage.py collectstatic
[root@controller horizon]# ./manage.py collectstatic


167번째 줄: 175번째 줄:


Type 'yes' to continue, or 'no' to cancel: yes
Type 'yes' to continue, or 'no' to cancel: yes
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
... (생략)
... (생략)
Copying '/usr/local/horizon/horizon/static/horizon/tests/jasmine/string.legacy-spec.js'
Copying '/usr/local/horizon/horizon/static/horizon/tests/jasmine/string.legacy-spec.js'
175번째 줄: 183번째 줄:


1761 static files copied to '/usr/local/horizon/static'.
1761 static files copied to '/usr/local/horizon/static'.
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller horizon]# ./manage.py compress
[root@controller horizon]# ./manage.py compress
Found 'compress' tags in:
Found 'compress' tags in:
184번째 줄: 192번째 줄:
Compressing... done
Compressing... done
Compressed 6 block(s) from 3 template(s) for 2 context(s).
Compressed 6 block(s) from 3 template(s) for 2 context(s).
</source>
</syntaxhighlight>


==방화벽 설정·재시작==
==방화벽 설정·재시작==
* iptables 파일에 내용 추가하고 적용
* iptables 파일에 내용 추가하고 적용
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller horizon]# iptables -L | grep http
[root@controller horizon]# iptables -L | grep http
[root@controller horizon]# vi /etc/sysconfig/iptables
[root@controller horizon]# vi /etc/sysconfig/iptables
</source>
</syntaxhighlight>
<source lang='text' highlight='2'>
<syntaxhighlight lang='text' highlight='2'>
-A INPUT -p tcp -m multiport --dports 5000,35357 -m comment --comment "001 keystone incoming keystone" -j ACCEPT
-A INPUT -p tcp -m multiport --dports 5000,35357 -m comment --comment "001 keystone incoming keystone" -j ACCEPT
-A INPUT -p tcp -m multiport --dports 80 -m comment --comment "001 horizon 80 incoming" -j ACCEPT
-A INPUT -p tcp -m multiport --dports 80 -m comment --comment "001 horizon 80 incoming" -j ACCEPT
-A INPUT -s 192.168.43.233/32 -p tcp -m multiport --dports 3306 -m comment --comment "001 mariadb incoming mariadb_192.168.43.233" -j ACCEPT
-A INPUT -s 192.168.43.233/32 -p tcp -m multiport --dports 3306 -m comment --comment "001 mariadb incoming mariadb_192.168.43.233" -j ACCEPT
</source>
</syntaxhighlight>
:→ keystone이 있는 줄의 바로 다음 추가하면 됨
:→ keystone이 있는 줄의 바로 다음 추가하면 됨
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller horizon]# systemctl restart iptables
[root@controller horizon]# systemctl restart iptables
[root@controller horizon]# iptables -L | grep http
[root@controller horizon]# iptables -L | grep http
ACCEPT    tcp  --  anywhere            anywhere            multiport dports http /* 001 horizon 80 incoming */
ACCEPT    tcp  --  anywhere            anywhere            multiport dports http /* 001 horizon 80 incoming */
</source>
</syntaxhighlight>
 
==비밀키저장소 파일==
<syntaxhighlight lang='console'>
[root@controller horizon]# touch openstack_dashboard/local/.secret_key_store
[root@controller horizon]# chown apache. openstack_dashboard/local/.secret_key_store
[root@controller horizon]# chmod 0600 openstack_dashboard/local/.secret_key_store
[root@controller horizon]#
</syntaxhighlight>


==아파치 설정·재시작==
==아파치 설정·재시작==
{{참고|/etc/httpd/conf.d/horizon.conf}}
* horizon 아파치 설정파일 신규 작성
* horizon 아파치 설정파일 신규 작성
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller horizon]# vi /etc/httpd/conf.d/horizon.conf
[root@controller horizon]# vi /etc/httpd/conf.d/horizon.conf
</source>
</syntaxhighlight>
<source lang='apache'>
<syntaxhighlight lang='apache'>
<VirtualHost *:80>
<VirtualHost *:80>
     ServerName  controller.openstack.test
     ServerName  controller.openstack.test
     ServerAlias 192.168.43.233
     ServerAlias 192.168.56.101
     ServerAlias localhost
     ServerAlias localhost


222번째 줄: 239번째 줄:
     WSGIDaemonProcess apache group=apache processes=3 threads=10 user=apache
     WSGIDaemonProcess apache group=apache processes=3 threads=10 user=apache
     WSGIProcessGroup apache
     WSGIProcessGroup apache
    WSGIApplicationGroup %{GLOBAL}
     WSGIScriptAlias /dashboard /usr/local/horizon/openstack_dashboard/wsgi/django.wsgi
     WSGIScriptAlias /dashboard /usr/local/horizon/openstack_dashboard/wsgi/django.wsgi
     Alias /dashboard/static /usr/local/horizon/static
     Alias /dashboard/static /usr/local/horizon/static
233번째 줄: 251번째 줄:
     </Location>
     </Location>
</Virtualhost>
</Virtualhost>
</source>
</syntaxhighlight>
<source lang='console'>
<syntaxhighlight lang='console'>
[root@controller horizon]# systemctl restart httpd
[root@controller horizon]# systemctl restart httpd
[root@controller horizon]#  
[root@controller horizon]#  
</source>
</syntaxhighlight>
 
==테스트==
<syntaxhighlight lang='console'>
[root@controller horizon]# curl -I localhost
HTTP/1.1 301 Moved Permanently
Date: Fri, 22 Sep 2017 11:09:21 GMT
Server: Apache/2.4.6 (CentOS)
Location: http://localhost/dashboard
Connection: close
Content-Type: text/html; charset=iso-8859-1
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@controller horizon]# curl -I http://localhost/dashboard
HTTP/1.1 302 FOUND
Date: Fri, 22 Sep 2017 11:08:37 GMT
Server: Apache/2.4.6 (CentOS)
Vary: Accept-Language,Cookie
X-Frame-Options: SAMEORIGIN
Content-Language: en
Location: http://localhost/dashboard/auth/login/?next=/dashboard/
Connection: close
Content-Type: text/html; charset=utf-8
</syntaxhighlight>
<syntaxhighlight lang='console'>
[root@controller horizon]# curl -I http://localhost/dashboard/auth/login/?next=/dashboard/
HTTP/1.1 200 OK
Date: Fri, 22 Sep 2017 11:09:59 GMT
Server: Apache/2.4.6 (CentOS)
Content-Language: en
Expires: Fri, 22 Sep 2017 11:09:59 GMT
Vary: Cookie,Accept-Language,Accept-Encoding
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
X-Frame-Options: SAMEORIGIN
Set-Cookie: csrftoken=jjEQVnctC8mpsZ0OxNffcyxKSRiFbjSp; Path=/
Last-Modified: Fri, 22 Sep 2017 11:09:59 GMT
Content-Length: 8637
Connection: close
Content-Type: text/html; charset=utf-8
</syntaxhighlight>


==같이 보기==
==같이 보기==

2021년 9월 24일 (금) 23:33 기준 최신판

1 개요[ | ]

manual installation of horizon on CentOS
CentOS Horizon 수동 설치

2 사전작업 1[ | ]

  • horizon 제외 packstack 설치
[root@controller ~]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:8774            0.0.0.0:*               LISTEN      12550/python2       
tcp        0      0 0.0.0.0:9191            0.0.0.0:*               LISTEN      14477/python2       
tcp        0      0 0.0.0.0:8775            0.0.0.0:*               LISTEN      12550/python2       
tcp        0      0 0.0.0.0:8776            0.0.0.0:*               LISTEN      11390/python2       
tcp        0      0 0.0.0.0:25672           0.0.0.0:*               LISTEN      9677/beam           
tcp        0      0 127.0.0.1:6633          0.0.0.0:*               LISTEN      19256/python2       
tcp        0      0 192.168.43.233:873      0.0.0.0:*               LISTEN      10697/xinetd        
tcp        0      0 192.168.43.233:27017    0.0.0.0:*               LISTEN      8487/mongod         
tcp        0      0 0.0.0.0:8778            0.0.0.0:*               LISTEN      13657/httpd         
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      5076/mysqld         
tcp        0      0 192.168.43.233:6379     0.0.0.0:*               LISTEN      9141/redis-server 1 
tcp        0      0 0.0.0.0:11211           0.0.0.0:*               LISTEN      7692/memcached      
tcp        0      0 0.0.0.0:9292            0.0.0.0:*               LISTEN      14409/python2       
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           
tcp        0      0 127.0.0.1:6640          0.0.0.0:*               LISTEN      18378/ovsdb-server  
tcp        0      0 192.168.43.233:6000     0.0.0.0:*               LISTEN      17513/python2       
tcp        0      0 192.168.43.233:8080     0.0.0.0:*               LISTEN      15792/python2       
tcp        0      0 192.168.43.233:6001     0.0.0.0:*               LISTEN      17302/python2       
tcp        0      0 0.0.0.0:4369            0.0.0.0:*               LISTEN      1/systemd           
tcp        0      0 192.168.43.233:6002     0.0.0.0:*               LISTEN      17083/python2       
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      604/sshd            
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      853/master          
tcp        0      0 0.0.0.0:16509           0.0.0.0:*               LISTEN      21273/libvirtd      
tcp        0      0 0.0.0.0:9696            0.0.0.0:*               LISTEN      16503/python2       
tcp        0      0 0.0.0.0:6080            0.0.0.0:*               LISTEN      12876/python2       
tcp6       0      0 :::5000                 :::*                    LISTEN      13657/httpd         
tcp6       0      0 :::5672                 :::*                    LISTEN      9677/beam           
tcp6       0      0 :::8777                 :::*                    LISTEN      13657/httpd         
tcp6       0      0 :::8041                 :::*                    LISTEN      13657/httpd         
tcp6       0      0 :::8042                 :::*                    LISTEN      13657/httpd         
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           
tcp6       0      0 :::80                   :::*                    LISTEN      13657/httpd         
tcp6       0      0 :::22                   :::*                    LISTEN      604/sshd            
tcp6       0      0 ::1:25                  :::*                    LISTEN      853/master          
tcp6       0      0 :::16509                :::*                    LISTEN      21273/libvirtd      
tcp6       0      0 :::35357                :::*                    LISTEN      13657/httpd

3 사전작업 2[ | ]

yum install python-devel python-pip gcc git
[root@controller ~]# python -V
Python 2.7.5
[root@controller ~]# rpm -q python-devel
python-devel-2.7.5-48.el7.x86_64
[root@controller ~]# pip -V
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
[root@controller ~]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@controller ~]# git --version
git version 1.8.3.1

4 git clone[ | ]

[root@controller ~]# cd /usr/local/
[root@controller local]# git clone https://git.openstack.org/openstack/horizon -b stable/ocata --depth=1
Cloning into 'horizon'...
remote: Counting objects: 2891, done.
remote: Compressing objects: 100% (2490/2490), done.
remote: Total 2891 (delta 841), reused 1028 (delta 184)
Receiving objects: 100% (2891/2891), 3.82 MiB | 620.00 KiB/s, done.
Resolving deltas: 100% (841/841), done.

5 pip install[ | ]

  • pip로 django 및 Python 라이브러리 등을 설치함
[root@controller local]# cd horizon
[root@controller horizon]# pip install -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata .
Ignoring dnspython3: markers u"python_version=='3.4'" don't match your environment
Ignoring dnspython3: markers u"python_version=='3.5'" don't match your environment
Processing /usr/local/horizon
Requirement already satisfied (use --upgrade to upgrade): Babel===2.3.4 in /usr/lib/python2.7/site-packages (from -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata (line 2))
Collecting Django===1.8.17 (from -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata (line 4))
  Downloading Django-1.8.17-py2.py3-none-any.whl (6.2MB)
    100% |████████████████████████████████| 6.2MB 167kB/s 
Collecting Pint===0.7.2 (from -c http://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata (line 16))
  Downloading Pint-0.7.2.tar.gz (149kB)
    100% |████████████████████████████████| 153kB 2.6MB/s 
... (생략)
  Running setup.py install for horizon ... done
Successfully installed django-compressor-2.1 django-openstack-auth-3.1.1 django-pyscss-2.0.2 enum34-1.1.6 horizon-0.0.0 netaddr-0.7.19 pathlib-1.0.1 pyScss-1.3.4 pymongo-3.4.0 python-heatclient-1.8.1 pytz-2016.10 rcssmin-1.0.6 requests-2.12.5 rjsmin-1.0.12

6 설정파일 생성[ | ]

[root@controller horizon]# cp openstack_dashboard/local/local_settings.py.example openstack_dashboard/local/local_settings.py
[root@controller horizon]# cat openstack_dashboard/local/local_settings.py | grep ^DEBUG
DEBUG = True
[root@controller horizon]# cat openstack_dashboard/local/local_settings.py | grep OPENSTACK_HOST
OPENSTACK_HOST = "127.0.0.1"
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
[root@controller horizon]# cat openstack_dashboard/local/local_settings.py | grep ^CACHES -A4
CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
    },
}
[root@controller horizon]# vi openstack_dashboard/local/local_settings.py
#WEBROOT = '/'
WEBROOT = '/dashboard/'

#ALLOWED_HOSTS = ['horizon.example.com', ]
ALLOWED_HOSTS = ['*']

# 아래는 주석 해제
OPENSTACK_API_VERSIONS = {
    "data-processing": 1.1,
    "identity": 3,
    "image": 2,
    "volume": 2,
    "compute": 2,
}

# 아래는 신규 추가
COMPRESS_OFFLINE = True

7 메시지 컴파일[ | ]

  • US English 외의 다국어 지원을 위한 것
[root@controller horizon]# ./manage.py compilemessages
processing file django.po in /usr/local/horizon/horizon/locale/fi_FI/LC_MESSAGES
processing file django.po in /usr/local/horizon/horizon/locale/ca/LC_MESSAGES
processing file django.po in /usr/local/horizon/horizon/locale/it/LC_MESSAGE
... (생략)
processing file django.po in /usr/local/horizon/openstack_dashboard/locale/ks/LC_MESSAGES
processing file django.po in /usr/local/horizon/openstack_dashboard/locale/mr/LC_MESSAGES
processing file django.po in /usr/local/horizon/openstack_dashboard/locale/pl_PL/LC_MESSAGES

8 정적 asset 적용[ | ]

[root@controller horizon]# ./manage.py collectstatic

You have requested to collect static files at the destination
location as specified in your settings:

    /usr/local/horizon/static

This will overwrite existing files!
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes
... (생략)
Copying '/usr/local/horizon/horizon/static/horizon/tests/jasmine/string.legacy-spec.js'
Copying '/usr/local/horizon/horizon/static/horizon/tests/jasmine/tables.legacy-spec.js'
Copying '/usr/local/horizon/horizon/static/horizon/tests/jasmine/templates.legacy-spec.js'

1761 static files copied to '/usr/local/horizon/static'.
[root@controller horizon]# ./manage.py compress
Found 'compress' tags in:
	/usr/local/horizon/openstack_dashboard/templates/horizon/_conf.html
	/usr/local/horizon/openstack_dashboard/templates/_stylesheets.html
	/usr/local/horizon/openstack_dashboard/templates/horizon/_scripts.html
Compressing... done
Compressed 6 block(s) from 3 template(s) for 2 context(s).

9 방화벽 설정·재시작[ | ]

  • iptables 파일에 내용 추가하고 적용
[root@controller horizon]# iptables -L | grep http
[root@controller horizon]# vi /etc/sysconfig/iptables
-A INPUT -p tcp -m multiport --dports 5000,35357 -m comment --comment "001 keystone incoming keystone" -j ACCEPT
-A INPUT -p tcp -m multiport --dports 80 -m comment --comment "001 horizon 80 incoming" -j ACCEPT
-A INPUT -s 192.168.43.233/32 -p tcp -m multiport --dports 3306 -m comment --comment "001 mariadb incoming mariadb_192.168.43.233" -j ACCEPT
→ keystone이 있는 줄의 바로 다음 추가하면 됨
[root@controller horizon]# systemctl restart iptables
[root@controller horizon]# iptables -L | grep http
ACCEPT     tcp  --  anywhere             anywhere             multiport dports http /* 001 horizon 80 incoming */

10 비밀키저장소 파일[ | ]

[root@controller horizon]# touch openstack_dashboard/local/.secret_key_store
[root@controller horizon]# chown apache. openstack_dashboard/local/.secret_key_store
[root@controller horizon]# chmod 0600 openstack_dashboard/local/.secret_key_store
[root@controller horizon]#

11 아파치 설정·재시작[ | ]

  • horizon 아파치 설정파일 신규 작성
[root@controller horizon]# vi /etc/httpd/conf.d/horizon.conf
<VirtualHost *:80>
    ServerName  controller.openstack.test
    ServerAlias 192.168.56.101
    ServerAlias localhost

    DocumentRoot /usr/local/horizon/
    ErrorLog /var/log/httpd/horizon_error.log
    CustomLog /var/log/httpd/horizon_access.log combined
    LogLevel warn

    WSGIDaemonProcess apache group=apache processes=3 threads=10 user=apache
    WSGIProcessGroup apache
    WSGIApplicationGroup %{GLOBAL}
    WSGIScriptAlias /dashboard /usr/local/horizon/openstack_dashboard/wsgi/django.wsgi
    Alias /dashboard/static /usr/local/horizon/static
    RedirectMatch permanent  ^/$ /dashboard

    <Location "/">
        Require all granted
    </Location>
    <Location "/static">
        SetHandler None
    </Location>
</Virtualhost>
[root@controller horizon]# systemctl restart httpd
[root@controller horizon]#

12 테스트[ | ]

[root@controller horizon]# curl -I localhost
HTTP/1.1 301 Moved Permanently
Date: Fri, 22 Sep 2017 11:09:21 GMT
Server: Apache/2.4.6 (CentOS)
Location: http://localhost/dashboard
Connection: close
Content-Type: text/html; charset=iso-8859-1
[root@controller horizon]# curl -I http://localhost/dashboard
HTTP/1.1 302 FOUND
Date: Fri, 22 Sep 2017 11:08:37 GMT
Server: Apache/2.4.6 (CentOS)
Vary: Accept-Language,Cookie
X-Frame-Options: SAMEORIGIN
Content-Language: en
Location: http://localhost/dashboard/auth/login/?next=/dashboard/
Connection: close
Content-Type: text/html; charset=utf-8
[root@controller horizon]# curl -I http://localhost/dashboard/auth/login/?next=/dashboard/
HTTP/1.1 200 OK
Date: Fri, 22 Sep 2017 11:09:59 GMT
Server: Apache/2.4.6 (CentOS)
Content-Language: en
Expires: Fri, 22 Sep 2017 11:09:59 GMT
Vary: Cookie,Accept-Language,Accept-Encoding
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
X-Frame-Options: SAMEORIGIN
Set-Cookie: csrftoken=jjEQVnctC8mpsZ0OxNffcyxKSRiFbjSp; Path=/
Last-Modified: Fri, 22 Sep 2017 11:09:59 GMT
Content-Length: 8637
Connection: close
Content-Type: text/html; charset=utf-8

13 같이 보기[ | ]

14 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}