Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

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*

share|improve this answer
    
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

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)

share|improve this answer
    
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 2:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.