Web Server and Application Sever
A 'Web Server' is basically any server program which serves content using the http (or https) protocols.
Web Server is mostly programmed and developed to serve static content, though most Web Servers have plugins to support scripting languages like Perl, PHP, ASP, JSP, SERVLET etc. through which these servers can generate dynamic HTTP content.
When the Web server receives an HTTP request from the http client program, it responds to the http client with an HTTP response, such as sending back an HTML page. To process a request, a Web server may respond with a static HTML page or image etc.
Example of web servers :-
Examples of web servers: NodeJS , Apache Web Server, Microsoft IIS
An Application Server behaves as Web Server with http protocol and it support other protocol as well.
Application server contains EJB container which supports component based programming and offers many system level services to business logic like session management, transactions, security, persistence , remote accessibility, Resource Pooling etc . In most cases, the server exposes this business logic through a component API, such as the EJB (Enterprise JavaBean) component model found on Java EE (Java Platform, Enterprise Edition) application servers.
Application Server = Web Server + EJB Container
Example of Application Server :-
Examples of Application servers: JBOSS , Web Sphere, WEBLOGIC etc.