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 settings in an production environment?

 
Egil Poma
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm currently about to go live with a webapp I've been working on for some time. I'm using Tomcat 5.5.1.7 as a server, and in that regard I've got some questions.

Should I place my webapp under the ROOT folder in Tomcat?
$CATALINA_HOME/webapps/ROOT/

If not how else can I get the webapp to be displayed at the Tomcat root? I.e http://www.mysite.com/ and not http://www.mysite.com/mywebapp/

Are there any other Tomcat settings that needs to be changed in an production environment?

All advices are much appreciated!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Renaming your webapp to ROOT and placing under the webapps directory is the easiest way to deploy it as the root app on the server.

Tomcat, pretty much ships in production mode.
I usually change thing more for development mode.

You might want to un-deploy any of the apps that ship with Tomcat (unless you're actually using them).

I keep the manager app around but I re-name it.
I also turn off directory browsing (from conf/web.xml) and build my own 404 error page that doesn't show the make and model of the appserver to any would be cracker.
 
Egil Poma
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the informative reply!

How can I prevent Tomcat from displaying stack traces in case of unforeseen errors? Is that also in conf/web.xml perhaps?

Do you have any idea how the performance on Tomcat is compared to other lightweight servers (like i.e. Resin).
[ September 23, 2006: Message edited by: Egil Poma ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can create a custom 500 error page (as well as a custom 404 error page) for you app and map them with the web.xml file under your app's WEB-INF directory.

Example:
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The default servlet, is mapped in the tomcat/conf/web.xml.
This is where you would shut off directory browsing for all of Tomcat.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic