@@ -122,8 +122,14 @@ if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
122122fi
123123
124124# complete URIs
125- KEYSTONE_AUTH_URI=${KEYSTONE_AUTH_PROTOCOL} ://${KEYSTONE_AUTH_HOST} :${KEYSTONE_AUTH_PORT}
126- KEYSTONE_SERVICE_URI=${KEYSTONE_SERVICE_PROTOCOL} ://${KEYSTONE_SERVICE_HOST} :${KEYSTONE_SERVICE_PORT}
125+ if [ " $KEYSTONE_DEPLOY " == " mod_wsgi" ]; then
126+ # If running in Apache, use path access rather than port.
127+ KEYSTONE_AUTH_URI=${KEYSTONE_AUTH_PROTOCOL} ://${KEYSTONE_AUTH_HOST} /identity_v2_admin
128+ KEYSTONE_SERVICE_URI=${KEYSTONE_SERVICE_PROTOCOL} ://${KEYSTONE_SERVICE_HOST} /identity
129+ else
130+ KEYSTONE_AUTH_URI=${KEYSTONE_AUTH_PROTOCOL} ://${KEYSTONE_AUTH_HOST} :${KEYSTONE_AUTH_PORT}
131+ KEYSTONE_SERVICE_URI=${KEYSTONE_SERVICE_PROTOCOL} ://${KEYSTONE_SERVICE_HOST} :${KEYSTONE_SERVICE_PORT}
132+ fi
127133
128134# V3 URIs
129135KEYSTONE_AUTH_URI_V3=$KEYSTONE_AUTH_URI /v3
@@ -259,7 +265,15 @@ function configure_keystone {
259265 # Set the service ports for a proxy to take the originals
260266 service_port=$KEYSTONE_SERVICE_PORT_INT
261267 auth_port=$KEYSTONE_AUTH_PORT_INT
268+ fi
262269
270+ # Override the endpoints advertised by keystone (the public_endpoint and
271+ # admin_endpoint) so that clients use the correct endpoint. By default, the
272+ # keystone server uses the public_port and admin_port which isn't going to
273+ # work when you want to use a different port (in the case of proxy), or you
274+ # don't want the port (in the case of putting keystone on a path in
275+ # apache).
276+ if is_service_enabled tls-proxy || [ " $KEYSTONE_DEPLOY " == " mod_wsgi" ]; then
263277 iniset $KEYSTONE_CONF DEFAULT public_endpoint $KEYSTONE_SERVICE_URI
264278 iniset $KEYSTONE_CONF DEFAULT admin_endpoint $KEYSTONE_AUTH_URI
265279 fi
@@ -582,7 +596,14 @@ function start_keystone {
582596 # Check that the keystone service is running. Even if the tls tunnel
583597 # should be enabled, make sure the internal port is checked using
584598 # unencryted traffic at this point.
585- if ! wait_for_service $SERVICE_TIMEOUT $auth_protocol ://$KEYSTONE_SERVICE_HOST :$service_port /v$IDENTITY_API_VERSION /; then
599+ # If running in Apache, use the path rather than port.
600+
601+ local service_uri=$auth_protocol ://$KEYSTONE_SERVICE_HOST :$service_port /v$IDENTITY_API_VERSION /
602+ if [ " $KEYSTONE_DEPLOY " == " mod_wsgi" ]; then
603+ service_uri=$auth_protocol ://$KEYSTONE_SERVICE_HOST /identity/v$IDENTITY_API_VERSION /
604+ fi
605+
606+ if ! wait_for_service $SERVICE_TIMEOUT $service_uri ; then
586607 die $LINENO " keystone did not start"
587608 fi
588609
@@ -625,8 +646,8 @@ function bootstrap_keystone {
625646 --bootstrap-service-name keystone \
626647 --bootstrap-region-id " $REGION_NAME " \
627648 --bootstrap-admin-url " $KEYSTONE_AUTH_URI " \
628- --bootstrap-public-url " $KEYSTONE_SERVICE_PROTOCOL :// $KEYSTONE_SERVICE_HOST : $KEYSTONE_SERVICE_PORT " \
629- --bootstrap-internal-url " $KEYSTONE_SERVICE_PROTOCOL :// $KEYSTONE_SERVICE_HOST : $KEYSTONE_SERVICE_PORT "
649+ --bootstrap-public-url " $KEYSTONE_SERVICE_URI " \
650+ --bootstrap-internal-url " $KEYSTONE_SERVICE_URI "
630651}
631652
632653# Restore xtrace
0 commit comments