You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
957 B
33 lines
957 B
{
|
|
$OUT = '';
|
|
|
|
use esmith::DomainsDB;
|
|
|
|
my $db = esmith::DomainsDB->open_ro;
|
|
unless ($db){
|
|
warn "Couldn't open domains DB in VirtualHosts template fragment";
|
|
return;
|
|
}
|
|
|
|
my @vhosts = $db->get_all_by_prop('type' => 'vhost');
|
|
foreach my $vhost (@vhosts) {
|
|
my $templatePath = $vhost->prop('TemplatePath') || 'VirtualHosts';
|
|
foreach my $port (qw(80 443)){
|
|
my %virtualHost = (
|
|
ipAddress => '0.0.0.0',
|
|
port => $port,
|
|
localAccess => $localAccess,
|
|
externalSSLAccess => $externalSSLAccess,
|
|
domain => $vhost,
|
|
);
|
|
|
|
$OUT .= esmith::templates::processTemplate (
|
|
{
|
|
MORE_DATA => \%virtualHost,
|
|
TEMPLATE_PATH =>
|
|
"/etc/httpd/conf/httpd.conf/$templatePath",
|
|
OUTPUT_TYPE => 'string',
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|