Some advice regarding mod_jk

2002-07-16 Thread Arshad Mahmood

Hi,

I am developing an using mod_jk, apache 1.3.26 and Tomcat 4.1.7, Redhat 7.2
and have come across an issue with regards to mod_jk.

Now I assumed that the Ajp13Processors under mod_jk acted as pool to process
incoming requests. But I hadn't realised that a processor is created per
socket and then it processes requests on that socket until it is shut down.

This means that even on a lightly loaded machine I can quite easily have 7-8
processors (hence threads, hence processes) depending on which apache child
processes my request.

I would like to modify the code for the Ajp13Connector as follows, and I
wonder what the developers think the consequence would be for reasonble
sized sight (say ~10,000 hits a day).

1. Add a maxIdleProcessors, so that short periods of peak activity don't
leave loads of processors hanging around. I would probably set this value
quite low (probably 2-3).

2. I would modify Ajp13Processor so that it processes a single request and
then recycles itself, rather than waiting for more requests on the same
socket.

I have made these changes and tested them and the behaviour doesn't appear
to be too bad. Peak activity does slow a little bit, but overall usage of
resources (i.e. threads) is much lower.

Any comments?

Regards,
Arshad


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: webapp- who handles static content: Tomcat or Apache (* OFF TOPIC *)

2002-07-11 Thread Arshad Mahmood

Interesting idea to split the static content onto a different server.

Does anyone know how a browser like IE handles this kind of situation, I
know that with HTTP 1.1 the server will leave the connection open for
further requests so that images/styles, etc should be able to go through the
same connection as the original call.

Will IE open a single connection to images.foo.com to retrieve all the
images on a page, or will it open a new connection per image.

What happens with an SSL based page, will I get annoying messages because I
am getting insecure content. I assume I will have to put an SSL certificate
on the image server as well.

Regards.

- Original Message -
From: Pier Fumagalli [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Thursday, July 11, 2002 2:00 AM
Subject: Re: webapp- who handles static content: Tomcat or Apache


 Pier Fumagalli [EMAIL PROTECTED] wrote:

  Cute... You can have some... Visit your local tobacconist.
  Anyhow, you'll see my reasoning when the article gets published. Few
other
  folks having the same problems we do (very high loads + servlets) don't
have
  the same problem as well It's actually way easier and better (in
terms
  of what solutions it allows you to have), to move them away entirely
from
  the web application at all...
 
  People doing GIFs HTMLs and CCS are (in our case), completely separate
from
  JSP/Servlet writers, so I don't even need to give them acceess to the
web
  application files... They can't overwrite or even touch any of the
dynamic
  content...

 Finally the article (and together with it its full response) is up...

 http://www.onjava.com/
 http://www.onjava.com/pub/a/onjava/2002/07/17/web.html

 Page one, at the bottom.

 Pier

 --
 [Perl] combines all the worst aspects of C and Lisp:  a billion of
different
 sublanguages in  one monolithic executable.  It combines the power of C
with
 the readability of PostScript. [Jamie Zawinski - DNA Lounge - San
Francisco]


 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: 5.0 proposal

2002-06-25 Thread Arshad Mahmood


