package Apache::ServerIndex;

use strict;
use Apache::Constants qw(:common);

sub handler {
    my $r = shift;
    $r->send_http_header("text/html");
    $r->print(<<EOF);
<html>
<head><title>Server Index</title></head>
<body>
<h1>Server Index</h1>
<hr>
EOF
    for (my $s = $r->server; $s; $s = $s->next) {
	my $host = $s->server_hostname;
	my $port = $s->port || 80;
	my $admin = $s->server_admin;
	$r->print(<<EOF);
<a href="http://$host:$port/">$host</a> - 
<a href="mailto:$admin">$admin</a><p>
EOF
    }
    $r->print("</body></html>");
}

1;
__END__
 PerlModule Apache::ServerIndex
 <Location />
 PerlHandler Apache::ServerIndex
 </Location>

                                 Server Index
     _________________________________________________________________

   romano.cshl.org - dougm

   crayfish.cshl.org - crayfish@fish.net

   bluefish.cshl.org - bluefish@fish.net
