Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat as a production servlet container?

 
Danish Shaukat
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Can Tomcat be used as a production servlet container? My application does not have any web pages. It only serves mobile clients so I was thinking of using Tomcat; I don�t think I need Apache Web Server.

Danish
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are entirely correct. If you don't need special Apache modules, Tomcat works fine as a general web server. The idea that Apache is needed to efficiently serve web pages is totally bogus IMHO.
Bill
 
Lewin Chan
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your situation, Bill is correct, I'm just sticking my oar in to disagree (somewhat) with


The idea that Apache is needed to efficiently serve web pages is totally bogus IMHO




Although the statement is correct, tomcat can efficiently serve up webpages, there are other considerations as to why you want to use apache with mod_jk2 in front of tomcat.

The two most important (imo)
a) Privilege separation, you must be root (unix, on windows any user can) to listen on ports <1024. If your tomcat is incorrectly setup, then any compromise allows super-user rights (I've seen tomcat running as root that allow file uploads to arbitary locations...). Apache does start off as root, but services any request as a non-privileged user which lessens this risk.

b) Running other types of website. If all you're doing is java then fair enough, but I like knocking up the odd website using php or perl...

L
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic