Browse code

Merge "Allow configuration of Apache user and group"

Jenkins authored on 2012/01/26 05:45:38
Showing 2 changed files
... ...
@@ -1,8 +1,8 @@
1 1
 <VirtualHost *:80>
2 2
     WSGIScriptAlias / %HORIZON_DIR%/openstack-dashboard/dashboard/wsgi/django.wsgi
3
-    WSGIDaemonProcess horizon user=%USER% group=%USER% processes=3 threads=10
3
+    WSGIDaemonProcess horizon user=%USER% group=%GROUP% processes=3 threads=10
4 4
     SetEnv APACHE_RUN_USER %USER%
5
-    SetEnv APACHE_RUN_GROUP %USER%
5
+    SetEnv APACHE_RUN_GROUP %GROUP%
6 6
     WSGIProcessGroup horizon
7 7
 
8 8
     DocumentRoot %HORIZON_DIR%/.blackhole/
... ...
@@ -410,6 +410,14 @@ KEYSTONE_SERVICE_HOST=${KEYSTONE_SERVICE_HOST:-$SERVICE_HOST}
410 410
 KEYSTONE_SERVICE_PORT=${KEYSTONE_SERVICE_PORT:-5000}
411 411
 KEYSTONE_SERVICE_PROTOCOL=${KEYSTONE_SERVICE_PROTOCOL:-http}
412 412
 
413
+# Horizon
414
+# -------
415
+
416
+# Allow overriding the default Apache user and group, default both to
417
+# current user.
418
+APACHE_USER=${APACHE_USER:-$USER}
419
+APACHE_GROUP=${APACHE_GROUP:-$APACHE_USER}
420
+
413 421
 # Log files
414 422
 # ---------
415 423
 
... ...
@@ -762,8 +770,11 @@ if [[ "$ENABLED_SERVICES" =~ "horizon" ]]; then
762 762
 
763 763
     ## Configure apache's 000-default to run horizon
764 764
     sudo cp $FILES/000-default.template /etc/apache2/sites-enabled/000-default
765
-    sudo sed -e "s,%USER%,$USER,g" -i /etc/apache2/sites-enabled/000-default
766
-    sudo sed -e "s,%HORIZON_DIR%,$HORIZON_DIR,g" -i /etc/apache2/sites-enabled/000-default
765
+    sudo sed -e "
766
+        s,%USER%,$APACHE_USER,g;
767
+        s,%GROUP%,$APACHE_GROUP,g;
768
+        s,%HORIZON_DIR%,$HORIZON_DIR,g;
769
+    " -i /etc/apache2/sites-enabled/000-default
767 770
     sudo service apache2 restart
768 771
 fi
769 772