Merge "Allow configuration of Apache user and group"
diff --git a/files/000-default.template b/files/000-default.template
index 1d7380d..d97f365 100644
--- a/files/000-default.template
+++ b/files/000-default.template
@@ -1,8 +1,8 @@
<VirtualHost *:80>
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_GROUP %USER%
+ SetEnv APACHE_RUN_GROUP %GROUP%
WSGIProcessGroup horizon
DocumentRoot %HORIZON_DIR%/.blackhole/
diff --git a/stack.sh b/stack.sh
index d6a7869..f2ca9d5 100755
--- a/stack.sh
+++ b/stack.sh
@@ -410,6 +410,14 @@
KEYSTONE_SERVICE_PORT=${KEYSTONE_SERVICE_PORT:-5000}
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
# ---------
@@ -762,8 +770,11 @@
## Configure apache's 000-default to run horizon
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 "s,%HORIZON_DIR%,$HORIZON_DIR,g" -i /etc/apache2/sites-enabled/000-default
+ sudo sed -e "
+ 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
fi