我在ubuntu 16.04 vagrant box上安装了OpenStack,除了仪表板外,所有这些都很好,当我打开它时,我会收到以下错误:
mod_wsgi (pid=6601): Target WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi' cannot be loaded as Python module.
mod_wsgi (pid=6601): Exception occurred processing WSGI script '/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi'.
Traceback (most recent call last):
File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi", line 16, in <module>
application = get_wsgi_application()
File "/usr/lib/python2.7/dist-packages/django/core/wsgi.py", line 14, in get_wsgi_application
django.setup()
File "/usr/lib/python2.7/dist-packages/django/__init__.py", line 17, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 48, in __getattr__
self._setup(name)
File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 44, in _setup
self._wrapped = Settings(settings_module)
File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 92, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/share/openstack-dashboard/openstack_dashboard/settings.py", line 335, in <module>
from local.local_settings import * # noqa
File "/usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py", line 132, in <module>
SECRET_KEY = secret_key.generate_or_read_from_file('/var/lib/openstack-dashboard/secret_key')
File "/usr/share/openstack-dashboard/horizon/utils/secret_key.py", line 68, in generate_or_read_from_file
key = read_from_file(key_file)
File "/usr/share/openstack-dashboard/horizon/utils/secret_key.py", line 50, in read_from_file
with open(key_file, 'r') as f:
IOError: [Errno 13] Permission denied: '/var/lib/openstack-dashboard/secret_key'
我知道密钥是由Apache生成的,低于密钥的权限。
vagrant@vagrant:/var/lib/openstack-dashboard$ ls -ltrh
total 12K
drwxr-xr-x 2 root root 4.0K Feb 22 19:40 secret-key
-rw-r--r-- 1 root root 0 Mar 6 08:19 _var_lib_openstack-dashboard_secret_key.lock
-rw------- 1 root root 64 Mar 6 08:19 secret_key
drwxr-xr-x 10 www-data www-data 4.0K Mar 6 10:06 static
我按照安装指南安装了仪表板。
chown -R www-data:www-data secret-key
那么,没关系!
root@controller:/var/lib/openstack-dashboard# ll
total 20
drwxr-xr-x 4 root root 4096 May 9 13:51 ./
drwxr-xr-x 51 root root 4096 May 9 13:29 ../
-rw------- 1 www-data www-data 64 May 9 13:29 secret_key
drwxr-xr-x 2 root root 4096 Apr 2 18:44 secret-key/
drwxr-xr-x 10 www-data www-data 4096 May 9 13:29 static/
-rw-r--r-- 1 root root 0 May 9 13:29 _var_lib_openstack-dashboard_secret_key.lock
检查位于
的OpenStack-Dashboard.conf/etc/apache2/conf-available/openstack-dashboard.conf
必须提到必须授予许可的用户为:
WSGIDAEMONPROCESS HORIDON user = Horizon Group = Horizon contesses = 3螺纹= 10 display-name =%{group}
因此,将权限更改为用户 - &gt;Horizon为我工作sudo chown horizon/usr/lib/python3/dist-packages/openstack_dashboard/local/.secret_key_store
sudo chmod 0600/usr/lib/python3/dist-packages/openstack_dashboard/local/.secret_key_store_store>