From 70a620846483c3f65500dbfe26aef7f3dc1ce50c Mon Sep 17 00:00:00 2001 From: Sylvain Bauza Date: Tue, 20 Dec 2016 15:34:29 +0100 Subject: [PATCH] Placement service only using default HTTPd ports The placement API configuration was binding a specific port *and* was supporting to be called by the default HTTPd ports using a Location directive. Given that the corresponding service catalog entry for the placement service type doesn't mention the specific application port but is rather using the default port 80, we can remove that specific port and just use the default config. Note that we still need to use a VirtualHost directive for the specific placement config because ErrorLog is only scoped for either server or virtualhost but can't be set for a Location (or a Directory) context. Change-Id: I9a26dcff4b879cf9e82e43a3d1aca2e4fe6aa3e6 --- files/apache-placement-api.template | 8 +++++--- lib/placement | 7 ------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/files/apache-placement-api.template b/files/apache-placement-api.template index b89ef96776..011abb95fc 100644 --- a/files/apache-placement-api.template +++ b/files/apache-placement-api.template @@ -1,6 +1,8 @@ -Listen %PUBLICPORT% - - +# NOTE(sbauza): This virtualhost is only here because some directives can +# only be set by a virtualhost or server context, so that's why the port is not bound. +# TODO(sbauza): Find a better way to identify a free port that is not corresponding to an existing +# vhost. + WSGIDaemonProcess placement-api processes=%APIWORKERS% threads=1 user=%USER% display-name=%{GROUP} %VIRTUALENV% WSGIProcessGroup placement-api WSGIScriptAlias / %PUBLICWSGI% diff --git a/lib/placement b/lib/placement index ff630e29d8..93b72eb5e0 100644 --- a/lib/placement +++ b/lib/placement @@ -47,7 +47,6 @@ fi # Public facing bits PLACEMENT_SERVICE_PROTOCOL=${PLACEMENT_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} PLACEMENT_SERVICE_HOST=${PLACEMENT_SERVICE_HOST:-$SERVICE_HOST} -PLACEMENT_SERVICE_PORT=${PLACEMENT_SERVICE_PORT:-8778} # Functions # --------- @@ -68,7 +67,6 @@ function cleanup_placement { # _config_placement_apache_wsgi() - Set WSGI config files function _config_placement_apache_wsgi { local placement_api_apache_conf - local placement_api_port=$PLACEMENT_SERVICE_PORT local venv_path="" local nova_bin_dir="" nova_bin_dir=$(get_python_exec_prefix) @@ -89,7 +87,6 @@ function _config_placement_apache_wsgi { sudo cp $FILES/apache-placement-api.template $placement_api_apache_conf sudo sed -e " - s|%PUBLICPORT%|$placement_api_port|g; s|%APACHE_NAME%|$APACHE_NAME|g; s|%PUBLICWSGI%|$nova_bin_dir/nova-placement-api|g; s|%SSLENGINE%|$placement_ssl|g; @@ -161,10 +158,6 @@ function install_placement { # start_placement_api() - Start the API processes ahead of other things function start_placement_api { - # Get right service port for testing - local service_port=$PLACEMENT_SERVICE_PORT - local placement_api_port=$PLACEMENT_SERVICE_PORT - enable_apache_site placement-api restart_apache_server tail_log placement-api /var/log/$APACHE_NAME/placement-api.log