tjl2.com

A place to store useful stuff

Want great value broadband? - Move to Force9 for FREE!
Super-fast broadband

virtDomain.sh Scripts

Ensim calls a script called virtDomain.sh every time a site is added to the server. If such a script exists in /etc/appliance/customization/ at this time, it is sent the domain name, the site administrator username and the IP address of that site as arguments.

Database customisation

The script in the links below can be used to do the following steps when a site is created:

  1. If MySQL has been enabled for the site, create a database (using the defined prefix), called 01
  2. Once the DB is created, then modify the mysql.user and mysql.db tables to allow connections from any host

View this script.
Download a copy of this script.
To use this script, download the db_add.txt and rmLocks files from the link above. Edit the db_add.txt file and insert your MySQL root password into the appropriate place. You must then rename db_add.txt to virtDomain.sh and copy it into /etc/appliance/customization/. Finally, copy rmLocks file to /etc/appliance/.

Additional Logrotate File

The following script can be modified to create extra logrotate configurations for a virtual site. This version of the script creates a file in /home/virtual/site#/fst/etc/logrotate.d to rotate out Miva 5 sql.log files (which grow at a fast pace and can't be removed if they have been set up during installation).
View this script.
Download a copy of this script.
To use this script, download the logrotate_mm5.txt file. You must then rename logrotate_mm5.txt to virtDomain.sh and copy it into /etc/appliance/customization/.