+++ /dev/null
-# Now install drupal
-curl http://__VSNAME__.__HOST__.wgtn.cat-it.co.nz/install.php?profile=vserver > /dev/null
-chmod 644 /home/$USER/htdocs/sites/default/settings.php
+++ /dev/null
-#!/bin/sh
-
-echo "This script creates a new drupal site. It assumes the site will be created"
-echo "as a new subdomain of $(hostname -d)"
-
-SITENAME=$1
-if [ -z $SITENAME ]; then
- echo -n "New site name? "
- read SITENAME
-
- if [ -z $SITENAME ]; then
- echo "No site name given, aborting"
- exit 1
- fi
-
- if grep "$SITENAME.$(hostname -d)" /etc/apache2/sites-enabled/drupal.conf > /dev/null; then
- echo "This site already exists in /etc/apache2/sites-enabled/drupal.conf, aborting"
- exit 1
- fi
-fi
-
-FULLSITENAME="$SITENAME.$(hostname -d)"
-
-# Enter a new virtualhost entry for the site
-echo "Creating new site $FULLSITENAME"
+++ /dev/null
-<VirtualHost *>
- ServerName __VSNAME__.__HOST__.wgtn.cat-it.co.nz
-
- DocumentRoot /home/__PROFILEOPTION_username__/htdocs
-
- <Directory /home/__PROFILEOPTION_username__/htdocs>
- RewriteEngine on
- RewriteBase /
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
-
- AllowOverride all
- </Directory>
-
-</VirtualHost>
+++ /dev/null
-* * * * * root curl --silent --compressed http://__VSNAME__.__HOST__.wgtn.cat-it.co.nz/cron.php
+++ /dev/null
---- includes/install.pgsql.inc 2006-12-28 02:02:34.000000000 +1300
-+++ includes/install.pgsql.inc 2007-03-29 17:44:23.000000000 +1200
-@@ -34,11 +34,12 @@
- $url['path'] = urldecode($url['path']);
-
- // Build pgsql connection string and allow for non-standard PostgreSQL port.
-- $conn_string = ' user='. $url['user'] .' dbname='. substr($url['path'], 1) .' password='. $url['pass'] . ' host=' . $url['host'];
-+ $conn_string = ' user='. $url['user'] .' dbname='. substr($url['path'], 1) . ' host=' . $url['host'];
-+ $conn_string .= isset($url['pass']) ? ' password=' . $url['pass'] : '';
- $conn_string .= isset($url['port']) ? ' port=' . $url['port'] : '';
-
- // Test connecting to the database.
-- $connection = @pg_connect($conn_string);
-+ $connection = pg_connect($conn_string);
- if (!$connection) {
- drupal_set_message(st('Failure to connect to your PostgreSQL database server. PostgreSQL reports the following message: %error.<ul><li>Are you sure you have the correct username and password?</li><li>Are you sure that you have typed the correct database hostname?</li><li>Are you sure that the database server is running?</li><li>Are you sure you typed the correct database name?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => 'Connection failed. See log file for failure reason')), 'error');
- return FALSE;
-
+++ /dev/null
-<?php
-// $Id: settings.php,v 1.39 2007/01/14 02:05:15 unconed Exp $
-
-/**
- * @file
- * Drupal site-specific configuration file.
- *
- * IMPORTANT NOTE:
- * This file may have been set to read-only by the Drupal installation
- * program. If you make changes to this file, be sure to protect it again
- * after making your modifications. Failure to remove write permissions
- * to this file is a security risk.
- *
- * The configuration file to be loaded is based upon the rules below.
- *
- * The configuration directory will be discovered by stripping the
- * website's hostname from left to right and pathname from right to
- * left. The first configuration file found will be used and any
- * others will be ignored. If no other configuration file is found
- * then the default configuration file at 'sites/default' will be used.
- *
- * For example, for a fictitious site installed at
- * http://www.drupal.org/mysite/test/, the 'settings.php'
- * is searched in the following directories:
- *
- * 1. sites/www.drupal.org.mysite.test
- * 2. sites/drupal.org.mysite.test
- * 3. sites/org.mysite.test
- *
- * 4. sites/www.drupal.org.mysite
- * 5. sites/drupal.org.mysite
- * 6. sites/org.mysite
- *
- * 7. sites/www.drupal.org
- * 8. sites/drupal.org
- * 9. sites/org
- *
- * 10. sites/default
- *
- * If you are installing on a non-standard port number, prefix the
- * hostname with that number. For example,
- * http://www.drupal.org:8080/mysite/test/ could be loaded from
- * sites/8080.www.drupal.org.mysite.test/.
- */
-
-/**
- * Database settings:
- *
- * Note that the $db_url variable gets parsed using PHP's built-in
- * URL parser (i.e. using the "parse_url()" function) so make sure
- * not to confuse the parser. If your username, password
- * or database name contain characters used to delineate
- * $db_url parts, you can escape them via URI hex encodings:
- *
- * : = %3a / = %2f @ = %40
- * + = %2b ( = %28 ) = %29
- * ? = %3f = = %3d & = %26
- *
- * To specify multiple connections to be used in your site (i.e. for
- * complex custom modules) you can also specify an associative array
- * of $db_url variables with the 'default' element used until otherwise
- * requested.
- *
- * You can optionally set prefixes for some or all database table names
- * by using the $db_prefix setting. If a prefix is specified, the table
- * name will be prepended with its value. Be sure to use valid database
- * characters only, usually alphanumeric and underscore. If no prefixes
- * are desired, leave it as an empty string ''.
- *
- * To have all database names prefixed, set $db_prefix as a string:
- *
- * $db_prefix = 'main_';
- *
- * To provide prefixes for specific tables, set $db_prefix as an array.
- * The array's keys are the table names and the values are the prefixes.
- * The 'default' element holds the prefix for any tables not specified
- * elsewhere in the array. Example:
- *
- * $db_prefix = array(
- * 'default' => 'main_',
- * 'users' => 'shared_',
- * 'sessions' => 'shared_',
- * 'role' => 'shared_',
- * 'authmap' => 'shared_',
- * 'sequences' => 'shared_',
- * );
- *
- * Database URL format:
- * $db_url = 'mysql://username:password@localhost/databasename';
- * $db_url = 'mysqli://username:password@localhost/databasename';
- * $db_url = 'pgsql://username:password@localhost/databasename';
- */
-$db_url = 'pgsql://general@pg81/__VSNAME__';
-$db_prefix = '';
-
-/**
- * Base URL (optional).
- *
- * If you are experiencing issues with different site domains,
- * uncomment the Base URL statement below (remove the leading hash sign)
- * and fill in the URL to your Drupal installation.
- *
- * You might also want to force users to use a given domain.
- * See the .htaccess file for more information.
- *
- * Examples:
- * $base_url = 'http://www.example.com';
- * $base_url = 'http://www.example.com:8888';
- * $base_url = 'http://www.example.com/drupal';
- * $base_url = 'https://www.example.com:8888/drupal';
- *
- * It is not allowed to have a trailing slash; Drupal will add it
- * for you.
- */
-# $base_url = 'http://www.example.com'; // NO trailing slash!
-
-/**
- * PHP settings:
- *
- * To see what PHP settings are possible, including whether they can
- * be set at runtime (ie., when ini_set() occurs), read the PHP
- * documentation at http://www.php.net/manual/en/ini.php#ini.list
- * and take a look at the .htaccess file to see which non-runtime
- * settings are used there. Settings defined here should not be
- * duplicated there so as to avoid conflict issues.
- */
-ini_set('arg_separator.output', '&');
-ini_set('magic_quotes_runtime', 0);
-ini_set('magic_quotes_sybase', 0);
-ini_set('session.cache_expire', 200000);
-ini_set('session.cache_limiter', 'none');
-ini_set('session.cookie_lifetime', 2000000);
-ini_set('session.gc_maxlifetime', 200000);
-ini_set('session.save_handler', 'user');
-ini_set('session.use_only_cookies', 1);
-ini_set('session.use_trans_sid', 0);
-ini_set('url_rewriter.tags', '');
-
-/**
- * We try to set the correct cookie domain. If you are experiencing problems
- * try commenting out the code below or specifying the cookie domain by hand.
- */
-if (isset($_SERVER['HTTP_HOST'])) {
- $domain = '.'. preg_replace('`^www.`', '', $_SERVER['HTTP_HOST']);
- // Per RFC 2109, cookie domains must contain at least one dot other than the
- // first. For hosts such as 'localhost', we don't set a cookie domain.
- if (count(explode('.', $domain)) > 2) {
- ini_set('session.cookie_domain', $domain);
- }
-}
-
-/**
- * Variable overrides:
- *
- * To override specific entries in the 'variable' table for this site,
- * set them here. You usually don't need to use this feature. This is
- * useful in a configuration file for a vhost or directory, rather than
- * the default settings.php. Any configuration setting from the 'variable'
- * table can be given a new value.
- *
- * Remove the leading hash signs to enable.
- */
-# $conf = array(
-# 'site_name' => 'My Drupal site',
-# 'theme_default' => 'minnelli',
-# 'anonymous' => 'Visitor',
-# );
-
+++ /dev/null
-<?php
-
-function vserver_profile_modules() {
- return array(
- // Enable required core modules first.
- 'block', 'filter', 'node', 'system', 'user', 'watchdog',
-
- // Enable optional core modules next.
- //'blog', 'color', 'comment', 'forum', 'help', 'menu', 'taxonomy',
-
- // Then, enable any contributed modules here.
- // 'og', 'views', 'views_ui', 'views_rss',
- );
-}
-
-function vserver_profile_details() {
- return array(
- 'name' => 'Vserver Drupal Instance: __VSNAME__',
- 'description' => 'Automatically installed via vserverctl on __HOST__',
- );
-}
-
-function vserver_profile_final() {
- user_save(new stdClass(),
- array(
- 'name' => 'admin',
- 'pass' => 'admin',
- 'mail' => '__PROFILEOPTION_username__@catalyst.net.nz',
- 'status' => 1
- )
- );
- return '<p>Vserver "__VSNAME__" successfully installed via vserverctl</p>';
-}
+++ /dev/null
-drupal-5.1.tar.gz /root/
-postgres.connect.patch /root/
-drupal-new-site.sh /home/nigel/
+++ /dev/null
-apache2
-libapache2-mod-php5
-php5-pgsql
-php5-gd
-file
-cogito
-make
-python
-build-essential
-debhelper
-fakeroot
+++ /dev/null
-USR=${PROFILEOPTION_username}
-mkdir /home/$USR/htdocs
-echo '<?php phpinfo(); ?>' > /home/$USR/htdocs/index.php
-
-cd /home/$USR
-
-tar zxvf /root/drupal-5.1.tar.gz
-mv drupal-5.1/* htdocs/
-mv drupal-5.1/.htaccess htdocs/
-rmdir drupal-5.1
-mkdir htdocs/profiles/vserver
-cp /root/vserver.profile htdocs/profiles/vserver/
-cp /root/settings.php htdocs/sites/default/
-
-( cd htdocs; patch -p0 < /root/postgres.connect.patch )
-
-chown -R $USR:$USR /home/$USR
-chmod 777 /home/$USR/htdocs/sites/default/settings.php
-
-# Make data directory
-mkdir htdocs/files
-chown www-data:www-data htdocs/files
-
-# Configure apache2
-rm /etc/apache2/sites-enabled/000-default
-echo -e "NameVirtualHost *\nServerName drupal" > /etc/apache2/conf.d/vhost
-
-a2enmod rewrite
-/etc/init.d/apache2 force-reload
+++ /dev/null
-# Create the database for the mahara install
-vserver pg81 suexec postgres createdb ${VSNAME} -Ogeneral -EUNICODE
-
-# Remove the tmp filesystem mounting
-grep -v tmp /etc/vservers/${VSNAME}/fstab > /etc/vservers/${VSNAME}/fstab.new
-mv /etc/vservers/${VSNAME}/fstab.new /etc/vservers/${VSNAME}/fstab
+++ /dev/null
-parent = webserver
+++ /dev/null
-# Drop the database
-vserver pg81 suexec postgres dropdb ${VSNAME}
+++ /dev/null
-drupal.conf /etc/apache2/sites-enabled/
-vserver.profile /root/
-settings.php /root/
-.bash_once /home/nigel/
-drupal.cron /etc/cron.d/drupal
+++ /dev/null
-# Check out and set up the mahara install
-cg-clone "git+ssh://git.catalyst.net.nz/var/git/mahara.git#__PROFILEOPTION_branch__" mahara
-sudo chown __PROFILEOPTION_username__:__PROFILEOPTION_username__ config.php
-mv config.php mahara/htdocs/
-mkdir mahara/logs/
-sudo chown www-data:www-data mahara/logs
-mkdir mahara/.patches
-sudo mkdir /var/lib/mahara
-sudo chown www-data:www-data /var/lib/mahara
-
-sudo apachectl restart
-
-# Make this file owned by the user. Might be nicer if the permissions could be controlled by the 'files' file...
-sudo chown $USER:$USER .bash_once
+++ /dev/null
-<?php
-/**
- * This program is part of Mahara
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @package mahara
- * @subpackage core
- * @author Penny Leach <penny@catalyst.net.nz>
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL
- * @copyright (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
- *
- */
-
-$cfg = new StdClass;
-
-
-// database connection details
-$cfg->dbtype = 'postgres8';
-$cfg->dbhost = 'pg81';
-$cfg->dbport = 5432;
-$cfg->dbname = '__VSNAME__';
-$cfg->dbuser = 'general';
-$cfg->dbpass = '';
-$cfg->dbprefix = '';
-
-// wwwroot - the web-visible path to your Mahara installation
-// Normally, this is automatically detected - if it doesn't work for you
-// then try specifying it here
-//$cfg->wwwroot = 'http://myhost.com/mahara/';
-
-// dataroot - uploaded files are stored here
-// must be writable by the webserver and outside document root.
-// Mahara will NOT RUN if this is inside your document root, because
-// this is a big security hole.
-$cfg->dataroot = '/var/lib/mahara';
-
-// system mail address. emails out come from this address.
-// if not specified, will default to noreply@ automatically detected host.
-// if that doesn't work or you want something else, then specify it here.
-// $cfg->noreplyaddress = 'noreply@myhost.com'
-
-// Logging configuration
-// For each log level, you can specify where the messages are displayed.
-// LOG_TARGET_SCREEN makes the error messages go to the screen - useful
-// when debugging but not on a live site!
-// LOG_TARGET_ERRORLOG makes the error messages go to the log as specified
-// by the apache ErrorLog directive. It's probably useful to have this on
-// for all log levels.
-// You can combine them with bitwise operations,
-// e.g. LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG
-//
-// This configuration is suitable for people running Mahara for the first
-// time. You will immediately see environment errors, and so can correct
-// them. You will be able to see other debugging information in your error
-// logs. Once your site is up and running you might want to remove the
-// environment level logging completely, and just log everything else to
-// the error log.
-$cfg->log_dbg_targets = LOG_TARGET_ERRORLOG;
-$cfg->log_info_targets = LOG_TARGET_ERRORLOG;
-$cfg->log_warn_targets = LOG_TARGET_ERRORLOG;
-$cfg->log_environ_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG;
-// This configuration is suitable for developers. You will see all errors
-// and they will also be in the logs.
-//$cfg->log_dbg_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG;
-//$cfg->log_info_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG;
-//$cfg->log_warn_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG;
-//$cfg->log_environ_targets = LOG_TARGET_SCREEN | LOG_TARGET_ERRORLOG;
-
-// The log levels that will generate backtraces. Useful for development,
-// but probably only warnings are useful on a live site.
-$cfg->log_backtrace_levels = LOG_LEVEL_WARN | LOG_LEVEL_ENVIRON;
-
-// mail handling
-// if you want mahara to use smtp servers to send mail, enter one or more here
-// blank means mahara will use the default PHP method.
-$cfg->smtphosts = 'smtp.catalyst.net.nz';
-// If you have specified an smtp server above, and the server requires authentication,
-// enter them here
-// $cfg->smtpuser = '';
-// $cfg->smtppass = '';
-?>
+++ /dev/null
-NameVirtualHost *:80
-<VirtualHost *:80>
- ServerName __VSNAME__.__HOST__.wgtn.cat-it.co.nz
- DocumentRoot /home/__PROFILEOPTION_username__/mahara/htdocs
-
- <Directory /home/__PROFILEOPTION_username__/mahara/htdocs>
- AllowOverride all
- </Directory>
-
- ErrorLog /home/__PROFILEOPTION_username__/mahara/logs/error.log
- CustomLog /home/__PROFILEOPTION_username__/mahara/logs/access.log full
-</VirtualHost>
+++ /dev/null
-apache
-libapache-mod-php5
-php5-pgsql
-php5-gd
-file
-clamav-daemon
-clamav-freshclam
-cogito
-make
-python
-sun-java5-jdk
-build-essential
-debhelper
-fakeroot
+++ /dev/null
-# Create the database for the mahara install
-vserver pg81 suexec postgres createdb ${VSNAME} -Ogeneral -EUNICODE
-
-# Remove the tmp filesystem mounting
-grep -v tmp /etc/vservers/${VSNAME}/fstab > /etc/vservers/${VSNAME}/fstab.new
-mv /etc/vservers/${VSNAME}/fstab.new /etc/vservers/${VSNAME}/fstab
+++ /dev/null
-echo 'sun-java5-bin shared/accepted-sun-dlj-v1-1 boolean true' | debconf-set-selections
+++ /dev/null
-parent = webserver
+++ /dev/null
-# Drop the database
-vserver pg81 suexec postgres dropdb ${VSNAME}
+++ /dev/null
-mahara.conf /etc/apache/conf.d/
-config.php /home/__PROFILEOPTION_username__/
-.bash_once /home/__PROFILEOPTION_username__/
+++ /dev/null
-# Mahara
-deb http://debian.mahara.org/ unstable mahara
+++ /dev/null
-echo 'debconf debconf/priority select critical' | debconf-set-selections
-echo 'mahara-apache2 mahara/db_host string pg81' | debconf-set-selections
-echo 'mahara-apache2 mahara/db_port string 5432' | debconf-set-selections
-echo "mahara-apache2 mahara/db_name string ${VSNAME}" | debconf-set-selections
-echo 'mahara-apache2 mahara/db_user string martyn' | debconf-set-selections
-echo "mahara-apache2 mahara/servername string ${VSNAME}.abelard.wgtn.cat-it.co.nz" | debconf-set-selections
-
-DEBCONF_FRONTEND=noninteractive apt-get install mahara-apache2 --assume-yes --force-yes
+++ /dev/null
-vserver pg81 suexec postgres createdb ${VSNAME} -Omartyn -EUNICODE
-
+++ /dev/null
-parent = webserver
+++ /dev/null
-vserver pg81 suexec postgres dropdb ${VSNAME}