You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by "Roque D. Oliveira" <ro...@puma.mt.att.com> on 2000/02/29 21:57:33 UTC

Re: [How to make Tomcat understand /servlet]

Gabor Liptak wrote:

> Take a look at your:
>
> /usr/local/jakarta/build/tomcat/conf/server.xml
>
> file.

Thanks Gabor.
Have you tried something like it ?

I tried and it didn't work.

If you can get
http://yourhost.company.com/servlet/SnoopServlet
to work then please send me you server.xml and web.xml
so that I can configure my system the same way.

The only thing that works for me (using unmodified configuration files) is

http://myhost.company.com/examples/servlet/SnoopServlet

Given the contents of these two directories :

nodaldev$ ls -l
/export/home1/apache_1.3.11/tomcat/examples/WEB-INF/classes/Snoop*
-rw-rw-r--   1 nodalcap dev         5607 Jan 22 21:39
/export/home1/apache_1.3.11/tomcat/examples/WEB-INF/classes/SnoopServlet.class

-rw-rw-r--   1 nodalcap dev         5425 Jan 22 21:39
/export/home1/apache_1.3.11/tomcat/examples/WEB-INF/classes/SnoopServlet.java

nodaldev$ ls -l
/export/home1/apache_1.3.11/tomcat/webpages/WEB-INF/classes/Snoop*
-rw-r--r--   1 nodalcap dev         5574 Feb 28 15:22
/export/home1/apache_1.3.11/tomcat/webpages/WEB-INF/classes/SnoopServlet.class

-rw-rw-r--   1 nodalcap    dev         5425 Jan 22 21:39
/export/home1/apache_1.3.11/tomcat/webpages/WEB-INF/classes/SnoopServlet.java



and since
http://myhost.company.com/examples/servlet/SnoopServlet
works, I would expect
http://myhost.company.com/servlet/SnoopServlet
to work as well, but is doesn't.
The only difference I can see between the contexts "/" and "/examples"
is that "/examples" has
/export/home1/apache_1.3.11/tomcat/examples/WEB-INF/web.xml
with some real entries in it.

Thanks for any help. Tomcat does have a learning curve.

   Roque



>
>
> "Roque D. Oliveira" <ro...@puma.mt.att.com> wrote:
>
> > ---------------------------------------------
> >       Attachment:
> >       MIME Type: multipart/alternative
> > ---------------------------------------------
> >
> > Hi there!
> > I've been using JRun in the past, to run servlets like
> > http://myhost.company.com/servlet/SimpleServlet
> > or
> > http://myhost.company.com/servlet/com.att.packagename.MyServlet
> >
> > The advantage of this is that I can simply compile a servlet in the
> > servlets
> > directory and it is ready for use (without any configuration change).
> >
> > Today I've installed Apache+Tomcat3.1M1 and I got the demo servlets
> > working (on Solaris 2.7), using a URL like
> > http://myhost.company.com/examples/servlet/HelloWorldExample
> >
> > However, what I'd like is to place the MyHelloWorldExample.class
> > is some appropriate directory and have the URL
> > http://myhost.company.com/servlet/MyHelloWorldExample
> > works.
> >
> > Is there a way to make Tomcat behave pretty much like JRun, as far
> > as dropping servlets in the "servlets" directory and have it run ?
> > I don't won't to have to modify some configuration file every time
> > someone (i.e., our own developer) adds a servlet in our system.
> > I also would prefer not to have to restart the Apache Web server
> > whenever some *.class file (without a package) is dropped in the
> > "servlets" directory.
> >
> > Thanks a lot.
> >
> > --
> > Roque D. Oliveira | e-mail: roque@puma.mt.att.com
> >                   | URL: http://nscp.upenn.edu/roque
> >                   | work phone (732) 420-7380, fax (732) 368-7895
> >                   | home phone (732) 389-2982
> >
> >
>

Re: [How to make Tomcat understand /servlet]

Posted by Shachor Gal <sh...@techunix.technion.ac.il>.
 Are you accessing tomcat trough Apache? In this case you should add into
your tomcat.conf a line that mount /servlet to tomcat...

You should add something like 

ApJServMount /examples /root

For example you should have something like the following in your
$TOMCAT_HOME/conf/httpd.conf

 .
 .
