#!/usr/local/bin/perl require '/httpd/cgi-bin/headfoot.pl'; if ($ENV{'SERVER_PORT'} eq "443") { print "Location: http://www.flash.net/~domain/tools/index.cgi\n\n"; } use Fcntl; use DB_File; read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); @in = split(/&/,$in); foreach $i (0 .. $#in) { $in[$i] =~ s/\+/ /g; ($key, $val) = split(/=/,$in[$i],2); $key =~ s/%(..)/pack("c",hex($1))/ge; $val =~ s/%(..)/pack("c",hex($1))/ge; $in{$key} .= "\0" if (defined($in{$key})); $in{$key} .= $val; foreach (keys %in) { $in{$_} =~ tr/"/ /; } } $in{'domain'} =~ /(^.+)/; $domain = $1; $user = $in{'user'}; if ($domain) { &get_info; } elsif ($user) { &user; } else { &startup; } sub print_header { print "Content-type: text/html \n\n"; print "$header"; } sub startup { &print_header; print <<_EOF_;
Use domainname.com, without the www. ie. javahaus.com
- Domain name to check on

- Include NSLookUp (this will take a little longer)

- Include WhoIs record (this will take a little longer)



- Check email aliases on this domain


- User name to check on

$footer _EOF_ exit; } ######################################################################## sub get_info { &print_header; print "

$domain

\n
\n"; $db_file = "/home/httpd/conf/domains.db"; $db_obj = tie(%data, 'DB_File', $db_file, O_RDONLY, 0444) or print $!; if (!$data{$domain}) { print "

It is not in the httpd.comf

"; } else { $h = $domain; ($rootdir,$serveraliases,$logging) = split(/\|\|/,$data{$h}); $first = substr($h,0,1); $log_name = "${h}_log"; $access_log = "/httpd/logs/domain_logs/$first/$log_name"; $serveralias = (split(' ',$serveraliases))[0]; if ($h =~ /\d+\.\d+\.\d+\.\d+/) { $host = $serveralias; } else { $host = $h; } print ""; print ""; print ""; print ""; print ""; print ""; print "
VirtualHost $h
SeverAdmin webmaster\@$host
DocumentRoot $rootdir
ServerName $host
ServerAlias $serveraliases www.$serveralias
TransferLog "; if($logging eq "y"){ print "$access_log"; }else{ print "n/a"; } print "
ErrorLog logs/error_log
"; if (! $rootdir) { print "Sorry, that domain is not hosted by FlashNet Communications\n\n"; } } undef $db_obj; untie(%data); if ($in{'nslookup'}) { print "
";
	print "

\n

NSLookUp

\n"; print `/usr/sbin/nslookup $domain`; print "
"; } if ($in{'who_is'}) { print "
";
	print "

\n

WhoIs Record

\n"; print `whois -h whois.crsnic.net $domain`; print "
"; } print ""; print "$footer"; exit; } ######################################################################## sub user { &print_header; print <<_EOF_;

$user


_EOF_ $frst = substr($user,0,1); $scnd = substr($user,1,1); $rootdir = "/home/$frst/$scnd/$user/www"; $db_file = "/home/httpd/conf/domains.db"; $db_obj = tie(%data, 'DB_File', $db_file, O_RDONLY, 0444) or print $!; for (keys %data) { if ($data{$_} =~ /$rootdir/) { print "

$_

"; $h = $domain = $_; ($rootdir,$serveraliases,$logging) = split(/\|\|/,$data{$h}); $first = substr($h,0,1); $log_name = "${h}_log"; $access_log = "domain_logs/$first/$log_name"; $serveralias = (split(' ',$serveraliases))[0]; if ($h =~ /\d+\.\d+\.\d+\.\d+/) { $host = $serveralias; } else { $host = $h; } print ""; print ""; print ""; print ""; print ""; print ""; print "
VirtualHost $h
SeverAdmin webmaster\@$host
DocumentRoot $rootdir
ServerName $host
ServerAlias $serveraliases www.$serveralias
TransferLog "; if($logging eq "y"){ print "$access_log"; }else{ print "n/a"; } print "
ErrorLog logs/error_log
"; } } undef $db_obj; untie(%data); print $footer; exit; } ########################################################################