devxlogo

Determine What Web Server Is Installed on a Remote Machine

Determine What Web Server Is Installed on a Remote Machine

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.comimport 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);        }    }}
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist