I hacked this one out a million years ago but havnt needed it for at least three.......you will need to check to see if your apache settings and such are the same or change it if you need to.
Name it say newdomain.pl or something then run it from root using
perl ./newdomain.pl
.................................................. ................................................
#!/usr/bin/perl
use DBI;
%db = (
name => q'mysql',
host => q'localhost',
user => q'root',
pass => q'what_ever_your_pass_is');
print "Enter a username: ";
chomp($USERNAME = <STDIN>);
print "Enter a hostname (without www): ";
chomp($HOSTNAME = <STDIN>);
print "Would u like to create a database for this user? (y or n): ";
chomp($create_db = <STDIN>);
if($create_db =~ m/^y.*/)
{
print "Please enter the database password: ";
chomp($DBPASS = <STDIN>);
}
$HOMEDIR = "/home/$HOSTNAME";
print <<`EOS`;
echo "Creating user in shell"
/usr/sbin/useradd -d $HOMEDIR -g users -s /bin/bash $USERNAME
Comment