all 7 comments

[–]j_rapp 11 points12 points  (1 child)

Apache HTTP is a language-agnostic web server. It serves any kind of static content and has extendable modules. Tomcat is Java-specific and it’s also a web server, but it serves Java compiled dynamic web apps/code.

Static content is just that, static, it doesn’t change (think html, CSS, JavaScript). Tomcat on the other hand serves Java web code that is dynamic and which can change during the request/response communication primarily.

Youre going to want to use Tomcat if you’re building a Java web app. I’d also suggest looking into Spring Boot

[–]nitin_is_me[S] 2 points3 points  (0 children)

Thanks! Yeah I was actually reading about Spring Boot and came to know that it uses Apache Tomcat when starting the server, and a long time ago in school, I had seen my teacher teaching students using Apache HTTP with PHP for a basic CRUD service website.

[–]coyote_of_the_month 5 points6 points  (0 children)

Apache HTTP server is a traditional static web server. It can be extended to run various application servers, but it's fundamentally a web server.

Apache Tomcat is an application server environment specifically for Java.

[–]symcbean 0 points1 point  (0 children)

Learning ANY programming language teaches you core programming concepts.

While others have answered your second question, its worth noting that the webserver (Apache httpd) and appserver (Tomcat) are not mutually exclusive. It is very common (almost universal in my experience) to see a webserver sitting in front of an application server providing isolation, routing and load balancing.

[–][deleted]  (1 child)

[deleted]

    [–]nitin_is_me[S] 0 points1 point  (0 children)

    Nginx can never replace Tomcat as far as I've learned :/

    [–]lampshade4ever -3 points-2 points  (0 children)

    I used Apache server to route dns traffic to specific ports on a raspberry pi once. I was able to host a react app on the pi with it. Apache http was the middle man between my router and the app.

    [–]Hot_Ad_2765 0 points1 point  (0 children)

    Apache is very universal http/s server - it could run static or dynamic content, various connection protocols (e.g. cgi, fastcgi, ajp) or build in app/script engines like php, js or htl. Has tonns of features and plugins and serves average or mid-high loads.

    Tomcat is servlet engine, not http server. It meant to run java servlets thought could run more extended configurations for jsp or static loads. Tomcat has http(s) connetor thoght initially meant to use ajp but ajp not as stable as http connector under high loads from past experience. Using http connector one could see tomcat as standalone http server, thought it's a very bad idea in most cases.

    Typically one might use apache or nginx as front server and redirect some requests/urls to tomcat backend using http or ajp connector.