- Original Message -
From: Pier Fumagalli [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Monday, June 24, 2002 9:49 PM
Subject: Re: 5.0 proposal


 [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  On Mon, 24 Jun 2002, Pier Fumagalli wrote:
 
  That's why counts where not right on my side of the border... I don't
recall
  vetoing the proposal... I just complained vehemently that I'd prefer to
see
  4.0 out of the door and stable rather than a 4.1 and a 5.0...
 
  4.0 is out of door - the release happened long ago. So did 4.0.1...
4.0.4.
 
  4.1 is getting close - and it should be more stable and better than
4.0.4.
  And 5.0 should be more stable and better than 4.1 and 3.3.
 
  And 6.0 will probably be better than 5.0.
 
  If you are interested in maintaining and improving 4.0.4 - just
volunteer
  as release manager for the branch, you have my +1 on it.

 I can't be a RM for 4.0.4 because I would simply remove 70% of the code,
and
 kiddies would start crying their butts off because they don't have the
 manager application, or JSP support :)

 But if anyone is interested I'd like to explore the opportunity of a
 Tomcat-HA (high-availability or hard-edition), based on 4.0 without the
 crap in there, and straightening out the request-response model...

+100!

As somebody who also intends to use Tomcat in production (around 10
different sites with a reasonable load, maybe 1/4 of vnunet) this would be
very helpful to me.

You mentioned a couple of specific things you would like to do. Would it be
possible for you elaborate a little more.

Regards,
Arshad



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: 5.0 proposal

2002-06-25 Thread Arshad Mahmood


- Original Message -
From: Pier Fumagalli [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Tuesday, June 25, 2002 3:36 PM
Subject: Re: 5.0 proposal


 Arshad Mahmood [EMAIL PROTECTED] wrote:

  +100!
 
  As somebody who also intends to use Tomcat in production (around 10
  different sites with a reasonable load, maybe 1/4 of vnunet) this would
be
  very helpful to me.
 
  You mentioned a couple of specific things you would like to do. Would it
be
  possible for you elaborate a little more.

 Arshad, you don't count... You work with me! :) :) :) :)

Pier,

This is for my own sites not for vnu (my commitments are very limited to vnu
anyway). I intend to go with Tomcat 4.1 into production in the next couple
of weeks (volume will be insignificant for the first site) so I intend to
spend quite a bit of time trying to iron out bugs/problems and scaling
issues.

As such I have the time to spare to work on the Tomcat enhancements to make
it more scalable/reliable. I am very keen to hear your ideas.

Regards,
Arshad


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: JNDI with a custom factory not working

2002-06-14 Thread Arshad Mahmood


From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 7:11 PM
Subject: Re: JNDI with a custom factory not working


 Arshad Mahmood wrote:
  Hmm, I will investigate further. It seemed to be that ResourceLink in
the
  server.xml
  Context entry was going into a naming context with name
  //Standard/myapp but
  the one which I retrieved from the servlet was called
  //Standard/localhost/webapp. I will
  debug this further.

 The context name is not important for the global context. The
 ResourceLink are actually yet another reference which is bound into the
 webapp naming context, and use a standard JNDI object factory
 (factory.ResourceLinkFactory). The lookup in the actual global context
 then just uses a static reference instead of another lookup.

I had a look at the JNDI example, unfortunately it wasn't totally relevant
as everything
is defined in the web.xml and that has always worked for me.

After a lot more debugging and I am getting even more confused (!!!). I put
some trace
into the init function of my servlet. It's within the init that I do the
JNDI name lookups.
The init gets called twice per servlet. On the first call everything is OK
and my lookup
succeeds. The second time however the lookup fails with a NamingException.

I notice that the first time the init gets called, the context returned
has the bindings I expect.
The second call to init which performs identical processing gets a
NamingContext with
nothing bound (I don't have any entries in the web.xml, had I defined any I
think they would be
the only entries there).

It also looked like the two inits were done by different class loaders, as I
defined some static
members and they were not carried across to the second init.

Can anybody explain why the init may be called twice?

  I will have a look at the JNDI example servlet. I must confess I was
using
  the
  JNDI-Howto in the docs.

 Which may not be totally accurate, and don't talk at all about how it
 actually works.

  The latest version of 4.1 from CVS (although it's a little broken
because
  MBeanUtils
  does't compile, but I am not using that anyway).

 Really ? It does build for me. What's the problem ?
 I do get an exception on shutdown, or when removing a context, though.

Sorry, ant problems. I think the date on my machine may be a bit slow and
hence
when I did an update it didn't recompile everything.

Regards.

 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: JNDI with a custom factory not working

2002-06-14 Thread Arshad Mahmood

Remy,

I will send you the config files shortly (they're on a laptop I don't have
access to at the moment).

My situation does have one unique feature. The servlet which is causing
these issues is in a jar which I
have installed under common/lib. The reason I have done this is because
the servlet acts in a similar
manner to the struts controller servlet, in that it catches all urls and
then dispatches to appropriate
action classes. All action classes are also in this jar so I shouldn't have
any classloader related problems, the web
applications have some config files (accessed via getResourceAsStream) and
JSP files.

That is the only difference I can think of, everything else is normal usage.
As I say I will forward you the files later today or early tomorrow.

Regards,
Arshad

- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Friday, June 14, 2002 4:45 PM
Subject: Re: JNDI with a custom factory not working


  I had a look at the JNDI example, unfortunately it wasn't totally
relevant
  as everything
  is defined in the web.xml and that has always worked for me.
 
  After a lot more debugging and I am getting even more confused (!!!). I
put
  some trace
  into the init function of my servlet. It's within the init that I do
the
  JNDI name lookups.
  The init gets called twice per servlet. On the first call everything
is OK
  and my lookup
  succeeds. The second time however the lookup fails with a
NamingException.
 
  I notice that the first time the init gets called, the context
returned
  has the bindings I expect.
  The second call to init which performs identical processing gets a
  NamingContext with
  nothing bound (I don't have any entries in the web.xml, had I defined
any I
  think they would be
  the only entries there).
 
  It also looked like the two inits were done by different class loaders,
as I
  defined some static
  members and they were not carried across to the second init.
 
  Can anybody explain why the init may be called twice?

 This is a very odd behavior, and I will try to reproduce it. From what
 I've seen in your config, you are using a load-on-startup servlet. Do
 you have anything else which isn't the default ?

 Remy


 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: JNDI with a custom factory not working

2002-06-13 Thread Arshad Mahmood


- Original Message -
From: Ian Darwin [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]; Arshad
Mahmood [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 1:48 AM
Subject: Re: JNDI with a custom factory not working


 On June 12, 2002 07:45 am, Arshad Mahmood wrote:
  I am having a problem trying to use a custom factory with JNDI. I get an
  exception froom org.apache.naming.factory.ResourceFactory. I have added
  debug and it appears that my factory parameter is not being picked up
  from the server.xml.
 
  Can somebody familiar with the naming code point me to the classes I
need
  to look at to trace this problem. Alternatively, if somebody can confirm
  that the JNDI-Howto example for a custom beanFactory works correctly in
4.1
  (I have tried it and it doesn't) then I will look at my configuration
  again.

 Doesn't work for me either. Inserting a listBindings() call for
java:comp/env/bean
 reveals nothing bound there.

I have traced the problem a little further and I think I know what the
problem is but I haven't got a clue how to fix it.

Basically, it appears that a different NamingContext is created per
thread/class loader. Let's assume that you have a tomcat instance called
Standalone, a virtual host localhost and a context myapp.

If you define any JNDI resources in the server.xml, then they appear to be
put into a naming context call //Standalone/myapp. Your resource
definitions in the web.xml go into the //Standalone/localhost/myapp
context.

If you attempt to read the resources from your servlet then the
//Standalone/localhost/myapp context is used, this is ok for jdbc, etc
because the factory is hardwired into the naming code. But if you have
defined a custom factory then no definition exists in this context for that
(because it's been put into the //Standalone/myapp context). I believe
this also goes for any parameters that you have defined.

The fix would appear to be for Tomcat to put the resources under the virtual
in the first place for those defined in the server.xml. There is still an
issue though for the global resources as I am not sure you can link to
them because they are under a different naming context.

This is an initial investigation so my analysis may be FLAWED.

Remy, does this explanation of how the naming contexts are defined/used make
sense ?

Regards.



 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: JNDI with a custom factory not working

2002-06-13 Thread Arshad Mahmood


- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 5:33 PM
Subject: Re: JNDI with a custom factory not working


 Arshad Mahmood wrote:
  - Original Message -
  From: Ian Darwin [EMAIL PROTECTED]
  To: Tomcat Developers List [EMAIL PROTECTED]; Arshad
  Mahmood [EMAIL PROTECTED]
  Sent: Thursday, June 13, 2002 1:48 AM
  Subject: Re: JNDI with a custom factory not working
 
 
 
 On June 12, 2002 07:45 am, Arshad Mahmood wrote:
 
 I am having a problem trying to use a custom factory with JNDI. I get
an
 exception froom org.apache.naming.factory.ResourceFactory. I have added
 debug and it appears that my factory parameter is not being picked up
 from the server.xml.
 
 Can somebody familiar with the naming code point me to the classes I
 
  need
 
 to look at to trace this problem. Alternatively, if somebody can
confirm
 that the JNDI-Howto example for a custom beanFactory works correctly in
 
  4.1
 
 (I have tried it and it doesn't) then I will look at my configuration
 again.
 
 Doesn't work for me either. Inserting a listBindings() call for
 
  java:comp/env/bean
 
 reveals nothing bound there.
 
 
  I have traced the problem a little further and I think I know what the
  problem is but I haven't got a clue how to fix it.
 
  Basically, it appears that a different NamingContext is created per
  thread/class loader. Let's assume that you have a tomcat instance called
  Standalone, a virtual host localhost and a context myapp.
 
  If you define any JNDI resources in the server.xml, then they appear to
be
  put into a naming context call //Standalone/myapp. Your resource
  definitions in the web.xml go into the //Standalone/localhost/myapp
  context.
 
  If you attempt to read the resources from your servlet then the
  //Standalone/localhost/myapp context is used, this is ok for jdbc, etc
  because the factory is hardwired into the naming code. But if you have
  defined a custom factory then no definition exists in this context for
that
  (because it's been put into the //Standalone/myapp context). I believe
  this also goes for any parameters that you have defined.
 
  The fix would appear to be for Tomcat to put the resources under the
virtual
  in the first place for those defined in the server.xml. There is still
an
  issue though for the global resources as I am not sure you can link to
  them because they are under a different naming context.
 
  This is an initial investigation so my analysis may be FLAWED.
 
  Remy, does this explanation of how the naming contexts are defined/used
make
  sense ?

 I'm not sure I understand very well, so I'll assume it's a problem with
 the links.

 The global resources defined in server.xml are not accessible by default
 in the web applications (because you may want to restrict some to
 specific webapps, etc). So you have to link them using a ResourceLink
 element. You can also define the resource links in the default context
 so that all your contexts in your host or engine will have the link,
 instead of having to define it in each one.
 The admin webapp will have full support for this shortly (I reckon that
 configuring this is *hard* at the moment).

 Remy

Remy,

Thanks for you response. I didn't make myself very clear, I'll try again.

The Problem
=

In the server.xml have defined a global resourcce under the name
rohas/filecache.
The resource params defines a factory along with other attributes.
In my context I have defined a ResourceLink that maps to the
global name (I have given them both the same name, I assume that
doesn't make a difference).

In the web.xml for my application I have defined a resource-ref that
points to this resource.

When I try and access the resource via an InitialContext in the init
function of my servlet,
I get a NamingException from
org.apache.naming.factory.ResourceFactory.getObjectInstance.

To look into the problem I put some debug into the
org.apache.naming.NamingContext class in the
lookup method.

I noticed that when this class was called a few times, the name member
varied between //Standalone/myapp amd
//Standalone/localhost/myapp, etc.

I was a bit surprised because I thought when I asked java:comp/env I would
always get the same NamingContext and
not different ones.

I then traced the code through
org.apache.naming.java.javaURLContextFactory, which in turn uses
org.apache.naming.SelectorContext.

The SelectorConext class uses getBoundContext to retrieve the appropriate
NamingContext to which it delegated
the lookup/bind/unbind, etc.

The getBoundContext then uses ContextBindings.getContext to get the context
(if doesn't exist then it creates a new one).
*** IMPORTANT *** The member variable initialContext is overriden inside the
if of this function (is this intentional).

ContextBindings appears to return a NamingContext based on the class loader
currenty in used. Hence the multiple contexts and why the name I am

Re: JNDI with a custom factory not working

2002-06-13 Thread Arshad Mahmood

- Original Message -
From: Remy Maucherat [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Thursday, June 13, 2002 6:51 PM
Subject: Re: JNDI with a custom factory not working


 Arshad Mahmood wrote:
  I do get the same context when I ask for it in my web application. The
  problem
  is that I can see from the debug that my Resource definitions in the
  global naming resources appear to be in one context,

 Indeed, the global resources go into a separate context.

  the ResourceLink I
  have defined in
  the Context for my webapp go into another,  but the one I am given
when I
  use
  a lookup for java:comp/env in my servlet init function appears to have
  only those
  defined in the web.xml.

 Both of these should go in the same context or its subcontexts (for
 example, if your resource is jdbc/db, then there will be a jdbc
 context child of env, which will contain a db entry).
 Did you try to use the JNDI servlet in the servlet examples to see what
 was going on ? I believe it is quite useful for this.

Hmm, I will investigate further. It seemed to be that ResourceLink in the
server.xml
Context entry was going into a naming context with name
//Standard/myapp but
the one which I retrieved from the servlet was called
//Standard/localhost/webapp. I will
debug this further.

I will have a look at the JNDI example servlet. I must confess I was using
the
JNDI-Howto in the docs.

  I realise you are incredibly busy, but if you have naming working, can
you
  please try and
  generate one with a custom factory. As I have followed the instructions
in
  JNDI-Howto,
  but the only things in the bindings when I retrieve the
java:comp/env
  are the ones I have
  defined in the web.xml, and these don't allow you to specify a factory.

 If the definitions from web.xml override the ones from server.xml,
 nothing will work (ie, even if you use the default DataSource factory,
 the reference will be missing some attributes).
 You can try removing the definition in web.xml to see what happens.

 BTW, which version of Tomcat are you using ?

The latest version of 4.1 from CVS (although it's a little broken because
MBeanUtils
does't compile, but I am not using that anyway).

Thanks for your help. I will try and pin the problem down a bit more.

Regards.

 Remy


 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




JNDI with a custom factory not working

2002-06-12 Thread Arshad Mahmood

Hi,

I am having a problem trying to use a custom factory with JNDI. I get an
exception froom org.apache.naming.factory.ResourceFactory. I have added
debug and it appears that my factory parameter is not being picked up from
the server.xml.

Can somebody familiar with the naming code point me to the classes I need to
look at to trace this problem. Alternatively, if somebody can confirm that
the JNDI-Howto example for a custom beanFactory works correctly in 4.1 (I
have tried it and it doesn't) then I will look at my configuration again.

Regards,
Arshad


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm JNDIRealm.java

2002-06-11 Thread Arshad Mahmood

I don't anything about this fix, but shouldn't you include a trim() before
checking for a blank username/credential also?

Regards.
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 11, 2002 4:32 PM
Subject: cvs commit:
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm
JNDIRealm.java


 remm2002/06/11 08:32:28

   Modified:catalina/src/share/org/apache/catalina/realm JNDIRealm.java
   Log:
   - Fix a security problem with the JNDI realm, where blank passwords
could be
 used to authenticate.
   - As a result, blank passwords are not allowed with the JNDI realm
anymore.
   - Bugzilla 9700.
   - The fix will be in 4.1.5.
   - Patch submitted by jemiller at uchicago.edu
 and John Holman mailto:j.g.holman at qmul.ac.uk

   Revision  ChangesPath
   1.8   +6 -5
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm/JNDIRealm.ja
va

   Index: JNDIRealm.java
   ===
   RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm/JN
DIRealm.java,v
   retrieving revision 1.7
   retrieving revision 1.8
   diff -u -r1.7 -r1.8
   --- JNDIRealm.java 9 Jun 2002 02:19:43 - 1.7
   +++ JNDIRealm.java 11 Jun 2002 15:32:28 - 1.8
   @@ -716,7 +716,8 @@
   String credentials)
throws NamingException {

   -if (username == null || credentials == null)
   +if (username == null || username.equals()
   +|| credentials == null || credentials.equals())
return (null);

// Retrieve user information




 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: How can I redirect only JSP pages to Tomcat?

2002-05-17 Thread Arshad Mahmood

Which connector are you using, with mod_jk you can simply issue a
JkMount /mysite/* ajp13 to forward all requests under
/mysite to Tomcat.

Regards.

- Original Message -
From: Luca Ventura [EMAIL PROTECTED]
To: tomcat-user [EMAIL PROTECTED]; tomcat-dev
[EMAIL PROTECTED]
Sent: Friday, May 17, 2002 7:44 AM
Subject: How can I redirect only JSP pages to Tomcat?


 Hello everybody!

 I have installed Tomcat 4 as servlet/JSP container fo IIS 5 but  I haven't
 understood
 how to redirect to Tomcat only requests for JSP pages or servlets. I have
 found only the way
 to redirect entire sites  but I would like to redirect only
 JSP pages and servlets and not html pages for example.

 Is it possible to redirect only a specified directory of a Web site? For
 example
 if I defined a site in /mysite folder is it possible to redirect to Tomcat
 only the
 request for the code present in /mysite/jsp ???

 Thanks everybody in advance!

 Luca


 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: How can I redirect only JSP pages to Tomcat?

2002-05-17 Thread Arshad Mahmood

Ooops, should have read more carefully. The Tomcat-IIS howto contains the
appropriate instructions on how to setup IIS to redirect a url to Tomcat.
You need to look for this document under Tomcat 3.2.4 (should still be
applicable to Tomcat 4 as you are using ajp12)..

Regards.

- Original Message -
From: Arshad Mahmood [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]; tomcat-user
[EMAIL PROTECTED]
Sent: Friday, May 17, 2002 10:30 AM
Subject: Re: How can I redirect only JSP pages to Tomcat?


 Which connector are you using, with mod_jk you can simply issue a
 JkMount /mysite/* ajp13 to forward all requests under
 /mysite to Tomcat.

 Regards.

 - Original Message -
 From: Luca Ventura [EMAIL PROTECTED]
 To: tomcat-user [EMAIL PROTECTED]; tomcat-dev
 [EMAIL PROTECTED]
 Sent: Friday, May 17, 2002 7:44 AM
 Subject: How can I redirect only JSP pages to Tomcat?


  Hello everybody!
 
  I have installed Tomcat 4 as servlet/JSP container fo IIS 5 but  I
haven't
  understood
  how to redirect to Tomcat only requests for JSP pages or servlets. I
have
  found only the way
  to redirect entire sites  but I would like to redirect only
  JSP pages and servlets and not html pages for example.
 
  Is it possible to redirect only a specified directory of a Web site? For
  example
  if I defined a site in /mysite folder is it possible to redirect to
Tomcat
  only the
  request for the code present in /mysite/jsp ???
 
  Thanks everybody in advance!
 
  Luca
 
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Problem with url session encoding - Tomcat 4.0.4 b2

2002-04-30 Thread Arshad Mahmood

Hi,

I am writing an e-commerce application using tomcat and have come across a
minor issue with url session encoding. The problem is that if a valid
session id is available on the url then tomcat does not use cookies.

Here is my scenario :-

1. I have tomcat configured to use cookies for session id's if possible.
2. An access to the index.html of my site redirects via url encoding to
home/index.html. This causes the session to be sent both via the url and a
cookie, from here on tomcat knows it can use cookies and doesn't bother
adding the session id to the url when I use encodeURL.

3. If I close the browser and open a new browser and use the url history box
then the url that appears is home/index.html with the added url encoding
(because I redirected from the original index.html).
4. Because this url has a valid session id, tomcat now defaults to using the
url endoing method and doesn't even try to use a cookie for this browser
session.

My problem is that I want tomcat to always try and use a cookie even when
using url encoding (unless it is already using a cookie). I realise it is a
pain for those users that have setup prompts before accepting cookies, but
in my case I would prefer an inconvenience to a small number of users and
not the vast variety of users seeing the session id on all their url's.

My own prefernce would be to overload the cookies parameter so that a value
of force would cause this behaviour and leave the existing semantics for
the already defined values.

Regards,
Arshad


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Tomcat 4 service

2001-03-27 Thread Arshad Mahmood

I believe that the only change you require is to create a suitable
wrapper.properties, you should be able to use the existing
jk_nt_service.exe.

I had this working a few weeks ago but I tried my existing configuration on
the latest build and the service fails to startup. I am currently in the
process of trying to figure out what the issue is.

Regards,
Arshad

- Original Message -
From: "Kevin Jones" [EMAIL PROTECTED]
To: "Tomcat-Dev" [EMAIL PROTECTED]
Sent: Wednesday, March 28, 2001 7:52 AM
Subject: FW: Tomcat 4 service


 I posted this to tomcat-user with no response.

 Does such a beast exist? If not I'll volunteer to port the Tomcat 3.2
code.
 Just point me at it!

 Kevin Jones
 DevelopMentor
 www.develop.com

  -Original Message-
  From: Kevin Jones [mailto:[EMAIL PROTECTED]]
  Sent: 27 March 2001 22:44
  To: Tomcat-User
  Subject: Tomcat 4 service
 
 
  I have tomcat 3.2 running as a service under W2K. I seem to remember
that
  this wasn't available for Tomcat 4 (running it as a service that
  is), or is
  the code now available?
 
  Thanks,
 
  Kevin Jones
  DevelopMentor
  www.develop.com





Re: Proposal for implementation of lookup of localized web-resources

2001-03-16 Thread Arshad Mahmood


- Original Message -
From: "Arieh Markel" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, March 16, 2001 3:00 PM
Subject: Re: Proposal for implementation of lookup of localized
web-resources



  To: [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED], [EMAIL PROTECTED]
  Subject: Re: Proposal for implementation of lookup of localized
 web-resources
  From: [EMAIL PROTECTED] (Kazuhiro Kazama)
  X-Dispatcher: imput version 2228(IM140)
 
  Arieh,
 
  Basically lookup of localized resources is welcomed. As I have
  evaluated your localization codes to 3.2, I write comments:
 
  1, Your file-based naming scheme isn't compatible with apache
  MultiView function that David Rees and Takashi Okamoto says.
 
  Now apache naming scheme becomes popular in Japan. But almost nobody
  uses your naming scheme. It is unhappy that we must change all
  filename that is written by apache naming scheme.
 
  At the least, compatible option is needed.

 I don't think that my intent was to be compatible with Apache.

 My first goal was to be compatible with Java localization.

 The context in which I am using Jakarta is as an 'embedded' servlet
 container inside of a Java application.

This is something which I am currently in need of for a project. The only
reason I can see support for the Apache model is that the new mod_webapp
connector I believe is structured so that static html is served by Apache
and the dynamic side by tomcat, under these circumstances it would be better
if they were both the same.

Having said that, my own preference for my current project is for a DocBase
approach.

 --
  Arieh Markel Sun Microsystems Inc.
  Network Storage500 Eldorado Blvd. MS UBRM11-194
  e-mail: [EMAIL PROTECTED]   Broomfield, CO 80021
  Pray for snow  Phone: (303) 272-8547 x78547
  (e-mail me with subject SEND PUBLIC KEY to get public key)

Regards,
Arshad




catalina classpath question

2001-01-25 Thread Arshad Mahmood



Hi,

I am trying to setup an application under Catalina 
and can't seem to find a way to add another directory to the CLASSPATH for a web 
application. Is there a way to add a directory like "WEB-INF/resources" to the 
CLASSPATH.

I can solve my problem by adding my files below 
"WEB-INF/classes", but I would prefer not to do that.

Regards,
Arshad


Re: catalina classpath question

2001-01-25 Thread Arshad Mahmood



Thanks Craig, that clears up the issue. 


Regards,
Arshad

  - Original Message - 
  From: 
  Craig R. McClanahan 
  To: [EMAIL PROTECTED] 
  
  Sent: Thursday, January 25, 2001 11:42 
  PM
  Subject: Re: catalina classpath 
  question
  Arshad Mahmood wrote: 
  

Hi,I am trying to setup an application under Catalina and can't seem to 
find a way to add another directory to the CLASSPATH for a web application. 
Is there a way to add a directory like "WEB-INF/resources" to the 
CLASSPATH.I can solve my 
problem by adding my files below "WEB-INF/classes", but I would prefer not 
to do that.Regards,ArshadCatalina follows the servlet spec 
  requirements, which say that unpacked classes under WEB-INF/classes, or JAR 
  files under WEB-INF/lib, are the only places a webapp can provide classes (or 
  resources loaded via Class.getResource() type calls). So, even if we 
  modified it to be non-spec-compliant, your app would still not run in any 
  other container. 
  Craig  


Re: Catalina + Apache

2001-01-20 Thread Arshad Mahmood

Can you recommend any documents for trying to understand the architecture of
mod_webapp and catalina connectors, or is the source the best place.

I am fairly keen in getting involved in this area, so any indication of
where to get started would be gratefully received. I am a fairly good 'C'
and Java programmer.

Regards,
Arshad

- Original Message -
From: "Craig R. McClanahan" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 19, 2001 8:21 PM
Subject: Re: Catalina + Apache


 Nick Bauman wrote:

  Craig,
 
  These design goals are AWESOME. It makes much more sense to do this
  way. However, I _did_ do this as you mentioned: I have *.jsp and *.j
  mapped to specific servlets in my ROOT/WEB-INF/web.xml and all I got was
  the output of index.jsp as something Netscape had to download.
telnetting
  to the webserver port revealed that the index.jsp was being served by
  Apache, not Catalina.
 
  I'll mess around with it this weekend and see if I can get it to work
"as
  advertised" and report back my results, but I have a couple of guys
  waiting on a servlet container that works with our *.j framework to test
  today, so I'm temporarily falling back to 3.2.
 
  I'm really happy that this approach is being followed as it's much more
  (ultimately) intuitive than the way it's done in 3.2 because it's
simpler.
 

 I'm glad you like it, although you should really thank Pier Fumagalli --
it's his vision
 (which I agree with) and effort that has really been working towards this.

 As I mentioned several times, what I was describing is the *theory* of
what mod_webapp is
 supposed to accomplish.  To ensure that it becomes *reality*, please feel
free to volunteer
 your time (as you did above) in testing the current connector, identifying
places where
 there are bugs, posting patches, etc.

 I know Pier has a bunch of bugfixes currently in his local CVS tree, so
hopefully we will be
 much closer to the "reality" end of the scale soon.

 
  Thanks again,
 
  -Nick
 

 Craig


 
  On Fri, 19 Jan 2001, Craig R. McClanahan wrote:
 
   Nick Bauman wrote:
  
On Fri, 19 Jan 2001, Craig R. McClanahan wrote:
   
 Nick Bauman wrote:

  Uhhh, I just realized something
 
  With TC 3x, you could map an extension from Apache to the
servlet engine
  with an AddHandler directive. I see nothing like this for TC4.
Can someone
  enlighten me?
 

 The design goals for mod_webapp say that it should respect web.xml
mappings --
 in other words, if you added a servlet-mapping entry for "*.foo"
to a
 particular servlet, then that is what would happen at runtime.
   
I totally do not understand this! I'm dense or something: How does
Apache
/ DSO* know about something in the web.xml?
   
  
   This is the key architectural difference between mod_webapp and the
current generation
   of connectors.  When mod_webapp establishes its initial connection
from Apache to
   Tomcat, the configuration information (extracted from the property
getters of the
   internal Context object) is sent back to the connector in order to
configure
   everything about this particular webapp.
  
   From the sysadmin perspective, this means we can forget all about
having to configure
   things twice (once in httpd.conf and once in web.xml).  It's also a
requirement of the
   2.3 spec -- if we create a "servlet container" using Apache+Tomcat
together, it (the
   combination) must still obey all the servlet spec requirements,
including respecting
   things in web.xml.
  
   
If I grok you, this still relies on having /foo mapped to the
servlet
container in Apache. I'm in a situation where Apache's DocumentRoot
_is
the same as_ the top level of the WAR, but I want Apache to serve
the
*.html and *.gif and *.jpg and *.png and I want Tomcat to only do
the *jsp
and a special mapping (in this case *.j).
   
  
   Then what you'd want is to configure the ROOT webapp to have a context
base equal to
   your Apache document root.  If you want things mapped to servlets,
just do them with
   servlet-mapping entries *exactly* like you would for Tomcat
stand-alone.  As I
   mentioned earlier, the connector takes over the "default servlet"
mapping, so it will
   handle everything that is *not* explicitly mapped to a servlet (i.e.
all the static
   files).
  
   Again, this is all the design goals -- I have not tested the current
implementation to
   see if it achieves these goals yet.  In particular, I recall seeing
bug reports about
   mapping the ROOT context.
  
   
 The primary difference between Tomcat 4.0 stand alone and Tomcat
4.0 behind
 Apache is the mapping for the "default" servlet.  In the
stand-alone case, this
 is mapped to the Tomcat servlet that serves static resources.  In
the connected
 case, they would be served by Apache.
   
I don't see how this works in my case. I'm being dense, I think.
   
  
   If you were running Tomcat stand-alone, you would 

Query regrading mod_webapp

2001-01-16 Thread Arshad Mahmood

I have been trying to configure mod_webapp (without much luck) and I notice
that wa_host will not allow applications to be mounted which have common
heads (i.e. '/' and '/examples/'). Tomcat itself doesn't seem to have any
problem with such a setup.

Is this a genuine design decision?

Regards,
Arshad



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Any solution for bug#696?

2001-01-13 Thread Arshad Mahmood

Hi,

I have downloaded the latest tomcat-4.0-b1 binaries and have been trying to
get it working on with Apache 1.3.12.

1. Apache 1.3.12 complains that the mod_webapp.so in the linux directory was
not compiled with -DEAPI and may crash. I rebuilt it from the source and
this error went away.

2. When I try and use catalina via apache I get a error (-2) cannot connect
to localhost (127.0.0.1). The ServerName in my httpd.conf is 'localhost' and
as far as I can tell no changes need to be made to the server.xml.

3. Does anybody know how the ROOT context can be served via apache. Apache
keeps complaining that another web application has already been registered
for '/'.

Regards,
Arshad


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]