From 5713f44762838a17488b8851db9093f0372fe568 Mon Sep 17 00:00:00 2001 From: Penny Leach Date: Fri, 29 Aug 2008 13:14:08 +0100 Subject: [PATCH] fixups for mahara profile and dnsmasq stuff --- profile/base/post-host | 7 +++---- profile/base/pre-vserver | 6 ++++-- profile/base/profile.conf | 2 +- profile/base/remove-host | 6 +++--- profile/mahara/data/vhost | 11 +++++++++++ profile/mahara/post-vserver | 7 +++++-- profile/mahara/templates | 1 + profile/moodle/data/vhost | 6 +++--- 8 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 profile/mahara/data/vhost create mode 100644 profile/mahara/templates diff --git a/profile/base/post-host b/profile/base/post-host index bef1217..0aa55f2 100644 --- a/profile/base/post-host +++ b/profile/base/post-host @@ -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 diff --git a/profile/base/pre-vserver b/profile/base/pre-vserver index aeea058..d2f20a9 100644 --- a/profile/base/pre-vserver +++ b/profile/base/pre-vserver @@ -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 diff --git a/profile/base/profile.conf b/profile/base/profile.conf index a371716..ca8457a 100644 --- a/profile/base/profile.conf +++ b/profile/base/profile.conf @@ -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 diff --git a/profile/base/remove-host b/profile/base/remove-host index 590c832..392665e 100644 --- a/profile/base/remove-host +++ b/profile/base/remove-host @@ -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 index 0000000..f5c9a69 --- /dev/null +++ b/profile/mahara/data/vhost @@ -0,0 +1,11 @@ + + 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 + + + diff --git a/profile/mahara/post-vserver b/profile/mahara/post-vserver index d71e5e0..5465ada 100644 --- a/profile/mahara/post-vserver +++ b/profile/mahara/post-vserver @@ -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 index 0000000..0b48e4c --- /dev/null +++ b/profile/mahara/templates @@ -0,0 +1 @@ +vhost /etc/apache2/sites-available/ diff --git a/profile/moodle/data/vhost b/profile/moodle/data/vhost index 46b1edd..0229842 100644 --- a/profile/moodle/data/vhost +++ b/profile/moodle/data/vhost @@ -1,9 +1,9 @@ - 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 -- 2.39.5