Я установил OpenStack на бродячую коробку Ubuntu 16.04, все работает хорошо, кроме панели инструментов, когда я открываю ее, я получаю следующую ошибку:
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
Я установил Dashboard, следуя руководству по установке.
vagrant@vagrant:~$ ps -ef |grep apache2 root 3782 1 0 20:19 ? 00:00:00 /usr/sbin/apache2 -k start www-data 28787 3782 0 21:54 ? 00:00:00 /usr/sbin/apache2 -k start www-data 28788 3782 0 21:54 ? 00:00:00 /usr/sbin/apache2 -k start
- person Ahmed Hashim   schedule 08.03.2017sudo chown www-data:www-data /var/lib/openstack-dashboard/secret_key
- person Ahmed Hashim   schedule 08.03.2017