Exception occurred processing WSGI script '/var/www/cgi-bin/keystone/admin'

记录搭建openstack的一些小错误

log信息:
2017-05-05 08:34:59.613301 mod_wsgi (pid=2384, process=’keystone-admin’, application=”): Loading WSGI script ‘/var/www/cgi-bin/keystone/admin’.
2017-05-05 08:34:59.613489 mod_wsgi (pid=2384, process=’keystone-admin’, application=”): Failed to parse WSGI script file ‘/var/www/cgi-bin/keystone/admin’.
2017-05-05 08:34:59.613532 mod_wsgi (pid=2384): Exception occurred processing WSGI script ‘/var/www/cgi-bin/keystone/admin’.
2017-05-05 08:34:59.613725 File “/var/www/cgi-bin/keystone/admin”, line 1
2017-05-05 08:34:59.613741
2017-05-05 08:34:59.613748 ^
2017-05-05 08:34:59.613754 SyntaxError: invalid syntax
2017-05-05 08:35:18.308640 mod_wsgi (pid=2386): Shutdown requested ‘keystone-admin’.
2017-05-05 08:35:18.308855 mod_wsgi (pid=2386): Stopping process ‘keystone-admin’.
2017-05-05 08:35:18.308875 mod_wsgi (pid=2386): Destroying interpreters.
2017-05-05 08:35:18.308891 mod_wsgi (pid=2386): Cleanup interpreter ”.
2017-05-05 08:35:18.312201 mod_wsgi (pid=2385): Shutdown requested ‘keystone-admin’.
2017-05-05 08:35:18.312322 mod_wsgi (pid=2385): Stopping process ‘keystone-admin’.
2017-05-05 08:35:18.312337 mod_wsgi (pid=2385): Destroying interpreters.

解决办法:

curl http://git.openstack.org/cgit/openstack/keystone/plain/httpd/keystone.py?h=stable/kilo | tee /var/www/cgi-bin/keystone/main /var/www/cgi-bin/keystone/admin

// 由于该网页不再提供支持所以无法下载到该文件了
// 大家可以访问以下
Exception occurred processing WSGI script '/var/www/cgi-bin/keystone/admin'_第1张图片

解决办法:

(一)
cd /usr/share/keystone/

cp keystone.wsgi /var/www/cgi-bin/keystone/admin
cp keystone.wsgi /var/www/cgi-bin/keystone/main

(二)
或者在 /var/www/cgi-bin/keystone/文件夹下新建admin和main文件
写下这个内容

# Copyright 2013 OpenStack Foundation
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import os

from keystone.server import wsgi as wsgi_server


name = os.path.basename(__file__)

# NOTE(ldbragst): 'application' is required in this context by WSGI spec.
# The following is a reference to Python Paste Deploy documentation
# http://pythonpaste.org/deploy/
application = wsgi_server.initialize_application(name)

最后

配置权限
chown -R keystone:keystone /var/www/cgi-bin/keystone
chmod 755 /var/www/cgi-bin/keystone/*

你可能感兴趣的:(openstack)