Python使用OpenStack Keystone port 5000

我正在关注官方的OpenStack文档来构build我的第一个环境,并被困在configurationKeystone( http://docs.openstack.org/kilo/install-guide/install/apt/content/keystone-install.html的最后一步)

当试图重新启动Apache时,我得到有关端口5000正在使用的错误消息

* Restarting web server apache2 (98)Address already in use: AH00072: make_sock: could not bind to address [::]:5000 (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:5000 no listening sockets available, shutting down AH00015: Unable to open logs Action 'start' failed. The Apache error log may have more information. 

Netstat说该端口被Python使用,进一步的调查显示它与Keystone有某种关系

 /usr/bin/python /usr/bin/keystone-all --config-file=/etc/keystone/keystone.conf --log-file=/var/log/keystone/keystone.log 

在这种情况下我应该采取哪种方式? 重新configurationApache以使用不同的端口,或尝试处理Python使用不同的端口?

编辑

参考https://ask.openstack.org/en/question/47137/devstack-fails-to-start-apache2-address-already-in-use-could-not-bind-to-address/我修改了/etc/apache2/sites-available/wsgi-keystone.conf<VirtualHost *:5000><VirtualHost *:80> ,但错误仍然存​​在。 现在的消息是

  * Restarting web server apache2 (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 (98)Address already in use: AH00072: make_sock: could not bind to address [::]:35357 (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:35357 no listening sockets available, shutting down AH00015: Unable to open logs Action 'start' failed. The Apache error log may have more information. 

Apache错误日志显然是空的,所以我不能去那里find有用的东西。

您看到的错误是因为Keystone正在使用不推荐使用的Eventlet,因此它正在侦听端口5000 。 为了使其与Apache协同工作,您必须先停止并禁用Keystone服务。 Keystone不会作为服务来执行,因为它将在Apache中使用mod_wsgi作为WSGI应用程序执行。

所以,为了让事情起作用,请回滚您的configuration,以便再次使用<VirtualHost *:5000> 。 然后,停止并禁用keystone服务并重新启动Apache:

 service keystone stop update-rc.d keystone disable service apache2 restart