|
Hi Group <Perl> use DBI; my ($sth, $dbh, $domain, $domainID, $created, $sql,
$sqlsa); $dbh = DBI->connect("DBI:xxxx:localhost","xxxx","xxxx"); $sth = $dbh->prepare("SELECT domainID,
domain, created FROM domain ORDER BY domainID ASC"); $sth->execute(); while (($domainID, $domain, $created) =
$sth->fetchrow_array()) {
if($created == 0) {
system("/bin/mkdir /home/$domain");
system("/bin/mkdir /home/$domain/www");
system("/bin/mkdir /home/$domain/ErrorLog");
system("/bin/cp /home/index.php /home/$domain/www/index.php");
system("/bin/chown apache:apache -R /home/$domain");
$sql = $dbh->prepare("UPDATE domain SET created = 1 WHERE domainID =
$domainID");
$sql->execute(); } push @{
$VirtualHost{'*:80'} },
{
ServerName => "$domain",
ServerAdmin => "suppressed",
ServerAlias => "www.$domain",
DocumentRoot => "/home/$domain/www",
ErrorLog =>
"/home/$domain/ErrorLog/$domain-error_log",
#CustomLog => "/websitelog/$domain
combined", CustomLog
=> qq{"|/usr/sbin/cronolog
/websitelog/${domain}_access_log.\%Y-\%m-\%d" combined},
}; } $sth->finish(); $dbh->disconnect(); </Perl> It works perfectly
Should I first push the data as I do now, and the
push the new data afterwards, and if so how do I do that? I hope you can help Med venlig hilsen / Best Regards Device.Webbureau P: +45 70 21 00 04 |
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.