]> git.mjollnir.org Git - vserverctl.git/commitdiff
fixups for mahara profile and dnsmasq stuff
authorPenny Leach <penny@mjollnir.org>
Fri, 29 Aug 2008 12:14:08 +0000 (13:14 +0100)
committerPenny Leach <penny@mjollnir.org>
Fri, 29 Aug 2008 12:14:08 +0000 (13:14 +0100)
profile/base/post-host
profile/base/pre-vserver
profile/base/profile.conf
profile/base/remove-host
profile/mahara/data/vhost [new file with mode: 0644]
profile/mahara/post-vserver
profile/mahara/templates [new file with mode: 0644]
profile/moodle/data/vhost

index bef1217aac4c542d330784379d8afb84554485ca..0aa55f2e661fdb88f7e607cd51578042d87cd6e2 100644 (file)
@@ -1,7 +1,6 @@
-# Add a /etc/hosts entry on the HostOS
-cat /etc/hosts > /etc/hosts.new
-echo "${VSIPADDR}    ${VSNAME}.$(hostname -f) ${VSNAME}" >> /etc/hosts.new
-mv /etc/hosts.new /etc/hosts
+# Add a wildcard dns entry on the HostOS
+echo "address=/${VSNAME}.$(hostname)/${VSIPADDR}" >> /etc/dnsmasq-vservers.conf
+/etc/init.d/dnsmasq restart
 
 # Copy the user's password from the host
 grep -v "^${PROFILEOPTION_username}" ${VSROOT}/etc/shadow > /vserver/.shadow
index aeea0589a1077022a3462ae9798412ecf5937b8d..d2f20a901c2b8ec6ee547cb432fc6ba426d5f29e 100644 (file)
@@ -3,8 +3,10 @@ if [ "$VSRELEASE" = "sarge" ]; then
     pwconv
 fi
 cp /usr/share/zoneinfo/NZ /etc/localtime
-echo "${VSIPADDR}    ${VSNAME}" >> /etc/hosts
-echo 'locales    locales/locales_to_be_generated select en_NZ ISO-8859-1, en_NZ.UTF-8 UTF-8' | debconf-set-selections
+
+echo 'nameserver 10.0.0.1' > /etc/resolv.conf
+
+echo 'locales    locales/locales_to_be_generated select en_NZ ISO-8859-1, en_NZ.UTF-8 UTF-8, en_GB ISO-8859-1, en_GB.UTF-8 UTF-8, en_US ISO-8859-1, en_US.UTF-8 UTF-8' | debconf-set-selections
 
 
 echo 'debconf        debconf/priority select critical'                                           | debconf-set-selections
index a3717165e78f89c2273094dad21f9433a0335edb..ca8457a5f15a4e90959eae87130f5cf3adec2d40 100644 (file)
@@ -1,6 +1,6 @@
 parent               =
 release              = etch
-mirror               = http://debian.catalyst.net.nz/debian
+#mirror               = http://debian.catalyst.net.nz/debian
 inherit-aptsources   = yes
 inherit-packages     = yes
 inherit-pre-vserver  = yes
index 590c832a470464db43d2c6fa3ac7f83aaf18085d..392665e9d5ffb2a0f84a8fe836d5d1b27e66d2b9 100644 (file)
@@ -1,6 +1,6 @@
-# Remove /etc/hosts entry on the host OS
-grep -v "^${VSIPADDR}" /etc/hosts > /etc/hosts.new
-mv /etc/hosts.new /etc/hosts
+# Remove dns entry on the host OS
+grep -v "${VSIPADDR}" /etc/dnsmasq-vservers.conf > /etc/dnsmasq-vservers.conf.new
+mv /etc/dnsmasq-vservers.conf.new /etc/dnsmasq-vservers.conf
 
 # this isn't set because we don't pass options to remove
 # USR=$PROFILEOPTION_username
diff --git a/profile/mahara/data/vhost b/profile/mahara/data/vhost
new file mode 100644 (file)
index 0000000..f5c9a69
--- /dev/null
@@ -0,0 +1,11 @@
+<VirtualHost *>
+    ServerName __VSNAME__.__HOST__
+    ServerAlias *.__VSNAME__.__HOST__
+
+    VirtualDocumentRoot /var/www/moodle/%1/htdocs
+
+    ErrorLog /var/log/apache2/%1.mahara.error.log
+    CustomLog /var/log/apache2/%1.mahara.access.log combined
+
+
+</VirtualHost>
index d71e5e0a343ecebfcf80dd3f4865cab6e9e50e06..5465ada45aaa73de5b4b7f30c2b662b8e1b7785b 100644 (file)
@@ -1,2 +1,5 @@
-mkdir /var/lib/mahara
-chown www-data /var/lib/mahara
+rm /etc/apache2/sites-enabled/100-htdocs
+ln -s /etc/apache2/sites-available/vhost /etc/apache2/sites-enabled/100-vhost
+a2enmod vhost_alias
+mkdir /var/lib/moodle
+chown www-data /var/lib/moodle
diff --git a/profile/mahara/templates b/profile/mahara/templates
new file mode 100644 (file)
index 0000000..0b48e4c
--- /dev/null
@@ -0,0 +1 @@
+vhost     /etc/apache2/sites-available/
index 46b1edd695ca768af78b311c7d55efb171265be3..0229842062a704635bd97f98c05656f3a9f120ac 100644 (file)
@@ -1,9 +1,9 @@
 <VirtualHost *>
-    ServerName __VSNAME__.__HOST__.wgtn.cat-it.co.nz
-    ServerAlias *.__VSNAME__.__HOST__.wgtn.cat-it.co.nz
+    ServerName __VSNAME__.__HOST__
+    ServerAlias *.__VSNAME__.__HOST__
 
     VirtualDocumentRoot /var/www/moodle/%1
-    
+
     ErrorLog /var/log/apache2/%1.moodle.error.log
     CustomLog /var/log/apache2/%1.moodle.access.log combined