From 8b564a8fb9af120116cc3f7188bd5efa9cc0bd39 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Sun, 11 Sep 2011 17:53:34 -0700 Subject: [PATCH] move apache config to a template --- build.sh | 4 ++-- files/000-default.template | 25 +++++++++++++++++++++++++ stack.sh | 31 +++++-------------------------- 3 files changed, 32 insertions(+), 28 deletions(-) create mode 100644 files/000-default.template diff --git a/build.sh b/build.sh index b487287..1523ece 100755 --- a/build.sh +++ b/build.sh @@ -34,8 +34,8 @@ echo "127.0.0.1 localhost $NAME" > $DEST/etc/hosts # copy kernel modules cp -pr /lib/modules/`uname -r` $DEST/lib/modules -# helpful screenrc -cp files/screenrc $DEST/root/.screenrc +# inject stack.sh files +cp -r files $DEST/opt/files # copy openstack installer and requirement lists to a new directory. mkdir -p $DEST/opt diff --git a/files/000-default.template b/files/000-default.template new file mode 100644 index 0000000..64251f0 --- /dev/null +++ b/files/000-default.template @@ -0,0 +1,25 @@ + + WSGIScriptAlias / %DASH_DIR%/openstack-dashboard/dashboard/wsgi/django.wsgi + WSGIDaemonProcess dashboard user=www-data group=www-data processes=3 threads=10 + WSGIProcessGroup dashboard + + DocumentRoot %DASH_DIR%/.blackhole/ + Alias /media %DASH_DIR%/openstack-dashboard/media + + + Options FollowSymLinks + AllowOverride None + + + + Options Indexes FollowSymLinks MultiViews + AllowOverride None + Order allow,deny + allow from all + + + ErrorLog /var/log/apache2/error.log + LogLevel warn + CustomLog /var/log/apache2/access.log combined + + diff --git a/stack.sh b/stack.sh index 78d9b4d..8ef39fe 100755 --- a/stack.sh +++ b/stack.sh @@ -97,32 +97,8 @@ if [ "$CMD" == "install" ]; then # setup apache mkdir $DASH_DIR/.blackhole - cat > /etc/apache2/sites-enabled/000-default < - WSGIScriptAlias / $DASH_DIR/openstack-dashboard/dashboard/wsgi/django.wsgi - WSGIDaemonProcess dashboard user=www-data group=www-data processes=3 threads=10 - WSGIProcessGroup dashboard - - DocumentRoot $DASH_DIR/.blackhole/ - Alias /media $DASH_DIR/openstack-dashboard/media - - - Options FollowSymLinks - AllowOverride None - - - - Options Indexes FollowSymLinks MultiViews - AllowOverride None - Order allow,deny - allow from all - - - ErrorLog /var/log/apache2/error.log - LogLevel warn - CustomLog /var/log/apache2/access.log combined - -EOF + # FIXME(ja): can't figure out how to make $DASH_DIR work in sed, also install to available/a2e it + cat $DIR/files/000-default.template | sed "s/%DASH_DIR%/\/opt\/dash/g" > /etc/apache2/sites-enabled/000-default chown -R www-data:www-data $DASH_DIR @@ -134,6 +110,9 @@ EOF mkdir -p $DEST/images tar -C $DEST/images -zxf $DEST/tty.tgz + + # add useful screenrc + cp $DIR/files/screenrc ~/.screenrc exit fi