问题描述
OpenStack Train 4.0.2
Horizon 16.2.2
部署完 Dashboard 仪表盘,登录后点击“身份管理”栏目下面的用户或者项目就会出现内部错误。
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@openstack.org to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
查看日志/var/log/httpd/openstack_dashboard-error.log
'keystone-public' cannot be accessed by this WSGI application:
[client 10.150.15.1:61058] Daemon process called 'keystone-public' cannot be accessed by this WSGI application: /usr/bin/keystone-wsgi-public, referer: http://10.10.111.10/project/
大概意思就是说无法访问你所点击的链接内容,要么权限不够,要么路径不对,这里是后者。
进入到 Dashboard 根目录/usr/share/openstack-dashboard/
,发现 identity 内容并不在根目录下,而是在 dashboard 目录。但是报内部错误的时候,浏览器里面的 URL 地址是http://10.10.111.10/identity/users/
,很显然需要在前面加个 dashboard 路径。
解决问题
设置根目录
cat << EOF >>/etc/openstack-dashboard/local_settings
WEBROOT = '/dashboard/'
EOF
修改 conf 配置
<VirtualHost *:80>
ServerAdmin webmaster@openstack.org
ServerName openstack_dashboard
DocumentRoot /usr/share/openstack-dashboard/
LogLevel warn
ErrorLog /var/log/httpd/openstack_dashboard-error.log
CustomLog /var/log/httpd/openstack_dashboard-access.log combined
WSGIScriptReloading On
WSGIDaemonProcess openstack_dashboard_website processes=9
WSGIProcessGroup openstack_dashboard_website
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
#WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi.py
WSGIScriptAlias /dashboard /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
Alias /dashboard/static /usr/share/openstack-dashboard/static
<Location "/">
Require all granted
</Location>
#Alias /static /usr/share/openstack-dashboard/static
<Location "/static">
SetHandler None
</Location>
</Virtualhost>
配置文件里注释掉了两条配置,同时新增了下面两条配置
WSGIScriptAlias /dashboard /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
Alias /dashboard/static /usr/share/openstack-dashboard/static
重启服务
systemctl restart httpd.service memcached.service
现在访问仪表盘的时候就需要加上 dashboard 后缀了,例如这里的 http://10.10.111.10/dashboard
评论区