tjl2.com

A place to store useful stuff

Site Navigation

Home  |  Linux System Admin  |  Scripts Quotawatch  |  VirtDomain  |  Blockip  |   |  Downloads  | 

Parallels pro virtdomain.sh scripts

Ensim/Parallels Pro 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.

Below are some examples of virtDomin.sh scripts.

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

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/ , or you will need to add this code to your existing virtDomain.sh script if you have one. Finally, copy the 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 if they have been set up during installation).

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/ , or you will need to add this code to your existing virtDomain.sh script if you have one.