Re: Perl ...... yuk ...... :sick:
I think I get it now anyway but still no luck ... it seems the its an array and I need to push it on :thinks:
Re: Perl ...... yuk ...... :sick:
Stupid thing - grrrrrrrrr
Code:
<perl>
#!/usr/bin/perl -w
#line <1022>
local ($vhost_dir, $doc_root, $name, $vh);
$vhost_dir = "/home/web";
opendir(VHOSTS, $vhost_dir);
my @file_list = grep(/^[^\.]/,readdir(VHOSTS));
closedir(VHOSTS);
foreach $name (@file_list) {
$doc_root = "$vhost_dir/$name";
if (-d $doc_root) {
$vh={
ServerName => "$name.codedv.com",
DocumentRoot => "$doc_root/htdocs",
SuExecUserGroup => "$name users",
CustomLog => "$doc_root/logs/access_log common",
ErrorLog => "$doc_root/logs/error_log",
ScriptAlias => "/cgi-bin/ $doc_root/cgi-bin/",
Directory => {
"$doc_root/cgi-bin" => {
Options => "+ExecCGI",
Order => "allow,deny",
Allow => "from all"
}
}
}
if (-f "$doc_root/conf/httpd.conf") {
$$vh{Include} = "$doc_root/conf/httpd.conf";
}
push @{ $VirtualHost{'10.10.3.2:80'} }, $vh
}
}
__END__
</perl>
Re: Perl ...... yuk ...... :sick:
Gottit :D YAYYYYYYY :lol:
Code:
<perl>
#!/usr/bin/perl -w
#line <1022>
local ($vhost_dir, $doc_root, $name, $vh);
$vhost_dir = "/home/web";
opendir(VHOSTS, $vhost_dir);
my @file_list = grep(/^[^\.]/,readdir(VHOSTS));
closedir(VHOSTS);
foreach $name (@file_list) {
$doc_root = "$vhost_dir/$name";
if (-d $doc_root) {
$vh={
ServerName => "$name.codedv.com",
DocumentRoot => "$doc_root/htdocs",
SuExecUserGroup => "$name users",
CustomLog => "$doc_root/logs/access_log common",
ErrorLog => "$doc_root/logs/error_log",
ScriptAlias => "/cgi-bin/ $doc_root/cgi-bin/",
Directory => {
"$doc_root/cgi-bin" => {
Options => "+ExecCGI",
Order => "allow,deny",
Allow => "from all"
}
}
};
if (-f "$doc_root/conf/httpd.conf") {
$$vh{Include} = "$doc_root/conf/httpd.conf";
}
push @{ $VirtualHost{'10.10.3.2:80'} }, $vh
}
}
__END__
</perl>
Re: Perl ...... yuk ...... :sick:
I still havn't got a clue how the variables work but the main thing is it works :D
Re: Perl ...... yuk ...... :sick:
Still wrong forum though..:D
Re: Perl ...... yuk ...... :sick:
You were too slow - I solved my problem now.