2

For someone with so much Java experience, boy do I feel clueless - thanks in advance for your help in my grocking the present (Feb, 2010) JSP environment.

Here's what I am hoping to learn:

  • Do I understand correctly that most people use Apache to "front-end" their Tomcat servers, such that Apache "talks" directly to web clients and "proxies" Tomcat servers?
  • Do I understand correctly that Apache isn't capable of serving JSP directly but requires a server (like Tomcat)?
  • Is there an RPM package for Fedora Core so I don't have to build one myself? Or, does Fedora Core's package installer do a good job on this one from source code? (Some do, some don't!)

While I'm here asking questions; Does Tomcat come with a working example that one can start hacking on as a way to get started quickly? If not, got a good suggestion?

Thanks folks, RT

LapTop006
  • 6,466
  • 19
  • 26
Richard T
  • 1,130
  • 11
  • 26

2 Answers2

1

Yes, most often Tomcat is chained to a webserver such as httpd, communicating via the ajp protocol. httpd is not capable of functioning as a servlet container and compiling JSP's, but Tomcat has poor performance serving static content (such as images) over HTTP. By chaining the two together, you get the best of both worlds. For development, most people don't care too much about Tomcat's static content performance so they go directly to port 8080.

For development on Fedora (if you want to test fronting Tomcat):

  • install the httpd package
  • install the tomcat6 package
  • Edit /etc/httpd/conf.d/proxy_ajp.conf and uncomment/create an appropriate ProxyPass line
  • Drop your .war into /var/lib/tomcat6/webapps/

For production on Fedora:

  • install httpd and tomcat6 packages
  • install mod_jk (you may need to download and compile this from the Tomcat website)
  • configure mod_jk per its documentation

(YMMV on whether Fedora's upgrade cycle is too quick for a production server)

Ophidian
  • 2,158
  • 13
  • 14
  • Note: Recent versions of Fedora do not include a default proxy_ajp.conf file. Instead, you need to make your own conf file in /etc/httpd/conf.d/ and give it a couple of lines like this: ProxyPass /myWebApp/ ajp://localhost:8009/myWebApp/ – Ophidian Nov 13 '11 at 02:17
0

In my experience:

Do I understand correctly that most people use Apache to "front-end" their Tomcat servers, such that Apache "talks" directly to web clients and "proxies" Tomcat servers?

in all environments other than "development", Apache HTTP Server (or possibly some other HTTP load-balancer) is used in front of 1 or more Tomcat servers. For simple testing or development, it should be fine to use the Tomcat http listener directly.

Do I understand correctly that Apache isn't capable of serving JSP directly but requires a server (like Tomcat)?

yes.

Is there an RPM package for Fedora Core so I don't have to build one myself? Or, does Fedora Core's package installer do a good job on this one from source code? (Some do, some don't!)

I'm not a Fedora user, but it appears there are rpm packages for both tomcat5 and tomcat6.

https://admin.fedoraproject.org/pkgdb/packages/index/?searchwords=tomcat*

micah
  • 974
  • 6
  • 11
  • Check jpackage also for RPMs. I use them for CentOS [RHEL], but I believe they have Fedora repos. – alex Feb 12 '10 at 20:23