perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tue Topholm" ...@device.dk>
Subject Mod_perl + cronolog
Date Wed, 08 Nov 2006 12:10:54 GMT
I have this script:

<Perl>
use DBI;
my ($sth, $dbh, $domain, $domainID, $created, $sql);
$dbh = DBI->connect("DBI:mysql:ccc:cccc","ccc","ccc");
$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/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 => " <mailto:postmaster@$domain%22> postmaster@$domain";,
ServerAlias => "www.$domain",
DocumentRoot => "/home/$domain/www",
ErrorLog => "/home/$domain/ErrorLog/$domain-error_log",
CustomLog => "|/usr/sbin/cronolog /home/log/$domain-access_log.%Y-%m-%d
combined",
};
}
$sth->finish();
$dbh->disconnect();
</Perl>

 

 

But it crashes when it tries to read the line:

CustomLog => "|/usr/sbin/cronolog /home/log/$domain-access_log.%Y-%m-%d
combined",

 

The failure is:
apachectl: Configuration syntax error, will not run "graceful":
Syntax error on line 2 of /vhosts/vhosts.conf:
$parms->add_config() has failed: error in condition clause at
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-
thread-multi/Apache2/PerlSections.pm line 203.\n



If I remove this line, everything works just perfect.

 

How should I define cronolog??






 

Med venlig hilsen / Best Regards
Tue Topholm

Device.Webbureau
M: +45 26 74 07 41

P: +45 70 21 00 04
LinkedIN:  <http://www.linkedin.com/in/ttopholm>
http://www.linkedin.com/in/ttopholm

 

 


Mime
View raw message