we should ask for permission to do that using debconf).
* Now writing css and js script in /var, plus we aren't doing chown www-data
of all the static, but only css + js in /var.
+ * Now asking using debconf if we should disable the default apache vhost,
+ and activate the Dasboard, and if we should use SSL or not.
-- Mehdi Abaakouk <sileht@sileht.net> Sat, 29 Sep 2012 09:38:19 +0200
--- /dev/null
+<VirtualHost *:443>
+ ServerAdmin webmaster@localhost
+ SSLEngine on
+ SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
+ SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
+ BrowserMatch "MSIE [2-6]" \
+ nokeepalive ssl-unclean-shutdown \
+ downgrade-1.0 force-response-1.0
+ BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
+
+ WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
+ WSGIDaemonProcess horizon user=www-data group=www-data
+ #WSGIProcessGroup openstack-dashboard
+ Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static
+
+ DocumentRoot /var/www
+
+ <Directory />
+ AllowOverride None
+ </Directory>
+
+ <Directory /usr/share/openstack-dashboard/openstack_dashboard/wsgi/>
+ Order allow,deny
+ Allow from all
+ </Directory>
+
+ <Directory /usr/share/pyshared/horizon/static/horizon>
+ Order allow,deny
+ Allow from all
+ </Directory>
+
+ <Directory /usr/share/openstack-dashboard/openstack_dashboard/static/>
+ Order allow,deny
+ Allow from all
+ </Directory>
+
+ ErrorLog ${APACHE_LOG_DIR}/error.log
+ LogLevel warn
+ CustomLog ${APACHE_LOG_DIR}/access.log combined
+</VirtualHost>
--- /dev/null
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+db_input high horizon/activate_vhost || true
+db_go || true
+
+db_get horizon/activate_vhost
+if [ "${RET}" = "true" ] ; then
+ db_input high horizon/use_ssl || true
+ db_go || true
+fi
+
+exit 0
set -e
if [ "$1" = "configure" ] ; then
- if [ -x /etc/init.d/apache2 ]; then
+ . /usr/share/debconf/confmodule
+ db_get horizon/activate_vhost
+ if [ "${RET}" = "true" ] && [ -x /etc/init.d/apache2 ] ; then
a2dissite default
- a2ensite openstack-dashboard
+ db_get horizon/use_ssl
+ if [ "${RET}" = "true" ] ; then
+ a2enmod ssl
+ a2ensite openstack-dashboard-ssl
+ a2dissite openstack-dashboard
+ else
+ a2ensite openstack-dashboard
+ a2dissite openstack-dashboard-ssl
+ fi
invoke-rc.d --quiet apache2 reload
fi
fi
--- /dev/null
+# These templates have been reviewed by the debian-l10n-english
+# team
+#
+# If modifications/additions/rewording are needed, please ask
+# debian-l10n-english@lists.debian.org for advice.
+#
+# Even minor modifications require translation updates and such
+# changes should be coordinated with translators and reviewers.
+
+Template: horizon/activate_vhost
+Type: boolean
+Default: false
+_Description: Activate Dashboard and disable default VirtualHost?
+ In Debian, Apache comes with a default website and a default page, configured
+ in /etc/apache2/sites-available/default. Should this configuration be disabled
+ and shall the Openstack Dashboard replace it?
+
+Template: horizon/use_ssl
+Type: boolean
+Default: true
+_Description: Should the Dashboard be installed on HTTPS?
--- /dev/null
+[type: gettext/rfc822deb] openstack-dashboard-apache.templates
--- /dev/null
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: horizon\n"
+"Report-Msgid-Bugs-To: horizon@packages.debian.org\n"
+"POT-Creation-Date: 2012-11-01 07:34+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../openstack-dashboard-apache.templates:2001
+msgid "Activate Dashboard and disable default VirtualHost?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../openstack-dashboard-apache.templates:2001
+msgid ""
+"In Debian, Apache comes with a default website and a default page, "
+"configured in /etc/apache2/sites-available/default. Should this "
+"configuration be disabled and shall the Openstack Dashboard replace it?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../openstack-dashboard-apache.templates:3001
+msgid "Should the Dashboard be installed on HTTPS?"
+msgstr ""
# openstack-dashboard-apache
install -D -m 0644 $(CURDIR)/debian/openstack-dashboard-apache.conf $(CURDIR)/debian/tmp/etc/apache2/sites-available/openstack-dashboard
+ install -D -m 0644 $(CURDIR)/debian/openstack-dashboard-apache-ssl.conf $(CURDIR)/debian/tmp/etc/apache2/sites-available/openstack-dashboard-ssl
override_dh_install:
dh_install