Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Tomcat require Apache httpd?

If I am given a war file that contains a Java web application, and I want to run that war locally, then do I just need Tomcat, or do I need Tomcat and Apache httpd (or any other web server)? Thanks in advance!

like image 890
IAmYourFaja Avatar asked Feb 23 '12 18:02

IAmYourFaja


People also ask

Does Tomcat include Apache HTTP Server?

that since Apache Tomcat is built on Apache HTTP server the configuration of the plugin should be the same.

Is Tomcat and HTTPD same?

Key difference between Tomcat and the Apache HTTP Server the Apache HTTP Server, but the fundamental difference is that Tomcat provides dynamic content by employing Java-based logic, while the Apache web server's primary purpose is to simply serve up static content such as HTML, images, audio and text.

Can you have Tomcat without Apache?

Using Tomcat without Apache Tomcat includes its own web server, so Apache is not technically needed. It is possible to run Tomcat without Apache. This approach is best suited when the Virtual Server is only going to be used to run this application, and nothing else.

How does Apache work with Tomcat?

Tomcat can also be run as an add-on to the Apache HTTP Server (or Microsoft IIS) - as the Java servlet/JSP container. In this combination, Tomcat executes the Java servlets and JSPs, the Apache serves the static HTML pages and performs other server-side functions such as CGI, PHP, SSI, etc.


1 Answers

Tomcat is a web server of its own, so a separate web server like Apache is not required. You probably will want to change Tomcat's port though, since it defaults to 8080 and web sites are usually on port 80.

I think people generally put Apache in front of Tomcat so they can do things like:

  • Have one website have several Tomcat instances behind it.
  • Serve static files from Apache to take load off of Tomcat.
  • Use other Apache features you may need (modules).
  • As @TacticalCoder mentions in the comments, you need to be root to listen on port 80, so some people may be using Apache as an easy way to proxy port 80 to port 8080.

I'd recommend the YAGNI approach and just go with Tomcat until/unless you find a reason you want Apache in front of it.

like image 70
Brendan Long Avatar answered Sep 19 '22 12:09

Brendan Long