tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Beginner Questions
Date Sun, 18 Nov 2001 04:07:19 GMT


On Sun, 18 Nov 2001, Satish Talim wrote:

> Date: Sun, 18 Nov 2001 08:46:05 +0530
> From: Satish Talim <medunet@vsnl.com>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: Beginner Questions
>
> Hi,
>
> I have just installed Tomcat 4.0.1 and am trying to figure out:
> - any particular reason to have both Apache and Tomcat installed; or
> whether Tomcat by itself is enough.

You would install Apache+Tomcat if you needed something extra that Apache
provided which Tomcat didn't.  There's lots of things Apache can do
(principally through the inclusion of included or third-party Apache
modules) that Tomcat cannot.  If you need them, install both.

Many people are under the impression that Apache is significantly faster
at serving static content that Tomcat.  While this was definitely true in
early JVMs (and early versions of Tomcat), the gap is *substantially*
narrower now, to the point at which it is totally irrelevant for many web
applications.

If you have lots and lots of static content, and most of your requests are
for this, by all means use Apache and Tomcat together.  On the other hand,
if your app is primarily dynamic with a few images for the buttons,
***please*** spare yourself the effort of configuring Apache and Tomcat to
work together, and just run Tomcat stand alone -- it's plenty fast enough
for the vast majority of people who are using it.  (And, if it's not, you
can always switch later -- it's nice to have that kind of choice.)

>
> Which config file needs to be modified, so that:
> - a particular servlet would be loaded as soon as Tomcat starts

You should review the Servlet Specification (which Tomcat and all other
servlet containers implement).  You can download it from:

  http://java.sun.com/products/servlet/download.html

In particular, you will find that the <load-on-startup> element in the web
application deployment descriptor (web.xml) does this.  You will also find
that, in Servlet 2.3 (supported by Tomcat 4.0), there is a feature called
application event listeners that are notified when a web application is
being started or stopped.  This is a better place to do things like set up
database connection pools and other shared application resources.

> - aliases can be set
>

Aliases for servlets?  See the <servlet-mapping> element in web.xml.

> In which directory of the Tomcat installation do we copy the html and
> applet classes?
>

I suggest you also read the Application Developer's Guide included with
Tomcat.  The Tomcat 4 version is also online at:

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/

>From the point of view of the server, applet classes and JAR files are
just static content.  Therefore, they should be placed in the same
directory as your static HTML pages, ***not*** under /WEB-INF.

> Amit Lonkar
>

Craig McClanahan


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message