From efbed2d17dd75bf5d10fd40fadd6757dadff9773 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 13 Mar 2012 12:51:53 +0100 Subject: [PATCH] Add ServerAlias support --- .../httpd/conf/httpd.conf/WebAppVirtualHost/03ServerAlias | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/03ServerAlias diff --git a/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/03ServerAlias b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/03ServerAlias new file mode 100644 index 0000000..480dba0 --- /dev/null +++ b/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/WebAppVirtualHost/03ServerAlias @@ -0,0 +1,13 @@ + ServerAlias { + + use esmith::HostsDB; + use esmith::DomainsDB; + my $hdb = esmith::HostsDB->open_ro(); + my %domains = map { $_->key => 1 } esmith::DomainsDB->open_ro->domains; + my @hosts = grep { + my $h = $_; + ($h->prop('HostType') eq 'Self') && !$domains{$h->key} + } $hdb->get_hosts_by_domain($virtualHost); + $OUT = join " ", map { $_->key } @hosts; +} +