Web Development – Can Apache HTTP Server and Apache Tomcat Server Be Installed on the Same Host?

Apache2javatomcatUbuntuweb-development

I want to practice web programming on my Ubuntu virtual machine. I want to learn both server side web development using Java/J2EE and client side coding (HTML/CSS/JavaScript) .

I heard that we need Apache HTTP for serving static pages and Apache Tomcat for running Java servlets pages.

I want to install both of them on the same machine. Can they both co-exist on the same server? If yes, do I need to take any precaution?

Best Answer

Absolutely, there is no reason they can not run on the same server. By default the web server runs on port 80 and tomcat runs on port 8080 so there are no port conflicts.

I have configured a setup where a static/promo website is served by apache2 and then once the user logs in to the site they will be directed to www.bla.com/app which apache2 directs through to tomcat.

Related Topic