A Web server is a program that, using the client/server model and the World Wide Web's Hypertext Transfer Protocol, serves the files that form Web pages to Web users (whose computers contain HTTP clients that forward their requests). Every computer on the Internet that contains a Web site must have a Web server program.
Examples:
Web servers often come as part of a larger package of Internet- and intranet-related programs for serving e-mail, downloading requests for File Transfer Protocol files, and building and publishing Web pages. Considerations in choosing a Web server include how well it works with the operating system and other servers, its ability to handle server-side programming, and publishing, search engine, and site building tools that may come with it.
What is an application Server
Application servers are software that help enterprises develop, deploy and manage large numbers of applications that are mostly distributed in nature.
From a developer's point of view, the central difference that an application server brings about is the separation of business logic from the presentation logic and the database logic. Essentially, application servers help us build true 3-tier applications where the database is logically separated (sometimes physically separated too) from the business logic.
Developing a server involves dealing with many complicated issues:
An application server can simplify your development process. Application servers usually take care of most, if not all the involved technical issues and allow developers to concentrate on the reason why the project came about in the first place - the business need. This allows one to budget for much larger and much more useful systems.
While application servers like BEA Weblogic, IBM Websphere or Microsoft Backoffice Server give you a great head-start in web and line-of-business application building, they are nonetheless very advanced and complicated products. Their application building frameworks are meant for use by advanced developers. The time involved in learning the essential technologies involved in the framework can be considerable.
As the diagram shows, Web sites built using the application server model consist of at least three back-end layers:
An application server can have deployed on it several different applications which function seperately. eg: WebSphere
For our purposes we will concentrate on the combination of web servers and application servers interfacing for web applications(ie:
using a web browser):
As more buisness-critical applications come to the web ,the systems management
and operational issues associated with Web development become crucial.
The challaenge of creating web sites with reliability, scalability, stability, and manageability
have to addressed.
How then can programmers deal with the problems of development an deployment.
A new model for Web development has evolved to address these development and deployment issues. Web application servers form a clear level of separation between the Web server and data access layers. As the diagram shows, Web sites built using the application server model consist of at least three back-end layers:

In this model, most or all buisness logic exists in the middle tier, with application servers handling all data manipulation and web page creations.
In many usages,the application server combines or works with a web Server and is called a Web Application Server.

When we don't need the Aplication Server
However for smaller non-mission -critical applications there will be no need to invest in an application server. A web browser which supports a Html-based front end communicates with a web server. The Web server provides several different ways to service a request band to forward back a modified or new Web page to the user. These approaches include the Common Gateway Interface (CGI), Microsoft's Active Server Page (ASP), and the Java Server Page (JSP).