IntelliJ Java IDE
The moose likes Tomcat and the fly likes Is it necessary to copy my sites from htdocs to WEBAPPS in Tomcat7 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "Is it necessary to copy my sites from htdocs to WEBAPPS in Tomcat7" Watch "Is it necessary to copy my sites from htdocs to WEBAPPS in Tomcat7" New topic
Author

Is it necessary to copy my sites from htdocs to WEBAPPS in Tomcat7

Inez Newkirk
Greenhorn

Joined: Feb 05, 2012
Posts: 1
Super Noober question...but I'm confused...so this is a question I have.

I have all my virtual hosts in htdocs in Apache2.2

It seems redundant to have to copy them all to another directory (WEBAPPS) ???

Why can't I just leave them where they are and change Tomcat settings to read the files from where they are?

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

Welcome to the JavaRanch, Inez!

You don't have to deploy your J2EE webapps into the TOMCAT_HOME/webapps directory. You can place them anywhere you like, as long as Tomcat has the necessary security permissions to access them. The only real requirement is that the webapp must be in the form of a J2EE-standard WAR.

There's no particular benefit to putting the webapps into htdocs, however, and a certain amount of risk, since you'd have to add extra Apache security to keep the WAR's sensitive internal files from being served up via URLs.

At one time, many of us used to do various tricks so that the images and other static parts of J2EE webapps could be served up by Apache instead of Tomcat, but the performance benefits these days no longer justify the extra complexity or the work needed to do stuff like that.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
 
 
subject: Is it necessary to copy my sites from htdocs to WEBAPPS in Tomcat7
 
Threads others viewed
Possible to execute a target only if files have changed?
Context hell
Problem: Beans with JSP in Tomcat
serve static HTML from app context rather than ROOT
More web apps running in root context
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture