I use this script for match vhost but I get any errors:
Starting httpd: Syntax error on line 196 of /var/www/vhosts/myhost/conf/httpd.include:
\t(in cleanup) Search pattern not terminated at /var/www/vhosts/myhost/conf/httpd.include line 220.\n
this is the script:
PHP Code:
<perl>
#!/usr/bin/perl -w
local ($ip,$host,$admin,$vroot,$aliases);
local ($directive,$args);
open (FILE,"/var/www/vhosts/myhost/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/myhost/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>
I solved, the error is: __END__ and not _END_ but now if I restart httpd and I try to run the vhost that I added in /var/www/vhosts/myhost/conf/vhost-perl.conf I don't see nothing results, so the vhost is not configured in httpd.include