Web Server vs Application Server
People think a web server and an app server are the same program, and they are not. A web server takes every request and sends plain files, like images, by itself. An app server runs your code to build each answer from the data. Most sites run both, with the web server in front. Small sites can use one program for both jobs, which blurs the line.
Web Server
A program that answers web requests. It sends back pages and files.
A web server is a program that answers HTTP requests. A browser asks for a page, and the web server sends back the file or the answer. It listens on port 80 for HTTP and port 443 for HTTPS. It can hand out files from a folder, or pass the request on to an app. The word also means the computer that runs this program.
Application Server
A program that runs your app's code to build each answer when it is asked.
An application server runs the code that builds answers as they are asked for. It reads from a database, does sums and makes a page or some JSON for each request. A web server most often sits in front of it. The web server sends files itself and passes everything else on to the app server.
In one line
- Web Server
- A program that answers web requests. It sends back pages and files.
- Application Server
- A program that runs your app's code to build each answer when it is asked.