* In a vhost, merge in the robots.txt for the main server.

svn path=/nixos/trunk/; revision=10688
This commit is contained in:
Eelco Dolstra 2008-02-14 14:14:39 +00:00
parent 44fceb9c4d
commit b9d01830d3
2 changed files with 24 additions and 20 deletions

View File

@ -1166,20 +1166,6 @@
";
};
hostName = mkOption {
default = "localhost";
description = "
Canonical hostname for the server.
";
};
httpPort = mkOption {
default = 80;
description = "
Port for unencrypted HTTP requests.
";
};
httpsPort = mkOption {
default = 443;
description = "
@ -1235,6 +1221,24 @@
};
};
virtualHosts = mkOption {
default = [];
example = [
{ hostName = "foo";
documentRoot = "/data/webroot-foo";
}
{ hostName = "bar";
documentRoot = "/data/webroot-bar";
}
];
description = ''
Specification of the virtual hosts served by Apache. Each
element should be an attribute set specifying the
configuration of the virtual host. The available options
are the non-global options permissible for the main host.
'';
};
subservices = {
# !!! remove this

View File

@ -29,7 +29,9 @@ let
in map f defs;
allSubservices = callSubservices (makeServerInfo cfg) cfg.extraSubservices;
mainSubservices = callSubservices (makeServerInfo cfg) cfg.extraSubservices;
allSubservices = mainSubservices;
# !!! should be in lib
@ -150,6 +152,9 @@ let
'';
robotsTxt = pkgs.writeText "robots.txt" ''
${# If this is a vhost, the include the entries for the main server as well.
if isMainServer then ""
else concatMapStrings (svc: svc.robotsEntries) mainSubservices}
${concatMapStrings (svc: svc.robotsEntries) subservices}
'';
@ -276,11 +281,6 @@ let
# Always enable virtual hosts; it doesn't seem to hurt.
NameVirtualHost *:*
# Catch-all: since this is the first virtual host, any
# non-matching requests will use the main server configuration.
<VirtualHost *:*>
</VirtualHost>
${let
perServerOptions = import ./per-server-options.nix {
inherit (pkgs.lib) mkOption;