changeset 1606:16325d2ab2dd deploy

Install static site conf file too
author Chris Cannam
date Fri, 25 Aug 2017 15:20:53 +0100
parents 18643ab36008
children 1c904260787b
files deploy/config/soundsoftware-static.conf deploy/provision.d/100-apache-config.sh deploy/provision.d/190-reminders.sh
diffstat 3 files changed, 67 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deploy/config/soundsoftware-static.conf	Fri Aug 25 15:20:53 2017 +0100
@@ -0,0 +1,56 @@
+<VirtualHost *:80>
+        ServerName soundsoftware.ac.uk
+	ServerAlias www.soundsoftware.ac.uk
+        ServerAdmin chris.cannam@eecs.qmul.ac.uk
+
+        DocumentRoot /var/www/soundsoftware-static/soundsoftware.ac.uk
+
+	ErrorLog /var/log/apache2/soundsoftware-error.log
+	CustomLog /var/log/apache2/soundsoftware-access.log vhost_combined
+
+	<Directory /var/www/soundsoftware-static/soundsoftware.ac.uk>
+		RewriteEngine on
+		RewriteCond %{REQUEST_FILENAME} !-d
+		RewriteCond %{REQUEST_FILENAME}\.html -f
+		RewriteRule ^(.*)$ $1.html
+	</Directory>
+
+	<FilesMatch "^.*\.(install|inc)$">
+	     Order Deny,Allow
+	     deny from all
+	</FilesMatch>
+
+        <DirectoryMatch "\.(hg|svn|git)">
+                Order allow,deny
+                Deny from all
+                Satisfy All
+        </DirectoryMatch>
+
+	LogLevel warn
+	ServerSignature Off
+</VirtualHost>
+		
+<VirtualHost *:443>
+	# We don't serve SSL: redirect to the code site
+	ServerName soundsoftware.ac.uk
+        ServerAlias www.soundsoftware.ac.uk
+        ServerAdmin chris.cannam@eecs.qmul.ac.uk
+
+	SSLEngine on
+	SSLCertificateFile /etc/apache2/certs/code.soundsoftware.ac.uk.crt
+	SSLCertificateKeyFile /etc/apache2/certs/code.soundsoftware.ac.uk.key
+	SSLCertificateChainFile /etc/apache2/certs/code.soundsoftware.ac.uk.ca-bundle
+	SSLVerifyClient none
+	SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW	
+
+        DocumentRoot /var/www/soundsoftware-static/soundsoftware.ac.uk
+
+	Redirect permanent / https://code.soundsoftware.ac.uk/
+
+        ErrorLog /var/log/apache2/code-error.log
+        CustomLog /var/log/apache2/code-access.log vhost_combined
+
+        LogLevel warn
+        ServerSignature Off
+</VirtualHost>
+
--- a/deploy/provision.d/100-apache-config.sh	Thu Aug 24 15:56:50 2017 +0100
+++ b/deploy/provision.d/100-apache-config.sh	Fri Aug 25 15:20:53 2017 +0100
@@ -8,6 +8,7 @@
 
 codeconf=/var/www/code/deploy/config/code.conf.gen
 codeconfssl=/var/www/code/deploy/config/code-ssl.conf.gen
+staticconf=/var/www/code/deploy/config/soundsoftware-static.conf
 
 if [ ! -f "$codeconf" ]; then
     echo "ERROR: Apache config file $codeconf not found - has the database secret been interpolated from its input file correctly?"
@@ -32,6 +33,7 @@
 
     cp "$codeconf" /etc/apache2/sites-available/code.conf
     cp "$codeconfssl" /etc/apache2/sites-available/code-ssl.conf
+    cp "$staticconf" /etc/apache2/sites-available/soundsoftware-static.conf
     ln -s ../sites-available/code.conf /etc/apache2/sites-enabled/10-code.conf
 
     apache2ctl configtest
--- a/deploy/provision.d/190-reminders.sh	Thu Aug 24 15:56:50 2017 +0100
+++ b/deploy/provision.d/190-reminders.sh	Fri Aug 25 15:20:53 2017 +0100
@@ -10,8 +10,15 @@
 *** APACHE SSL CONFIGURATION
 
     The provisioning scripts set up a simple HTTP site only. Refer to
-    deploy/config/code-ssl.conf.in for an example HTTPS configuration
-    (you will of course need to provide the key/cert files).
+    code-ssl.conf for an example HTTPS configuration (you will of
+    course need to provide the key/cert files).
+
+*** SMOKE TEST
+
+    There is a smoke test script in the deploy/test directory. That
+    is, a quick automated acceptance test that checks that basic
+    services are returning successful HTTP codes. Consider running it
+    against this server from another host, i.e. not just localhost.
 
 *** EMAIL