You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Satish Talim <me...@vsnl.com> on 2001/11/18 04:16:05 UTC

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.

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

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

Amit Lonkar


______________________________________________________________________
Quick Heal Eudora Plugin has scanned email for known viruses, trojans and worms.
www.quickheal.com 


Re: Beginner Questions

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Sun, 18 Nov 2001, Satish Talim wrote:

> Date: Sun, 18 Nov 2001 08:46:05 +0530
> From: Satish Talim <me...@vsnl.com>
> Reply-To: Tomcat Users List <to...@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:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Beginner Questions

Posted by Steve Guo <j2...@yahoo.com>.
1. Apache and Tomcat: no idea
2. aliases are set in web-inf\classes\web.xml (I do
not know how yet), all the servlet class files need to
be in examples\web-inf\classes, or
root\web-inf\classes, you need to modify
conf\server.xml if you have other folders under
webapps\
3.html and jsp files can be in webapps\examples, or
webapps\root, or webapps\yourapp (you need to modify
server.xml for this), or in any subfolders of the
above folder. Frankly it is not very important where
your html or jsp files are since you have to specify
it in url.

Good luck

--- Satish Talim <me...@vsnl.com> wrote:
> 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.
> 
> Which config file needs to be modified, so that:
> - a particular servlet would be loaded as soon as
> Tomcat starts
> - aliases can be set
> 
> In which directory of the Tomcat installation do we
> copy the html and
> applet classes?
> 
> Amit Lonkar
> 
> 
>
______________________________________________________________________
> Quick Heal Eudora Plugin has scanned email for known
> viruses, trojans and worms.
> www.quickheal.com 
> 
> 


__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>