Protocol New instance for 1 codebase

October 7, 2008 – 17:43

What to do when you want to add a new virtual host/url to the multi instance Moodle?

1. Edit config.php

go to the Moodle codebase document root and add an entry for the new site. Typically this means copy/pasting an old entry and editing parameters for the new site. Make sure that the index (url) and other variables are correct and pointing to existing databases and directories

2. Check Database and Datadir

Check if the database and datadir, set in the config.php in step 1, exist.

Database:

su dbuser
psql -l

if not exist:

createdb -e dbname

Datadir:

ls /paht/to/moodledata

if not exist:

mkdir  /path/to/moodledata/datadir

3. Add new Virtual Host config

copy an existing virtual host config file in

cp /etc/httpd/conf/sites-available/exsitingconfig.conf /etc/httpd/conf/sites-available/newconfig.conf

edit newconfig.conf so new settings are enabled. Now, to make the site available, make a symlink to the sites-enabled directory:

ln -s /etc/httpd/conf/sites-available/new.conf /etc/httpd/conf/sites-enabled/new.conf

Reload Apache conf:

service httpd configtest

service httpd reload

4. Go to the new url

Go to the new site and install Moodle as described in the normal Stoas protocol in the wiki

Note: make sure you hold to the syntax of the virtual host config file, otherwise the cron will not pick it up.

5. Add AWstats config file

Add AWstats config file for the new site according to wiki entry

6. Post install

Run the following line of SQL on the newly created database:

ALTER TABLE mdl_user ALTER COLUMN maildisplay SET DEFAULT 0;

After installation make sure all the customisations work for the new install:

TODO: make test script to check if cron is running properly

7. Add admin user for client contact

Add a user in Moodle and assign him the global admin role so he can setup the environment.

Sorry, comments for this entry are closed at this time.