############################## Context mapping - all requests go to tomcat 
ApJServMount /examples /root
ApJServMount /examples /root <--- This is what you should add
############################## Context mapping - you need to "deploy"
 .
 .

	Gal Shachor

On Tue, 29 Feb 2000, Roque D. Oliveira wrote:

> Gabor Liptak wrote:
> 
> > Take a look at your:
> >
> > /usr/local/jakarta/build/tomcat/conf/server.xml
> >
> > file.
> 
> Thanks Gabor.
> Have you tried something like it ?
> 
> I tried and it didn't work.
> 
> If you can get
> http://yourhost.company.com/servlet/SnoopServlet
> to work then please send me you server.xml and web.xml
> so that I can configure my system the same way.
> 
> The only thing that works for me (using unmodified configuration files) is
> 
> http://myhost.company.com/examples/servlet/SnoopServlet
> 
> Given the contents of these two directories :
> 
> nodaldev$ ls -l
> /export/home1/apache_1.3.11/tomcat/examples/WEB-INF/classes/Snoop*
> -rw-rw-r--   1 nodalcap dev         5607 Jan 22 21:39
> /export/home1/apache_1.3.11/tomcat/examples/WEB-INF/classes/SnoopServlet.class
> 
> -rw-rw-r--   1 nodalcap dev         5425 Jan 22 21:39
> /export/home1/apache_1.3.11/tomcat/examples/WEB-INF/classes/SnoopServlet.java
> 
> nodaldev$ ls -l
> /export/home1/apache_1.3.11/tomcat/webpages/WEB-INF/classes/Snoop*
> -rw-r--r--   1 nodalcap dev         5574 Feb 28 15:22
> /export/home1/apache_1.3.11/tomcat/webpages/WEB-INF/classes/SnoopServlet.class
> 
> -rw-rw-r--   1 nodalcap    dev         5425 Jan 22 21:39
> /export/home1/apache_1.3.11/tomcat/webpages/WEB-INF/classes/SnoopServlet.java
> 
> 
> 
> and since
> http://myhost.company.com/examples/servlet/SnoopServlet
> works, I would expect
> http://myhost.company.com/servlet/SnoopServlet
> to work as well, but is doesn't.
> The only difference I can see between the contexts "/" and "/examples"
> is that "/examples" has
> /export/home1/apache_1.3.11/tomcat/examples/WEB-INF/web.xml
> with some real entries in it.
> 
> Thanks for any help. Tomcat does have a learning curve.
> 
>    Roque
> 
> 
> 
> >
> >
> > "Roque D. Oliveira" <ro...@puma.mt.att.com> wrote:
> >
> > > ---------------------------------------------
> > >       Attachment:
> > >       MIME Type: multipart/alternative
> > > ---------------------------------------------
> > >
> > > Hi there!
> > > I've been using JRun in the past, to run servlets like
> > > http://myhost.company.com/servlet/SimpleServlet
> > > or
> > > http://myhost.company.com/servlet/com.att.packagename.MyServlet
> > >
> > > The advantage of this is that I can simply compile a servlet in the
> > > servlets
> > > directory and it is ready for use (without any configuration change).
> > >
> > > Today I've installed Apache+Tomcat3.1M1 and I got the demo servlets
> > > working (on Solaris 2.7), using a URL like
> > > http://myhost.company.com/examples/servlet/HelloWorldExample
> > >
> > > However, what I'd like is to place the MyHelloWorldExample.class
> > > is some appropriate directory and have the URL
> > > http://myhost.company.com/servlet/MyHelloWorldExample
> > > works.
> > >
> > > Is there a way to make Tomcat behave pretty much like JRun, as far
> > > as dropping servlets in the "servlets" directory and have it run ?
> > > I don't won't to have to modify some configuration file every time
> > > someone (i.e., our own developer) adds a servlet in our system.
> > > I also would prefer not to have to restart the Apache Web server
> > > whenever some *.class file (without a package) is dropped in the
> > > "servlets" directory.
> > >
> > > Thanks a lot.
> > >
> > > --
> > > Roque D. Oliveira | e-mail: roque@puma.mt.att.com
> > >                   | URL: http://nscp.upenn.edu/roque
> > >                   | work phone (732) 420-7380, fax (732) 368-7895
> > >                   | home phone (732) 389-2982
> > >
> > >
> >
>