Using Java, you can easily find out what Web server is installed on a remote machine. Just open a URLConnection to the remote host and parse the header for the "Server" entity, which will give the name of the Web server.
//pass the site address as command line argument
//eg:- java http://www.javasoft.com
import java.io.*;
import java.net.*;
public class findServer
{
public static void main(String a[])
{
try
{
URL u=new URL(a[0]);
System.out.println("Web server of site"+a[0]+"is
-"+u.openConnection().getHeaderField("Server"));
}
catch(Exception e)
{
System.out.println(e);
}
}
}