This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat settings in an production environment? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat settings in an production environment?" Watch "Tomcat settings in an production environment?" New topic
Author

Tomcat settings in an production environment?

Egil Poma
Ranch Hand

Joined: Nov 23, 2002
Posts: 40
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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Egil Poma
Ranch Hand

Joined: Nov 23, 2002
Posts: 40
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

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Dec 11, 2004
Posts: 13410

The default servlet, is mapped in the tomcat/conf/web.xml.
This is where you would shut off directory browsing for all of Tomcat.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat settings in an production environment?
 
Similar Threads
Disable dir listing in tomcat
How to deploy to Root of Tomcat for Website?
Tomcat Configuration - context woes?
J2EE Reference Implementation default webapp
Tomcat Configuration - context woes?