Make Apache act as a WHOIS server
mod_whois enables Apache (version 2) to receive standard WHOIS queries, and rewrites them to standard HTTP requests. The request can then be processed by the usual means (static content, CGI's, PHP, tomcat, whatever).
Please refer to the Sourceforge mod_whois project page for more information and downloads.