2

I have spent many years in the Microsoft stack, my company was purchased by a Java shop, over the next year while I maintain the old code while the company transitions folks to their system, I will be learning Java, but I need a bit of guidance:

The company uses SpringSource to do MVC based development. I like to have an understanding of the infrastructure of things, help me understand the big picture, as to know how everything is really related, in the end. I have done a lot with Apache over the years (but not with Java) so I am trying to figure out what is needed to get a Spring MVC web application running on Apache?

Is it simply a matter of setting up Apache with Tomcat and then installing the application into Tomcat? Or is there more to it? I have looked at SpringSource's info a bit, but it all assumes a level of knowledge I don't have yet, so I am simply trying to figure out were to start.

Sam Carleton
  • 1,339
  • 7
  • 23
  • 45
  • You really don't need Apache (the webserver) to run. Apache-Tomcat is a standalone server. It's trivial to download and run on virtually any platform that has Java installed. Just download it, unpack it, then look in the /bin directory for startup files. Your program will live under the /webapp directory. Just explore the code, there are some samples already installed. – Bill Oct 17 '12 at 19:58

1 Answers1

2

You configure Tomcat to run your Spring application (by configuring web.xml), and then you configure Tomcat to connect with Apache using mod-jk. You have to set up your apache configurations files to know about mod-jk, and you configure mod-jk.conf (See: http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html)

Atif
  • 942
  • 1
  • 6
  • 19
  • So this is to say that Tomcat is effectively a module that runs under Apache, similar to say the php module. I get that there is a bit more to how Tomcat works, but in the end, it is simply a handler for Apache. FWIW, I have written some Apache modules in C, it sounds like mod-jk is just the handler that passes things from Apache to Tomcat. – Sam Carleton Oct 17 '12 at 19:45
  • I wouldn't think of it as a module, because Tomcat is an HTTP server in it's own right (see http://en.wikipedia.org/wiki/Apache_tomcat). But I would say that mod-jk is a handler that passes from Apache to Tomcat. – Atif Oct 17 '12 at 19:47
  • Ok, interesting, so Tomcat is a Java HTTP server, is it as full featured as Apache? I am wondering why one would want to run Tomcat via mod-jk, is it because they are already using features in Apache which they don't want to redo in Tomcat, or are there simply things that Apache can do that Tomcat cannot? – Sam Carleton Oct 17 '12 at 20:59
  • Reasons to use Apache with Tomcat: http://stackoverflow.com/questions/5122345/why-use-apache-web-server-in-front-of-glassfish-or-tomcat – Atif Oct 17 '12 at 22:45