Hi All,
I need of use a script perl in httpd.conf for set dynamic vhosts and I try this script but don't work, I don't know perl script
PHP Code:
<perl>
#!/usr/bin/perl -w
local ($ip,$host,$admin,$vroot,$aliases);
local ($directive,$args);
open (FILE,"/var/www/vhosts/myuser/conf/vhost-perl.conf");
while (<FILE>) {
next if /^\s*(#|$) / ;
if (/^d+/) {
($ip,$host,$admin,$vroot,$aliases)=split /\s*,\s*/, $_;
$VirtualHost{ip}= {
ServerName =>$host,
ServerAdmin => $admin,
DocumentRoot => "/var/www/vhosts/myuser/subdomains/beta/httpdocs",
ErrorLog => "logs/".$host."_error.log",
TransferLog =>"logs/".$host."_access.log"
};
$VirtualHost {$ip} {ServerAlias} =$aliases if $aliases;
$VirtualHost {$ip} {Port} =$1 if ($ip=~/:(\d+)$/);
} elsif ($ip) {
($directive,$args)=split / /, $_,2;
$VirtualHost {$ip} {$directive}=$args;
}
}
close (FILE);
#_END_
</perl>



LinkBack URL
About LinkBacks
Reply With Quote




