$ sudo git clone https://github.com/openstack/horizon.git /opt/horizon
$ cd /opt/horizon ; git checkout -b folsom origin/stable/folsom
$ sudo pip install -r /opt/horizon/tools/pip-requires
$ cd /opt/horizon && sudo python setup.py install
$ sudo cp -a /opt/horizon/openstack_dashboard/local/local_settings.py.example /opt/horizon/openstack_dashboard/local/local_settings.py
$ NOVA_CONTOLLER_HOSTNAME=stack01
$ MYSQL_PASS_HORIZON=password
$ sudo sed -i "s#127.0.0.1#$NOVA_CONTOLLER_HOSTNAME#" /opt/horizon/openstack_dashboard/local/local_settings.py
$ sudo sed -i "s#locmem://#memcached://$NOVA_CONTOLLER_HOSTNAME:11211#g" /opt/horizon/openstack_dashboard/local/local_settings.py
$ cat << HORIZON_SETUP | sudo tee -a /opt/horizon/openstack_dashboard/local/local_settings.py > /dev/null
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'horizon',
'USER': 'horizon',
'PASSWORD': '$MYSQL_PASS_HORIZON',
'HOST': '$NOVA_CONTOLLER_HOSTNAME',
'default-character-set': 'utf8'
}
}
HORIZON_CONFIG = {
'dashboards': ('nova', 'syspanel', 'settings',),
'default_dashboard': 'nova',
'user_home': 'openstack_dashboard.views.user_home',
}
SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
OPENSTACK_KEYSTONE_ADMIN_URL="http://%s:35357/v2.0" % OPENSTACK_HOST
HORIZON_SETUP
$ MYSQL_PASS_HORIZON=password
$ NOVA_CONTOLLER_HOSTNAME=stack01
$ mysql -uroot -pnova -e "drop database if exists horizon;"
$ mysql -uroot -pnova -e "create database horizon;"
$ mysql -uroot -pnova -e "grant all privileges on horizon.* to 'horizon'@'%' identified by '$MYSQL_PASS_HORIZON';"
$ mysql -uroot -pnova -e "grant all privileges on horizon.* to 'horizon'@'localhost' identified by '$MYSQL_PASS_HORIZON';"
$ mysql -uroot -pnova -e "grant all privileges on horizon.* to 'horizon'@'$NOVA_CONTOLLER_HOSTNAME' identified by '$MYSQL_PASS_HORIZON';"
$ cd /opt/horizon && ./manage.py syncdb --noinput
$ sudo apt-get install nodejs -y
$ sudo mkdir -p /opt/horizon/.blackhole
$ sudo mkdir /opt/horizon/static
$ sudo chown www-data:www-data /opt/horizon/static
$ sudo cp -a /etc/apache2/sites-available/default /etc/apache2/sites-available/default_orig
$ cat << 'APACHE_SETUP' | sudo tee /etc/apache2/sites-available/default > /dev/null
<VirtualHost *:80>
WSGIScriptAlias / /opt/horizon/openstack_dashboard/wsgi/django.wsgi
WSGIDaemonProcess horizon user=www-data group=www-data processes=3 threads=10
SetEnv APACHE_RUN_USER www-data
SetEnv APACHE_RUN_GROUP www-data
WSGIProcessGroup horizon
DocumentRoot /opt/horizon/.blackhole
Alias /media /opt/horizon/openstack_dashboard/static/
#Alias /vpn /opt/stack/vpn
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /opt/horizon/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
APACHE_SETUP
$ git clone https://github.com/kanaka/noVNC.git /opt/noVNC $ cat << ‘noVNC_INIT’ | sudo tee /etc/init/nova-novncproxy.conf > /dev/null description “noVNC” author “hagix9 <hagihara.shiro@fulltrust.co.jp>”
start on runlevel [2345] stop on runlevel [016]
- post-start script
- cd /opt/noVNC && ./utils/nova-novncproxy –config-file=/etc/nova/nova.conf –web . >/dev/null 2>&1 &
end script post-stop script
kill $(ps -ef | grep nova-novncproxy | grep -v grep | awk ‘{print $2}’)end script noVNC_INIT $ sudo stop nova-novncproxy ; sudo start nova-novncproxy
設定変更を行ったのでApacheを再起動しておきます。
$ service apache2 restart
[Tue Oct 30 03:15:35 2012] [error] DEBUG:cinderclient.client:REQ: curl -i http://stack01:8776/v1/9242ed0fd4d34bd98337389ca4eb1624/volumes/detail -X GET -H "X-Auth-Project-Id: 9242ed0fd4d34bd98337389ca4eb1624" -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: 2463ef8cd207458e83be8e7e3019c685"
[Tue Oct 30 03:15:35 2012] [error]
[Tue Oct 30 03:15:35 2012] [error] DEBUG:cinderclient.client:RESP:{'status': '200', 'content-length': '15', 'content-location': u'http://stack01:8776/v1/9242ed0fd4d34bd98337389ca4eb1624/volumes/detail', 'x-compute-request-id': 'req-e7d6b01d-0a64-47e7-8bba-0632913553ad', 'date': 'Tue, 30 Oct 2012 03:15:35 GMT', 'content-type': 'application/json'} {"volumes": []}
[Tue Oct 30 03:15:35 2012] [error]