What is the difference between application server and web server?

前端 未结 27 2294
攒了一身酷
攒了一身酷 2020-11-22 17:03

What is the difference between application server and web server?

27条回答
  •  鱼传尺愫
    2020-11-22 17:14

    A Web server exclusively handles HTTP/HTTPS requests. It serves content to the web using HTTP/HTTPS protocol.

    An application server serves business logic to application programs through any number of protocols, possibly including HTTP. The application program can use this logic just as it would call a method on an object. 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. The main point is that the web server exposes everything through the http protocol, while the application server is not restricted to it. An application server thus offers much more services than an web server which typically include:

    • A (proprietary or not) API
    • Load balancing, fail over...
    • Object life cycle management
    • State management (session)
    • Resource management (e.g. connection pools to database)

    Most of the application servers have Web Server as integral part of them, that means App Server can do whatever Web Server is capable of. Additionally App Server have components and features to support Application level services such as Connection Pooling, Object Pooling, Transaction Support, Messaging services etc.

    An application server can (but doesn't always) run on a web server to execute program logic, the results of which can then be delivered by the web server. That's one example of a web server/application server scenario. A good example in the Microsoft world is the Internet Information Server / SharePoint Server relationship. IIS is a web server; SharePoint is an application server. SharePoint sits "on top" of IIS, executes specific logic, and serves the results via IIS. In the Java world, there's a similar scenario with Apache and Tomcat, for example.

    As web servers are well suited for static content and app servers for dynamic content, most of the production environments have web server acting as reverse proxy to app server. That means while service a page request, static contents such as images/Static html is served by web server that interprets the request. Using some kind of filtering technique (mostly extension of requested resource) web server identifies dynamic content request and transparently forwards to app server.

    Example of such configuration is Apache HTTP Server and BEA WebLogic Server. Apache HTTP Server is Web Server and BEA WebLogic is Application Server. In some cases, the servers are tightly integrated such as IIS and .NET Runtime. IIS is web server. when equipped with .NET runtime environment IIS is capable of providing application services


    Web Server                               Programming Environment
    Apache                                   PHP, CGI
    IIS (Internet Information Server)        ASP (.NET)
    Tomcat                                   Servlet
    Jetty                                    Servlet
    
    Application Server                       Programming Environment
    WAS (IBM's WebSphere Application Server) EJB
    WebLogic Application Server (Oracle's)   EJB
    JBoss AS                                 EJB
    MTS                                      COM+
    

提交回复
热议问题