Server is a device or a computer program that accepts and responds to the request made by other program, known as client. It is used to manage the network resources and for running the program or software that provides services.

There are two types of servers:

  1. Web Server
  2. Application Server

Web Server

Web server contains only web or servlet container. It can be used for servlet, jsp, struts, jsf etc. It can’t be used for EJB.

It is a computer where the web content can be stored. In general web server can be used to host the web sites but there also used some other web servers also such as FTP, email, storage, gaming etc.

Examples of Web Servers are: Apache Tomcat and Resin.

Web Server Working

It can respond to the client request in either of the following two possible ways:

  • Generating response by using the script and communicating with database.
  • Sending file to the client associated with the requested URL.

The block diagram representation of Web Server is shown below:

Web Server1

Important points

  • If the requested web page at the client side is not found, then web server will sends the HTTP response: Error 404 Not found.
  • When the web server searching the requested page if requested page is found then it will send to the client with an HTTP response.
  • If the client requests some other resources then web server will contact to application server and data is store for constructing the HTTP response.

Application Server

Application server contains Web and EJB containers. It can be used for servlet, jsp, struts, jsf, ejb etc. It is a component based product that lies in the middle-tier of a server centric architecture.

It provides the middleware services for state maintenance and security, along with persistence and data access. It is a type of server designed to install, operate and host associated services and applications for the IT services, end users and organizations.

The block diagram representation of Application Server is shown below:

Web Server2

The Example of Application Servers are:

  1. JBoss: Open-source server from JBoss community.
  2. Glassfish: Provided by Sun Microsystem. Now acquired by Oracle.
  3. Weblogic: Provided by Oracle. It more secured.
  4. Websphere: Provided by IBM.