On Sun, 18 Nov 2001, Satish Talim wrote:

> Date: Sun, 18 Nov 2001 08:46:05 +0530
> From: Satish Talim <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> 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:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to