Apache Tomcat Vs Apache HTTP Server
Motivation
I wanted to understand how these Apache Tomcat and Apache HTTP Server works so i did the deep dive into these topics
Apache is a software software foundation under which so many projects are there out of which Tomcat and HTTP Server are two.
Apache HTTP Server
It is basically a file server that will serve the static content such as files,images,audio,video over HTTP protocol.
There is no login associated with the HTTP Server it will just serve the content over HTTP Protocol which is a stateless protocol
Apache Tomcat
Servlet engine that implements servlet and JSP Specification , it requires JDK to run and it will basically perform the logic like connecting to the Database and making the Query and generate the content and give it back to Apache HTTP Server.
with Tomcat , you can build the WAR and deploy them in the deploy folder Tomcat includes Catalina ,which is a servlet container, and servlet at the end is a java class.
How Both Works Together
Both the HTTP Server and Tomcat works in conjunction
Client --> sends request to HTTP server if it requires some logic --> send requests to Tomcat --> do the logic and revert the request to HTTP Server --> HTTP Server send it back to the Web Based Client.
#Apache JServ Protocol (AJP)
AJP is the binary protocol which is basically used to communicate from the web server to the application server that means from the HTTP server to the tomcat server
What is Connectors in Tomcat ?
- http connector is one of the connector which is the default and can directly be used out of the box.
Logs
catalina out -> logs which are printed by tomcat
access logs -> it tracks each requests that reaches tomcat, so there are some cases in my dev journey where the request reaches tomcat but it does not reaches application , so in that sense i was confused the request is send from one api it should reach second api , but there is no logs in the application logs so in that case we checked the access logs of the tomcat,and hence we were seeing 404 there.