Allow configuration of Apache user and group

* Fixes bug 915064
* APACHE_USER defaults to $USER
* APACHE_GROUP defaults to $APACHE_USER

Change-Id: I06cf39cfd884d8f858ab98b84b3f40c3f6ff3a40
This commit is contained in:
Dean Troyer 2012-01-24 11:45:52 -06:00
parent 965716e168
commit 9bb84f0a70
2 changed files with 15 additions and 4 deletions

View File

@ -1,8 +1,8 @@
<VirtualHost *:80> <VirtualHost *:80>
WSGIScriptAlias / %HORIZON_DIR%/openstack-dashboard/dashboard/wsgi/django.wsgi WSGIScriptAlias / %HORIZON_DIR%/openstack-dashboard/dashboard/wsgi/django.wsgi
WSGIDaemonProcess horizon user=%USER% group=%USER% processes=3 threads=10 WSGIDaemonProcess horizon user=%USER% group=%GROUP% processes=3 threads=10
SetEnv APACHE_RUN_USER %USER% SetEnv APACHE_RUN_USER %USER%
SetEnv APACHE_RUN_GROUP %USER% SetEnv APACHE_RUN_GROUP %GROUP%
WSGIProcessGroup horizon WSGIProcessGroup horizon
DocumentRoot %HORIZON_DIR%/.blackhole/ DocumentRoot %HORIZON_DIR%/.blackhole/

View File

@ -410,6 +410,14 @@ KEYSTONE_SERVICE_HOST=${KEYSTONE_SERVICE_HOST:-$SERVICE_HOST}
KEYSTONE_SERVICE_PORT=${KEYSTONE_SERVICE_PORT:-5000} KEYSTONE_SERVICE_PORT=${KEYSTONE_SERVICE_PORT:-5000}
KEYSTONE_SERVICE_PROTOCOL=${KEYSTONE_SERVICE_PROTOCOL:-http} KEYSTONE_SERVICE_PROTOCOL=${KEYSTONE_SERVICE_PROTOCOL:-http}
# Horizon
# -------
# Allow overriding the default Apache user and group, default both to
# current user.
APACHE_USER=${APACHE_USER:-$USER}
APACHE_GROUP=${APACHE_GROUP:-$APACHE_USER}
# Log files # Log files
# --------- # ---------
@ -762,8 +770,11 @@ if [[ "$ENABLED_SERVICES" =~ "horizon" ]]; then
## Configure apache's 000-default to run horizon ## Configure apache's 000-default to run horizon
sudo cp $FILES/000-default.template /etc/apache2/sites-enabled/000-default sudo cp $FILES/000-default.template /etc/apache2/sites-enabled/000-default
sudo sed -e "s,%USER%,$USER,g" -i /etc/apache2/sites-enabled/000-default sudo sed -e "
sudo sed -e "s,%HORIZON_DIR%,$HORIZON_DIR,g" -i /etc/apache2/sites-enabled/000-default s,%USER%,$APACHE_USER,g;
s,%GROUP%,$APACHE_GROUP,g;
s,%HORIZON_DIR%,$HORIZON_DIR,g;
" -i /etc/apache2/sites-enabled/000-default
sudo service apache2 restart sudo service apache2 restart
fi fi