Ajout du support de vhosts simples (sans DNS ni mail)

tags/0.2.7
Daniel Berteaud 12 years ago
parent e61b75b101
commit b1346229d2
  1. 33
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/81SimpleVHosts

@ -0,0 +1,33 @@
{
$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',
});
}
}
}
Loading…
Cancel
Save