Re: Having tomcat as an OSGi bundle

2009-04-27 Thread Saminda Wijeratne
thanx Mark I will look at the dm server. I'm pressuming that the mail thread
[1] is infact a dead end for the tomcat osgi bundle.

Thank you,
Saminda

[1] http://marc.info/?l=tomcat-dev&m=120966097004938&w=2

On Mon, Apr 27, 2009 at 5:59 PM, Mark Thomas  wrote:

> Saminda Wijeratne wrote:
> > I saw a mail thread talking abt osgifying tomcat. but couldn't really
> > determine at the end whether it worked out or not.
>
> Nothing happened in the Tomcat project.
>
> Try Googling for "dm Server"
> (full disclosure: I work for Spring)
>
> Mark
>
> >
> > On Mon, Apr 27, 2009 at 5:25 PM, Pid  wrote:
> >
> >> Saminda Wijeratne wrote:
> >>> Hi,
> >>>
> >>> Is there an OSGI bundle available embedding tomcat? I want to start
> >> tomcat
> >>> inside an OSGI environment.
> >> Not that I've heard of.
> >>
> >> p
> >>
> >>
> >>> Thank you,
> >>> Saminda
> >>>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>
> >>
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: Scheduling tasks in Tomcat

2009-04-27 Thread Karthik Nanjangude
Hi

I would suggest u to use the Listener tag instead of Load on startup



  org.quartz.ee.servlet.QuartzInitializerListener



As per "Quartz Enterprise Job Scheduler API (1.6.2)"

org.quartz.ee.servlet.QuartzInitializerServlet  is deprecated




with regards
Karthik


-Original Message-
From: Aden Jones [mailto:adenjo...@gmail.com]
Sent: Tuesday, April 28, 2009 9:35 AM
To: users@tomcat.apache.org
Subject: RE: Scheduling tasks in Tomcat




mgainty wrote:
>
>
> javac .\org\quartz\ee\servlet\QuartzInitializerServlet.java
> place .\org\quartz\ee\servlet\QuartzInitializerServlet.class to
> WEB-INF/classes
>
> Okay so QuatzInitializerServlet.java is the class that I create for
> scheduling the events.
>
> your web.xml will need to associate the Servlet class with url-pattern as
> in this configuration:
>  
>  Servlet
>
> org.quartz.ee.servlet.QuartzInitializerServlet
>
>  It would be okay I suppose if I use my existing structure and reference
> com.timekeeper.util.QuartzInitializerServlet
> ?
>
>
>   1
>  
>  
>   Servlet
>   *
>
> Why would I need to add a url pattern if it only needs to be run on
> startup?
>  
>
> you will also need an startup display page index.jsp and configure
> index.jsp as welcome-file e.g.
>
>   
> index.jsp
>   
>
> HTH
> Martin
> __
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung /
> Note de déni et de confidentialité
> This message is confidential. If you should not be the intended receiver,
> then we ask politely to report. Each unauthorized forwarding or
> manufacturing of a copy is inadmissible. This message serves only for the
> exchange of information and has no legal binding effect. Due to the easy
> manipulation of emails we cannot take responsibility over the the
> contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> copie de ceci est interdite. Ce message sert à l'information seulement et
> n'aura pas n'importe quel effet légalement obligatoire. Étant donné que
> les email peuvent facilement être sujets à la manipulation, nous ne
> pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>
>
>> Date: Mon, 27 Apr 2009 17:52:16 -0700
>> From: adenjo...@gmail.com
>> To: users@tomcat.apache.org
>> Subject: Re: Scheduling tasks in Tomcat
>>
>>
>> I will probably use quartz to schedule the actual task and add it to my
>> webapp as my teacher would prefer that the servlet contains everything.
>>
>> What I don't understand is how or if (after I create my class that
>> contains
>> the scheduling code) Tomcat actually runs the code. Do I need to add
>> something to web.xml to tell Tomcat to run it. Does Tomcat run every
>> class
>> in the servlet automatically.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Scheduling-tasks-in-Tomcat-tp23251939p23268143.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>
> _
> Rediscover Hotmail®: Now available on your iPhone or BlackBerry
> http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile2_042009
>

--
View this message in context: 
http://www.nabble.com/Scheduling-tasks-in-Tomcat-tp23251939p23269777.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Scheduling tasks in Tomcat

2009-04-27 Thread Aden Jones



mgainty wrote:
> 
> 
> javac .\org\quartz\ee\servlet\QuartzInitializerServlet.java
> place .\org\quartz\ee\servlet\QuartzInitializerServlet.class to
> WEB-INF/classes
> 
> Okay so QuatzInitializerServlet.java is the class that I create for
> scheduling the events. 
> 
> your web.xml will need to associate the Servlet class with url-pattern as
> in this configuration:
> 
>  Servlet  
>  
> org.quartz.ee.servlet.QuartzInitializerServlet 
> 
>  It would be okay I suppose if I use my existing structure and reference
> com.timekeeper.util.QuartzInitializerServlet
> ?
> 
> 
>   1  
>
>
>   Servlet  
>   *  
> 
> Why would I need to add a url pattern if it only needs to be run on
> startup?
>   
> 
> you will also need an startup display page index.jsp and configure
> index.jsp as welcome-file e.g.
> 
>
> index.jsp 
>
> 
> HTH
> Martin 
> __ 
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung /
> Note de déni et de confidentialité 
> This message is confidential. If you should not be the intended receiver,
> then we ask politely to report. Each unauthorized forwarding or
> manufacturing of a copy is inadmissible. This message serves only for the
> exchange of information and has no legal binding effect. Due to the easy
> manipulation of emails we cannot take responsibility over the the
> contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> copie de ceci est interdite. Ce message sert à l'information seulement et
> n'aura pas n'importe quel effet légalement obligatoire. Étant donné que
> les email peuvent facilement être sujets à la manipulation, nous ne
> pouvons accepter aucune responsabilité pour le contenu fourni.
> 
> 
> 
> 
> 
> 
>> Date: Mon, 27 Apr 2009 17:52:16 -0700
>> From: adenjo...@gmail.com
>> To: users@tomcat.apache.org
>> Subject: Re: Scheduling tasks in Tomcat
>> 
>> 
>> I will probably use quartz to schedule the actual task and add it to my
>> webapp as my teacher would prefer that the servlet contains everything.
>> 
>> What I don't understand is how or if (after I create my class that
>> contains
>> the scheduling code) Tomcat actually runs the code. Do I need to add
>> something to web.xml to tell Tomcat to run it. Does Tomcat run every
>> class
>> in the servlet automatically.
>> 
>> 
>> 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Scheduling-tasks-in-Tomcat-tp23251939p23268143.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>> 
> 
> _
> Rediscover Hotmail®: Now available on your iPhone or BlackBerry
> http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile2_042009
> 

-- 
View this message in context: 
http://www.nabble.com/Scheduling-tasks-in-Tomcat-tp23251939p23269777.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How do I host multiple websites with Apache2 and Tomcat Cluster ??

2009-04-27 Thread nohacks

Hi Chris,

Thanks for your very detailed response!! 

I will try that out Tues Morning and get back to you with any questions. 

I do have one. 

Currently I have my app deployed as ROOT in Tomcat. How do I change this for
multiple apps? I am new to Apache and Tomcat deployments...

For example I would like to have 

www.example.com load that is why I deployed as ROOT.war. 
www.additional.com
www.extra.com

I Read several articles about starting off Tomcat war files with
www.example.com and not extra path stuff.

Thanks
Phil




Christopher Schultz-2 wrote:
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Phil,
> 
> On 4/26/2009 2:47 AM, nohacks wrote:
>> How you host multiple websites with Apache2 and Tomcat Cluster ??
> 
> When you say "multiple websites" do you mean "multiple webapps"? Serving
> multiple web applications should not be a problem at all:
> 
>> JkMount /*.jsp loadbalancer
>> JkMount /*.jsf loadbalancer
> 
> This appears to be a set up for a single webapp, but can certainly be
> used to power several sites:
> 
> /app1/index.jsp
> /app2/index.jsp
> /app3/index.jsp
> 
> All of these will be sent to Tomcat using the "loadbalancer" worker.
> Tomcat will determine which webapp should receive each request.
> 
>> JkMount /servlet/* loadbalancer
> 
> Use of the "/servlet" request dispatcher is not recommended. If you have
> servlets using this, you might want to consider migrating to a setup
> where each servlet is explicitly defined in your web.xml to make a
> unique URL. You may already be doing this but have retained the /servlet
> prefix for historical reasons. I figured I'm mention it, though.
> 
>> JkMount /* loadbalancer
> 
> Technically speaking, this JkMount covers all 3 previous JkMount
> statements, so the others are not necessary. But, since you are using
> httpd in the first place, why not have it serve your static content for
> you? If I were you, I'd remove this JkMount and direct httpd to serve
> static files for you, while delegating to Tomcat for things like JSPs
> and servlets.
> 
> Also, I like to specifically mount each web application separately. I
> happen to use different workers for each webapp (I have separate
> back-end Tomcats for each one) so I /must/ do this, but it helps
> document the httpd configuration file, too:
> 
> JkMount /app1/*.jsp loadbalancer
> JkMount /app1/*.jsf loadbalancer
> 
> JkMount /app2/*.jsp loadbalancer
> JkMount /app2/*.jsf loadbalancer
> 
> JkMount /app3/*.jsp loadbalancer
> JkMount /app3/*.jsf loadbalancer
> 
>> It would be nice to have separate log files ??
> 
> You can use separate log files within the same VirtualHost section by
> using environment variables:
> 
> SetEnvIf Request_URI "^/app1/" app1
> CustomLog logs/app1.log env=app1
> 
> See
> http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#customlog
> 
>> I am using AJP and wondering how this would work. Also, with sticky
>> sessions
>> and separate websites ??
> 
> The use of sticky sessions should have no impact on multiple webapps.
> 
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAkn1x8kACgkQ9CaO5/Lv0PBKcACfZNKsAURI7lbVL3wW9VLpG1dc
> oekAn17a1fq3yRKs7cLu7qlgP/b4N31i
> =gfTd
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-do-I-host-multiple-websites-with-Apache2-and-Tomcat-Clustertp23239694p23269266.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread Andre-John Mas


On 27-Apr-2009, at 22:05, David Rush wrote:


Andre-John:

Actually it was the original poster who was using a hosting  
company.  I'm using machines that I have full control of.


My problem was resolved by calling setContentType("text/html") in  
the controller servlet before it used include() to send control to  
some .jsp files.


Ah ok, I hadn't paid attention to the issue change.

BTW since you are using a JSP, you should be able to specify the  
content type in the JSP:


<%@ page language="java" contentType="text/html; charset=UTF-8"  
pageEncoding="UTF-8"%>


André-John
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread David Rush
Andre-John:

Actually it was the original poster who was using a hosting company.  I'm using 
machines that I have full control of.

My problem was resolved by calling setContentType("text/html") in the 
controller servlet before it used include() to send control to some .jsp files.

David

Andre-John Mas wrote:
> 
> On 27-Apr-2009, at 09:04, Pid wrote:
> 
>> David Rush wrote:
>>> I checked my web.xml, and found no mime-mapping elements at all.  I
>>> tried adding one explicitly mapping the jsp extension to text/html,
>>> but it had no effect.  I'm still getting HTML markup in the browser
>>> window with Firefox.
>>>
>>> David
>>
>> Ignore that, it's a red herring, you don't need to add mime-mappings.
>>
>> You say the problem occurs 'sometimes' with Firefox, can you elaborate
>> on which times and if there's a commonality between these requests?
>>
>>
>> The fault is usually in the AJP mapping you've configured.  Are you
>> using mod_jk, and if so, what is the config?
>>
>> Also, try splitting your HTTP docroot and Tomcat webapps folders (a
>> correct mapping will mean it still works properly).  If the JSPs are in
>> another location than the HTTP docs, they can't be served as raw HTML,
>> by accident.
> 
> He indicated in an earlier post that it was his hosting provider who
> deployed
> his application.
> 
> David, have you been able to find out how your hosting company deployed
> your
> application? Also, what is there "server" header value in the response
> header?
> 
> If your web application is properly deployed then there is no reason your
> web browser should see the raw JSP. This is because if everything works
> correctly Tomcat will have interpreted the JSP and returned you the result
> of that.
> 
> If in doubt, try to simulate the set up on your machine. Even if it doesn't
> solve the hosting provider side of things, it should help you gain a better
> understanding of how things work.
> 
> André-John
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Scheduling tasks in Tomcat

2009-04-27 Thread Martin Gainty

javac .\org\quartz\ee\servlet\QuartzInitializerServlet.java
place .\org\quartz\ee\servlet\QuartzInitializerServlet.class to WEB-INF/classes

your web.xml will need to associate the Servlet class with url-pattern as in 
this configuration:

 Servlet  
  org.quartz.ee.servlet.QuartzInitializerServlet 
 
  1  
   
   
  Servlet  
  *  
  

you will also need an startup display page index.jsp and configure index.jsp as 
welcome-file e.g.

   
index.jsp 
   

HTH
Martin 
__ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de 
déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.






> Date: Mon, 27 Apr 2009 17:52:16 -0700
> From: adenjo...@gmail.com
> To: users@tomcat.apache.org
> Subject: Re: Scheduling tasks in Tomcat
> 
> 
> I will probably use quartz to schedule the actual task and add it to my
> webapp as my teacher would prefer that the servlet contains everything.
> 
> What I don't understand is how or if (after I create my class that contains
> the scheduling code) Tomcat actually runs the code. Do I need to add
> something to web.xml to tell Tomcat to run it. Does Tomcat run every class
> in the servlet automatically.
> 
> 
> 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Scheduling-tasks-in-Tomcat-tp23251939p23268143.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

_
Rediscover Hotmail®: Now available on your iPhone or BlackBerry
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile2_042009

Re: Scheduling tasks in Tomcat

2009-04-27 Thread Aden Jones

I will probably use quartz to schedule the actual task and add it to my
webapp as my teacher would prefer that the servlet contains everything.

What I don't understand is how or if (after I create my class that contains
the scheduling code) Tomcat actually runs the code. Do I need to add
something to web.xml to tell Tomcat to run it. Does Tomcat run every class
in the servlet automatically.




-- 
View this message in context: 
http://www.nabble.com/Scheduling-tasks-in-Tomcat-tp23251939p23268143.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Session Replication problems

2009-04-27 Thread Filip Hanik - Dev Lists
we'd need the entire stacktrace, not just a snippet for it to be helpful 
to us.


Filip

Mohamedin wrote:

Dear All,

I use these configuration to enable session replication:


Master server:
























===
S2 server:
===
























==
S3 server:
==

























S1 server:

























=

My problem is the Master server (First One) did not replicate the sessions 
well. Also sometimes it refuse to stop and thread dump show it is in session 
replication

Some threads like this:

"TP-Processor15" daemon prio=1 tid=0x2b039e80 nid=0x7014 waiting on 
condition [0x472c2000..0x472c3e40]
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:118)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:716)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:746)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1076)
at 
java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync.wlock(ReentrantReadWriteLock.java:342)
at 
java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(ReentrantReadWriteLock.java:637)
at 
org.apache.catalina.ha.session.DeltaSession.lock(DeltaSession.java:184)
at 
org.apache.catalina.ha.session.DeltaSession.setAttribute(DeltaSession.java:517)
at 
org.apache.catalina.ha.session.DeltaSession.setAttribute(DeltaSession.java:502)
at 
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:130)
at 
com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSession.setHttpSession(ContainerAdapterSession.java:230)
at 
com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager.getSession(ContainerAdapterSessionManager.java:311)
at 
com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager.getSession(ContainerAdapterSessionManager.java:342)
at 
com.lutris.appserver.server.sessionContainerAdapter.TomcatContainerAdapterSessionManager.getSession(TomcatContainerAdapterSessionManager.java:273)
at 
com.lutris.appserver.server.StandardAppUtil.getRequestSession(StandardAppUtil.java:323)
at 
com.lutris.appserver.server.StandardApplication.ensureSession(StandardApplication.java:718)
at 
com.lutris.appserver.server.StandardApplication.requestPreprocessor(StandardApplication.java:900)
at com.ours.WebApp.requestPreprocessor(WebApp.java:83)
at 
com.lutris.appserver.server.httpPresentation.HttpPresentationManager.runRequestPreprocessor(HttpPresentationManager.java:400)
at 
com.lutris.appserver.server.httpPresentation.HttpPresentationManager.Run(HttpPresentationManager.java:247)
at 
com.lutris.appserver.server.httpPresentation.servlet.HttpPresentationServlet.serviceDirect(HttpPresentationServlet.java:682)
at 
com.lutris.appserver.server.httpPresentation.

RE: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Robin Wilson
I'll agree with you - this provided a fair and thorough examination of the 
reasons some people run httpd and tomcat, and why others don't - which was my 
original intention... To stimulate that very discussion.

BTW, I hope none of you got the idea that I supported _either_ approach, only 
described why some people do them.

--
Robin D. Wilson
Director of Web Development
KingsIsle Entertainment, Inc.
WORK: 512-623-5913
CELL: 512-426-3929
www.KingsIsle.com



-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Monday, April 27, 2009 6:28 PM
To: Tomcat Users List
Subject: Re: Why we need two servers (httpd and tomcat)

Robin Wilson wrote:
> For the record, my answer was neither stupid or reflexive. 

And for the record, I personally did not think it was either.

I agree with Leon when he says that some people just automatically put 
an Apache in front of a Tomcat when they don't really need to, just by 
habit or because they've found a configuration to copy, and without even 
thinking about whether they really need it.  Or maybe just because the 
server comes that way pre-installed.
Then they add a
JkMount /* ajp13
;-)

Or they configure a load-balancer to balance one single back-end..

Or they set Apache's DocumentRoot to the Tomcat webapps directory, just 
because it's easier and this way all the links work (usually in even 
more ways than they expect).

On the other hand, I also believe, contrarily to Leon, that there are 
plenty of practical cases where running some back-end Java applications 
on a Tomcat server is necessary, but is not the main purpose of the 
site, and thus having an Apache httpd in front comes in very handy or is 
necessary.  And provided you know what you're doing, the additional 
overhead due to mod_jk is going to take 100 years to overtake the cost 
of two days of trying to figure out how to do the same in Tomcat.

It also depends very much on the skills at hand.  Given a certain 
problem, the "right" solution will be different depending on whether you 
have a staff of mostly java-oriented people, or not.

So this was not a flame, just an attempt at restoring some balance which 
I felt was a bit upset by Leon's diatribe.

Thus, to the original poster : I believe that by now you should have a 
relative balance of arguments allowing you to decide when one needs only 
Apache httpd, only Tomcat, or a combination.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread André Warnier

Jeff Allison wrote:



Don't you need to run apache etc in front of tomcat because unless you run
tomcat as root it cannot listen on port 80???


No.
Since you're talking about root, I will assume Unix/Linux.
For that, you can run Tomcat under jsvc, which will open port 80 for 
you, and allow Tomcat to run under a non-root user.

Most recent versions of Linux install it that way for you.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Jeff Allison
> Hello Group,
>
> Can someone explain to me the basic difference between httpd and tomacat
> serer.  What one can do so the other can not do.  And why do we need these
> two servers in the first place.
>
> I will appreciate this.
>
> --
> Thanks
>
> Nagrik
>
Don't you need to run apache etc in front of tomcat because unless you run
tomcat as root it cannot listen on port 80???


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread André Warnier

Robin Wilson wrote:
For the record, my answer was neither stupid or reflexive. 


And for the record, I personally did not think it was either.

I agree with Leon when he says that some people just automatically put 
an Apache in front of a Tomcat when they don't really need to, just by 
habit or because they've found a configuration to copy, and without even 
thinking about whether they really need it.  Or maybe just because the 
server comes that way pre-installed.

Then they add a
JkMount /* ajp13
;-)

Or they configure a load-balancer to balance one single back-end..

Or they set Apache's DocumentRoot to the Tomcat webapps directory, just 
because it's easier and this way all the links work (usually in even 
more ways than they expect).


On the other hand, I also believe, contrarily to Leon, that there are 
plenty of practical cases where running some back-end Java applications 
on a Tomcat server is necessary, but is not the main purpose of the 
site, and thus having an Apache httpd in front comes in very handy or is 
necessary.  And provided you know what you're doing, the additional 
overhead due to mod_jk is going to take 100 years to overtake the cost 
of two days of trying to figure out how to do the same in Tomcat.


It also depends very much on the skills at hand.  Given a certain 
problem, the "right" solution will be different depending on whether you 
have a staff of mostly java-oriented people, or not.


So this was not a flame, just an attempt at restoring some balance which 
I felt was a bit upset by Leon's diatribe.


Thus, to the original poster : I believe that by now you should have a 
relative balance of arguments allowing you to decide when one needs only 
Apache httpd, only Tomcat, or a combination.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: OT: GoDaddy Hosting and Tomcat

2009-04-27 Thread Jonathan Mast
Well, you get what you pay for.  My GoDaddy account costs $6.99 per month
and I quickly found it inadequate for hosting serious Tomcat applications,
just for the reasons you listed: very unintuitive control panels, 1-day lag
in servlet (non)-deployment.

I'm canceling the hosting portion of my GoDaddy account as soon as I get my
old dell dimension 4600 ready for hosting my website :)

But the $0.99 per year .info domain name is a pretty sweet deal i think.

Basically, GoDaddy is a very affordable domain name retailer; their hosting
is a mickey mouse LAMP-shop. My 65 year old father has his website hosted on
GoDaddy, my dad isn't interested in enterprise-level web applications, he
just wants a website.  Thats what Godaddy's hosting is good for.

On Mon, Apr 27, 2009 at 10:44 AM, George Sexton wrote:

> I thought I'd write up my experiences trying to get a servlet
> application running on GoDaddy. Perhaps it will save someone else some
> pain.
>
> I have a Java Servlet calendar application. It's a stable app and I've
> got at least a thousand of running copies. I was attempting to install
> it on GoDaddy's shared Linux hosting service which runs Tomcat 5.0.27.
>
> Reading the documentation on their site, it looked like all I had to do
> was upload the WAR file and wait until 1:00 AM Arizona time and the
> application should be deployed. I did this and waited. The next day, I
> found the application had not deployed. A call to technical support
> revealed that I had to go to a certain corner of the hosting control
> panel and enable Java language support. I did that and waited until the
> next day.
>
> This is one of the problems with their shared hosting account. ANY
> change takes until the next day to take effect.
>
> The next day, I looked, and the WAR file had been exploded but my App
> didn't work. Since my App has a dependency on the database, I uploaded a
> simple JSP to test the DB Connection. It worked. Attempts to view the
> error logs failed.
>
> I called GoDaddy support. The technician told me I need to enable error
> logging. He walked me through the control panel and I enabled error
> logging. I waited until the next day.
>
> The application still didn't work. When I tried to view the error logs,
> I got nothing. Another call to technical support revealed that the error
> logs I had enabled would not actually contain any Tomcat log data.
>
> I had my call escalated to a manager. I explained to him the reason I
> knew my application was not working. I told him the login page was not
> available. His response was "Yeah, there's no file with that name." I
> told him that the URL was a virtual mapping created in the web.xml file.
> After literally an hour, they came back on-line and told me that they
> were going to open a trouble-ticket and call me back.
>
> Several hours later, I got an Email from support saying. "It doesn't
> work because there's no file with that name."
>
> At this point, I had a funny feeling. I created a simple WAR file with
> one servlet and a web.xml deployment descriptor. The deployment
> descriptor mapped three URLs to the servlet:
>
> /MapTest.xyz
> /MapTest.jsp
> /MapTest.html
>
> I waited until the next day. Sure enough, I could access MapTest.xyz,
> and MapTest.jsp. Attempts to access MapTest.html generated a 404 Not
> Found error. This explains why my application was not running. All my
> servlets are mapped into URLs with extension of .html. This was a design
> decision because customers generally want the maximum visibility to
> search engines.
>
> So, what I found is that GoDaddy.com does not pass all requests into the
> servlet container. It attempts to service as many requests with Apache
> first, and then only passes the non-mapped requests into Tomcat. There
> are some 50 file extensions GoDaddy co-opts including .css, .xml, and .js.
>
> This configuration actually causes their deployment of Tomcat to be
> non-compliant with the Servlet API version 2.3 specification. Section
> SRV.11.2.1 says that explicit mappings in the deployment descriptor must
> take precedence over implicit mappings. Taken as a SYSTEM, their
> deployment of Apache Tomcat is non-compliant.
>
> My feeling is that ANY request that maps to a deployed context must be
> passed to the servlet container. Clearly, they are not doing that.
>
> So, after all the effort, I get to tell the customer that my application
> will not work on their hosting account. Rats.
>
> In general, even if your application isn't using servlet mapping I can't
> recommend them. Since it takes until the next day before you can
> re-deploy a WAR file, and there are no Tomcat logs available, it would
> be a really rotten experience.
>
>
> --
> George Sexton
> MH Software, Inc.
> Voice: +1 303 438 9585
> URL:   http://www.mhsoftware.com/
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomca

Re: Tomcat and Apache HTTPD modules?

2009-04-27 Thread Hassan Schroeder
On Mon, Apr 27, 2009 at 3:41 PM, Andre-John Mas  wrote:

> If Apache HTTPD is dropped for a pure Tomcat solution, which standard
> modules have Tomcat equivalent solutions? For example:
>  - Mod Rewrite

http://tuckey.org/urlrewrite/  -- it's Close To A Standard :-)

>  - HTTPS
>  - Virtual Hosts

both built in,

> It may be interesting to get some of this into the official Tomcat
> documentation.

and documented.

FWIW,
-- 
Hassan Schroeder  hassan.schroe...@gmail.com

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Andre-John Mas


On 27-Apr-2009, at 13:59, Leon Rosenberg wrote:



In addition to more granular security (as described above), having  
isolated the web layer from the application layer allows you to  
independently adjust the performance >of each. If you are finding  
that your system serves a lot more static content than it does  
'application' functionality, you may need several web servers to  
handle the load. >Likewise, if your system is application focused,  
you may need more tomcat servers (probably clustered) than web  
servers.


The short answer to that would probably be, if you have performance
concerns, you just do not use apache httpd. If you want/need to
loadbalance, a hardware loadbalancer is the weapon of choice. If you
need to server a lot of large static content (pictures) you put
reverse proxies in front of your tomcats. If you need to serve static
content (js, css etc) along with dynamic content, you let tomcat
handle it, it serves static content faster than httpd anyway.

Imho, the only valid use for httpd in front of tomcat is when you are
a one-man one-server company and need to host a lot of virtual stuff
on your box including php and such. Everything else and you are better
of without httpd :-)



If you have a large budget, then hardware anything generally makes for
better performance, since that what they are optimized for. On the other
hand when you a small startup Apache HTTPD allows you to leverage  
hardware
you already have for a much lower cost. The following article  
illustrates

this:

http://www.networkcomputing.com/channels/security/showArticle.jhtml?articleID=47204086

Long term it makes more sense to invest the right equipment, but we  
don't

all have $4000 available right off.

Are there any good articles, with performance numbers that show how  
Tomcat can
compete against Apache HTTPD? While many on this will accept what you  
have

to say, the people who make the financial choices often want something
that lays it out bare in a documented format.

André-John
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat and Apache HTTPD modules?

2009-04-27 Thread Andre-John Mas

Hi,

If Apache HTTPD is dropped for a pure Tomcat solution, which standard  
modules have

Tomcat equivalent solutions? For example:
  - Mod Rewrite
  - HTTPS
  - Virtual Hosts

It may be interesting to get some of this into the official Tomcat  
documentation.


André-John
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Leon Rosenberg
On Mon, Apr 27, 2009 at 11:53 PM, Robin Wilson  wrote:
> For the record, my answer was neither stupid or reflexive. I simply pointed 
> out why someone might want 2 layers of servers (httpd and tomcat). And 
> certainly, my rationale is both sound and arguable at the same time.

I never ment to insult you, so if I did so by mistake, I beg my pardon.

>
> As for your assertion that 2 layers of security is just complexity and not 
> more secure - you obviously haven't run many enterprise production systems. 
> Security in an >enterprise system is all about 'layers' of protection. And 
> sure, if they hack one layer - they are probably good enough to hack the next 
> layer. But that's where intrusion >detection and a variety of other system 
> come into play. It's all about slowing down the advance of the attack until 
> you can do something about it.

Well actually I'm working with Enterprise Systems for last 10 year,
last 5 in high performance field. Whatever you are doing to prevent an
attack from happening you still need a connection from outside to your
tomcat. An AJP connection is a plain connection, everything sent in is
going through. Neither mod_ajp, nor mod_jk or mod_proxy_ajp do any
security inspection on what they are sending over. So if there is a
vulnerability in tomcat itself or your app its fully exposed no matter
how many apaches you put in front. If it is possible to inject
javascript or sql code into your application it will still be injected
with apache. Furthermore, the two last (serious) security issues with
tomcat were the url encoding problem and the buffer overflow in
mod_jk. So by using an apache httpd in front of your tomcat you
actually doubled the risk of being hacked.

>
> As for performance, have you run any load testing against tomcat vs. apache - 
> especially on static files? Apache exceeds tomcat in performance by a large 
> margin. When you are serving millions of pages a day, and tens of millions of 
> static files (images, css, js, videos, audios, etc.), that makes a 
> significant difference in the amount of hardware you have to throw at the 
> problem.

I actually did. We tried a lot and ended up with reverse proxies
(squid, varnish). As for tomcat vs. apache, I haven't read a single
comparison in last 3 years where apache was faster, expect for
'very-large-static-files', which are better served by fast http
servers like lightttpd.
For tomcat vs. apache check out this book please:
http://www.amazon.com/Tomcat-Definitive-Guide-Jason-Brittain/dp/0596101066/ref=sr_1_1?ie=UTF8&s=books&qid=1240350860&sr=1-1

>
> So you may be absolutely correct - it is not 'necessary' in a lot of cases. 
> But in many production - enterprise - deployments, it can be useful to have a 
> layer of web servers and a separately managed layer of application servers - 
> and that same model works just fine with Apache and Tomcat.

Just out of curiosity how large is your web farm and what is the
average response time?

regards
Leon



>
> --
> Robin D. Wilson
> Director of Web Development
> KingsIsle Entertainment, Inc.
> WORK: 512-623-5913
> CELL: 512-426-3929
> www.KingsIsle.com
>
>
> -Original Message-
> From: Leon Rosenberg [mailto:rosenberg.l...@googlemail.com]
> Sent: Monday, April 27, 2009 3:41 PM
> To: Tomcat Users List; a...@ice-sa.com
> Subject: Re: Why we need two servers (httpd and tomcat)
>
> On Mon, Apr 27, 2009 at 9:21 PM, André Warnier  wrote:
>> Leon Rosenberg wrote:
>>>
>>> I'm sorry, I can't shut up my mouth on this, but you are telling myths :-)
>>>
>> And anyway, you just all forget this Java nonsense, and use Perl, as Real
>> Programmers do.
>>
>> That's just kidding of course, but let's keep a sense of perspective.
>
> Hello André,
>
> I don't want to start a new religious war, so I'll live most of the
> mail unanswered, however, one thing:
>
>> And that's also where the versatility of Apache httpd comes into play, a
>> versatility which Tomcat does not match and probably never will, because the
>> purpose of each is different.
>
> That's true, httpd is able to do everything (and nothing right:-)) but
> what I'm speaking up against is this
> stupid reflective answer "you need a httpd in front of your tomcat".
> You don't. There might by reasons, some of them stated by you, but
> also other,
> where its appropriate, but its not the rule, its an exception.
> The rule and therefore the standard answer should be: "you don't need
> an apache httpd in front of your tomcat unless, ..." and not
> "put an apache in front of your tomcat and stop thinking anyway" as it
> often is today.
>
> Having said that, lets close the thread anyway :-)
>
> regards
> Leon
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat

Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread Andre-John Mas


On 27-Apr-2009, at 18:15, Andre-John Mas wrote:



On 27-Apr-2009, at 09:04, Pid wrote:


David Rush wrote:
I checked my web.xml, and found no mime-mapping elements at all.   
I tried adding one explicitly mapping the jsp extension to text/ 
html, but it had no effect.  I'm still getting HTML markup in the  
browser window with Firefox.


David


Ignore that, it's a red herring, you don't need to add mime-mappings.

You say the problem occurs 'sometimes' with Firefox, can you  
elaborate

on which times and if there's a commonality between these requests?


The fault is usually in the AJP mapping you've configured.  Are you
using mod_jk, and if so, what is the config?

Also, try splitting your HTTP docroot and Tomcat webapps folders (a
correct mapping will mean it still works properly).  If the JSPs  
are in
another location than the HTTP docs, they can't be served as raw  
HTML,

by accident.


He indicated in an earlier post that it was his hosting provider who  
deployed

his application.

David, have you been able to find out how your hosting company  
deployed your
application? Also, what is there "server" header value in the  
response header?


If your web application is properly deployed then there is no reason  
your
web browser should see the raw JSP. This is because if everything  
works
correctly Tomcat will have interpreted the JSP and returned you the  
result

of that.

If in doubt, try to simulate the set up on your machine. Even if it  
doesn't
solve the hosting provider side of things, it should help you gain a  
better

understanding of how things work.

André-John


I should have included an example of the headers to help you diagnose  
the
situation. In my case I have Tomcat sitting behind Apache HTTPD. If I  
access

Tomcat via HTTPD I see:

Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7l DAV/2 PHP/ 
5.2.8 mod_jk/1.2.27


If I access the Tomcat server straight, I see this:

Server: Apache-Coyote/1.1

If you are using Firefox, and you have the Web Developer extension  
installed, then

in the toolbar select Information -> View Response Headers.

Hopefully this should help in your analysis.

André-John




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Jess Holle

Jess Holle wrote:

Robin Wilson wrote:

For the record, my answer was neither stupid or reflexive. I simply pointed out 
why someone might want 2 layers of servers (httpd and tomcat). And certainly, 
my rationale is both sound and arguable at the same time.

As for your assertion that 2 layers of security is just complexity and not more 
secure - you obviously haven't run many enterprise production systems. Security 
in an enterprise system is all about 'layers' of protection. And sure, if they 
hack one layer - they are probably good enough to hack the next layer. But 
that's where intrusion detection and a variety of other system come into play. 
It's all about slowing down the advance of the attack until you can do 
something about it.

As for performance, have you run any load testing against tomcat vs. apache - 
especially on static files? Apache exceeds tomcat in performance by a large 
margin. When you are serving millions of pages a day, and tens of millions of 
static files (images, css, js, videos, audios, etc.), that makes a significant 
difference in the amount of hardware you have to throw at the problem.

So you may be absolutely correct - it is not 'necessary' in a lot of cases. But 
in many production - enterprise - deployments, it can be useful to have a layer 
of web servers and a separately managed layer of application servers - and that 
same model works just fine with Apache and Tomcat.
  
I think the Tomcat folk would dispute your assertion on performance -- 
in particular when Tomcat is used with native APR.


That said, the biggest reason I know of for Apache fronting Tomcat is 
load balancing across Tomcats.


If you have a hardware load balancer doing that, then there are lesser 
reasons, e.g.:


* there are more security plug-ins for Apache (e.g. SiteMinder and
  the like),
* multi-LDAP authentication support is built into Apache,

It is my understanding that the next Tomcat release will provide 
multi-LDAP authentication support, by the way.


* various existing Apache modules (e.g. mod_redirect) allow some
  classes of problems to be solved by configuration that would
  require coding in Tomcat.

On this last note, however, I'd say that writing necessary 
filter/listener/handler code for Tomcat can generally be done in a 
manner that is portable to any up-to-date servlet engine, is /far/ 
easier than writing code for Apache modules, and is sometimes even 
easier than achieving the same end by configuring modules in Apache 
(where that is approach is sufficient).




Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Jess Holle

Robin Wilson wrote:

For the record, my answer was neither stupid or reflexive. I simply pointed out 
why someone might want 2 layers of servers (httpd and tomcat). And certainly, 
my rationale is both sound and arguable at the same time.

As for your assertion that 2 layers of security is just complexity and not more 
secure - you obviously haven't run many enterprise production systems. Security 
in an enterprise system is all about 'layers' of protection. And sure, if they 
hack one layer - they are probably good enough to hack the next layer. But 
that's where intrusion detection and a variety of other system come into play. 
It's all about slowing down the advance of the attack until you can do 
something about it.

As for performance, have you run any load testing against tomcat vs. apache - 
especially on static files? Apache exceeds tomcat in performance by a large 
margin. When you are serving millions of pages a day, and tens of millions of 
static files (images, css, js, videos, audios, etc.), that makes a significant 
difference in the amount of hardware you have to throw at the problem.

So you may be absolutely correct - it is not 'necessary' in a lot of cases. But 
in many production - enterprise - deployments, it can be useful to have a layer 
of web servers and a separately managed layer of application servers - and that 
same model works just fine with Apache and Tomcat.
  
I think the Tomcat folk would dispute your assertion on performance -- 
in particular when Tomcat is used with native APR.


That said, the biggest reason I know of for Apache fronting Tomcat is 
load balancing across Tomcats.


If you have a hardware load balancer doing that, then there are lesser 
reasons, e.g.:


   * there are more security plug-ins for Apache (e.g. SiteMinder and
 the like),
   * multi-LDAP authentication support is built into Apache, 
   * various existing Apache modules (e.g. mod_redirect) allow some

 classes of problems to be solved by configuration that would
 require coding in Tomcat.

On this last note, however, I'd say that writing necessary 
filter/listener/handler code for Tomcat can generally be done in a 
manner that is portable to any up-to-date servlet engine, is /far/ 
easier than writing code for Apache modules, and is sometimes even 
easier than achieving the same end by configuring modules in Apache 
(where that is approach is sufficient).


--
Jess Holle



Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread Andre-John Mas


On 27-Apr-2009, at 09:04, Pid wrote:


David Rush wrote:
I checked my web.xml, and found no mime-mapping elements at all.  I  
tried adding one explicitly mapping the jsp extension to text/html,  
but it had no effect.  I'm still getting HTML markup in the browser  
window with Firefox.


David


Ignore that, it's a red herring, you don't need to add mime-mappings.

You say the problem occurs 'sometimes' with Firefox, can you elaborate
on which times and if there's a commonality between these requests?


The fault is usually in the AJP mapping you've configured.  Are you
using mod_jk, and if so, what is the config?

Also, try splitting your HTTP docroot and Tomcat webapps folders (a
correct mapping will mean it still works properly).  If the JSPs are  
in

another location than the HTTP docs, they can't be served as raw HTML,
by accident.


He indicated in an earlier post that it was his hosting provider who  
deployed

his application.

David, have you been able to find out how your hosting company  
deployed your
application? Also, what is there "server" header value in the response  
header?


If your web application is properly deployed then there is no reason  
your

web browser should see the raw JSP. This is because if everything works
correctly Tomcat will have interpreted the JSP and returned you the  
result

of that.

If in doubt, try to simulate the set up on your machine. Even if it  
doesn't
solve the hosting provider side of things, it should help you gain a  
better

understanding of how things work.

André-John
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Robin Wilson
For the record, my answer was neither stupid or reflexive. I simply pointed out 
why someone might want 2 layers of servers (httpd and tomcat). And certainly, 
my rationale is both sound and arguable at the same time.

As for your assertion that 2 layers of security is just complexity and not more 
secure - you obviously haven't run many enterprise production systems. Security 
in an enterprise system is all about 'layers' of protection. And sure, if they 
hack one layer - they are probably good enough to hack the next layer. But 
that's where intrusion detection and a variety of other system come into play. 
It's all about slowing down the advance of the attack until you can do 
something about it.

As for performance, have you run any load testing against tomcat vs. apache - 
especially on static files? Apache exceeds tomcat in performance by a large 
margin. When you are serving millions of pages a day, and tens of millions of 
static files (images, css, js, videos, audios, etc.), that makes a significant 
difference in the amount of hardware you have to throw at the problem.

So you may be absolutely correct - it is not 'necessary' in a lot of cases. But 
in many production - enterprise - deployments, it can be useful to have a layer 
of web servers and a separately managed layer of application servers - and that 
same model works just fine with Apache and Tomcat.

--
Robin D. Wilson
Director of Web Development
KingsIsle Entertainment, Inc.
WORK: 512-623-5913
CELL: 512-426-3929
www.KingsIsle.com


-Original Message-
From: Leon Rosenberg [mailto:rosenberg.l...@googlemail.com] 
Sent: Monday, April 27, 2009 3:41 PM
To: Tomcat Users List; a...@ice-sa.com
Subject: Re: Why we need two servers (httpd and tomcat)

On Mon, Apr 27, 2009 at 9:21 PM, André Warnier  wrote:
> Leon Rosenberg wrote:
>>
>> I'm sorry, I can't shut up my mouth on this, but you are telling myths :-)
>>
> And anyway, you just all forget this Java nonsense, and use Perl, as Real
> Programmers do.
>
> That's just kidding of course, but let's keep a sense of perspective.

Hello André,

I don't want to start a new religious war, so I'll live most of the
mail unanswered, however, one thing:

> And that's also where the versatility of Apache httpd comes into play, a
> versatility which Tomcat does not match and probably never will, because the
> purpose of each is different.

That's true, httpd is able to do everything (and nothing right:-)) but
what I'm speaking up against is this
stupid reflective answer "you need a httpd in front of your tomcat".
You don't. There might by reasons, some of them stated by you, but
also other,
where its appropriate, but its not the rule, its an exception.
The rule and therefore the standard answer should be: "you don't need
an apache httpd in front of your tomcat unless, ..." and not
"put an apache in front of your tomcat and stop thinking anyway" as it
often is today.

Having said that, lets close the thread anyway :-)

regards
Leon

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: adding files to classpath

2009-04-27 Thread Leon Rosenberg
On Mon, Apr 27, 2009 at 11:06 PM, Caldarale, Charles R
 wrote:
>> From: Leon Rosenberg [mailto:rosenberg.l...@googlemail.com]
>> Subject: Re: adding files to classpath
>>
>> Why should I restart tomcat to change the config in this case?
>
> If you're using ClassLoader.getResourceAsStream() each time you check the 
> config, it should be o.k. without a restart.  However, if you're using some 
> technique that caches the config with the classloader, it won't go away until 
> the classloader does, which won't be until the complete JVM is restarted.

Yes, I'm using getResource, and it works.

> As long as no actual classes are involved, I don't think there's a problem.

Thanks a lot for your help. You have been very helpful as usual!

>
>  - Chuck
>


regards
Leon

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Joseph Millet
What's then common use where the two are required ?

On Mon, Apr 27, 2009 at 11:21 PM, Pid  wrote:

> Leon Rosenberg wrote:
> > On Mon, Apr 27, 2009 at 9:21 PM, André Warnier  wrote:
> >> Leon Rosenberg wrote:
> >>> I'm sorry, I can't shut up my mouth on this, but you are telling myths
> :-)
> >>>
> >> And anyway, you just all forget this Java nonsense, and use Perl, as
> Real
> >> Programmers do.
> >>
> >> That's just kidding of course, but let's keep a sense of perspective.
> >
> > Hello André,
> >
> > I don't want to start a new religious war, so I'll live most of the
> > mail unanswered, however, one thing:
> >
> >> And that's also where the versatility of Apache httpd comes into play, a
> >> versatility which Tomcat does not match and probably never will, because
> the
> >> purpose of each is different.
> >
> > That's true, httpd is able to do everything (and nothing right:-)) but
> > what I'm speaking up against is this
> > stupid reflective answer "you need a httpd in front of your tomcat".
> > You don't. There might by reasons, some of them stated by you, but
> > also other,
> > where its appropriate, but its not the rule, its an exception.
> > The rule and therefore the standard answer should be: "you don't need
> > an apache httpd in front of your tomcat unless, ..." and not
> > "put an apache in front of your tomcat and stop thinking anyway" as it
> > often is today.
> >
> > Having said that, lets close the thread anyway :-)
>
> Postscript: the OP's type of question smells like a student sniffing for
> an essay answer, (no offence meant if I'm wrong).
>
> Of course the real reason we need web AND application servers is to
> makes the interwebs, where we can has flame wars.
>
>
> p
>
>
>
> > regards
> > Leon
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> >
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Pid
Leon Rosenberg wrote:
> On Mon, Apr 27, 2009 at 9:21 PM, André Warnier  wrote:
>> Leon Rosenberg wrote:
>>> I'm sorry, I can't shut up my mouth on this, but you are telling myths :-)
>>>
>> And anyway, you just all forget this Java nonsense, and use Perl, as Real
>> Programmers do.
>>
>> That's just kidding of course, but let's keep a sense of perspective.
> 
> Hello André,
> 
> I don't want to start a new religious war, so I'll live most of the
> mail unanswered, however, one thing:
> 
>> And that's also where the versatility of Apache httpd comes into play, a
>> versatility which Tomcat does not match and probably never will, because the
>> purpose of each is different.
> 
> That's true, httpd is able to do everything (and nothing right:-)) but
> what I'm speaking up against is this
> stupid reflective answer "you need a httpd in front of your tomcat".
> You don't. There might by reasons, some of them stated by you, but
> also other,
> where its appropriate, but its not the rule, its an exception.
> The rule and therefore the standard answer should be: "you don't need
> an apache httpd in front of your tomcat unless, ..." and not
> "put an apache in front of your tomcat and stop thinking anyway" as it
> often is today.
> 
> Having said that, lets close the thread anyway :-)

Postscript: the OP's type of question smells like a student sniffing for
an essay answer, (no offence meant if I'm wrong).

Of course the real reason we need web AND application servers is to
makes the interwebs, where we can has flame wars.


p



> regards
> Leon
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Send tomcat logs to syslog-ng

2009-04-27 Thread Caldarale, Charles R
> From: André Warnier [mailto:a...@ice-sa.com]
> Subject: Re: Send tomcat logs to syslog-ng
> 
> The OP is under Windows, so probably running Tomcat under the
> commons-daemon stuff (tomcatxx.exe). Does that also work as such in
> that case ?

Yes, it makes no difference if it's running as a service or from a Windows 
command prompt, with the exception of anything writing to System.out or 
System.err; for a service, they're redirected, for the command prompt they're 
not.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: adding files to classpath

2009-04-27 Thread Caldarale, Charles R
> From: Leon Rosenberg [mailto:rosenberg.l...@googlemail.com]
> Subject: Re: adding files to classpath
> 
> Why should I restart tomcat to change the config in this case?

If you're using ClassLoader.getResourceAsStream() each time you check the 
config, it should be o.k. without a restart.  However, if you're using some 
technique that caches the config with the classloader, it won't go away until 
the classloader does, which won't be until the complete JVM is restarted.

> so its basically the same as the above, the only difference being 
> that I'm modifying the classpath indirectly.

It's not quite the same, in that there's a separate classloader that handles 
java.endorsed.dirs, rather than the system classloader.  For these purposes (no 
classes), the difference is probably moot.  I'd still likely use 
java.endorsed.dirs, just to keep things separated.

> everything seems to work (including new stuff and old stuff), 
> could I have broken anything I don't see yet by this?

As long as no actual classes are involved, I don't think there's a problem.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Browser shows source of .jsp file. Why?

2009-04-27 Thread Caldarale, Charles R
> From: David Rush [mailto:da...@rushtone.com]
> Subject: Re: Browser shows source of .jsp file. Why?
> 
> It also appears that Tomcat (rather than Apache httpd) is initially
> responding to my http://myserver/Construction URL with a 302 (Moved
> Temporarily) and a suggestion that the browser try
> http://myserver/Construction/ (with trailing slash), as it should.

I think what pid was suggesting is that you fix your ProxyPass settings to 
include the trailing slash.  After the 302, the URL with the slash won't match 
what you have configured, and it will be served by httpd rather than being sent 
on to Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Using encoded slashes safely

2009-04-27 Thread Bill Higgins
We have a servlet that acts as a proxy to other URLs from different
origins. E.g. via your web app you could get to the Google home page
via a URL like:

http://localhost/myapp/proxy/http%3A%2F%2Fwww.google.com%2F

Using this URL pattern, we immediately hit the Tomcat "noSlash"
restriction (Directory traversal CVE-2007-0450) and in order for our
proxy to work we have to set the environment variable
org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH to true.

However, enabling this environment variable obviously opens us up to
the security vulnerability that CVE-2007-0450 intended to address
(being able to navigate to directories protected by the proxy's
content restriction).

The reason I'm writing is that I'm confused by the fix to
CVE-2007-0450. It seems like the fix was "Since Tomcat allows for
behavior that's not conformant with the URI spec (i.e. allowing
certain encoded characters to be treated as their reserved literal
equivalents), disallow those encodings globally". It seems like a more
appropriate solution would have been "Do not allow encoded backslashes
and slashed to be treated as their literal equivalents". This
alternative solution would have:

1) Removed the security vulnerability, and
2) Removed a "feature" that is outside the URI spec

It seems like the current solution disallows encoded characters that
are allowed by the URI spec in order to maintain behavior that is
outside the URI spec.

I have more questions on how to respond to this Tomcat behavior, but
I'm hoping someone could provide more input on the rationale behind
the current fix for CVE-2007-0450 to provide additional context for my
other questions.


-- 

Thanks,
- Bill Higgins (IBM Rational)

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Leon Rosenberg
On Mon, Apr 27, 2009 at 9:21 PM, André Warnier  wrote:
> Leon Rosenberg wrote:
>>
>> I'm sorry, I can't shut up my mouth on this, but you are telling myths :-)
>>
> And anyway, you just all forget this Java nonsense, and use Perl, as Real
> Programmers do.
>
> That's just kidding of course, but let's keep a sense of perspective.

Hello André,

I don't want to start a new religious war, so I'll live most of the
mail unanswered, however, one thing:

> And that's also where the versatility of Apache httpd comes into play, a
> versatility which Tomcat does not match and probably never will, because the
> purpose of each is different.

That's true, httpd is able to do everything (and nothing right:-)) but
what I'm speaking up against is this
stupid reflective answer "you need a httpd in front of your tomcat".
You don't. There might by reasons, some of them stated by you, but
also other,
where its appropriate, but its not the rule, its an exception.
The rule and therefore the standard answer should be: "you don't need
an apache httpd in front of your tomcat unless, ..." and not
"put an apache in front of your tomcat and stop thinking anyway" as it
often is today.

Having said that, lets close the thread anyway :-)

regards
Leon

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread André Warnier

Leon Rosenberg wrote:

I'm sorry, I can't shut up my mouth on this, but you are telling myths :-)

And anyway, you just all forget this Java nonsense, and use Perl, as 
Real Programmers do.


That's just kidding of course, but let's keep a sense of perspective.

If you just want to run jsp pages and java servlets, then you need 
Tomcat (or another servlet engine), and there is no reason to add an 
Apache httpd in front. It would just complicate and slow down things.


If you need to serve some static content in addition to running your jsp 
pages and servlets, then there is still no need to put an Apache httpd 
in front of Tomcat, it can do that fine too by itself.


If you need several Tomcats to take the load, and you need to balance 
the calls to them, then you need a load-balancer in front; whether you 
want to use Apache httpd for that, or some other device/software is 
dependent on other factors. And if you want to use Apache, you can still 
choose between mod_proxy_http, mod_proxy_ajp or mod_jk.


If you do not need to run jsp pages and servlets, then you don't need 
Tomcat at all, and you'll be better off with Apache httpd alone.


If you need to run PHP or Perl or other non-Java applications, then you 
need Apache httpd, because Tomcat can't do that with anywhere near the 
same kind of speed and flexibility.


Now apart from the ideal clear-cut cases above, in the real world there 
are many cases where what you need to do is a mixture of all that, and 
that's where an Apache httpd/Tomcat combination may be the best choice.
And that's also where the versatility of Apache httpd comes into play, a 
versatility which Tomcat does not match and probably never will, because 
the purpose of each is different.


Where Tomcat is designed to be a Java servlet engine, Apache httpd is 
designed for being a "swiss-army-knife" webserver. And it is free too 
(contrary to a hardware load-balancer).
As much as Tomcat can also serve static content (and in simple cases do 
it well and efficiently), Apache httpd can do everything that Tomcat can 
do (except running Java applications).  And then it can do a lot of 
extra things that Tomcat cannot, and it can do it almost out of the box, 
with a configuration which does not require being a Java expert.
And it is used by about 50% of all websites on the WWW, for a total of 
some 100 Million. So it must be doing something right.


And not everyone can afford a server farm.

The point is, Apache httpd /can/ be a front-end to Tomcat, forwarding 
what needs to be and serving the rest either locally or by proxying it 
somehere else, do the authentication on behalf of itself and of Tomcat 
with just about any back-end imaginable, balancing between several 
back-end Tomcats, modifying requests to Tomcat on-the-fly and modifying 
Tomcat's responses if need be also, cache responses, negotiate content,
track user activity and whatnot, and that is all just with the standard 
modules available directly within the standard Apache distribution.


Tomcat cannot do the same for Apache.  And it does not want to do it, 
because its focus is on being a good java servlet server, not on being a 
universal webserver like Apache httpd wants to be.


Now maybe in another 10 years, Tomcat will be able to do all these 
things too.  But by then maybe Java will be out of fashion (remember 
Pascal, PL/1, RPG ?) and all decent webservers will be written in Erlang.







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Filtering URL via tomcat

2009-04-27 Thread Ravi Sharma
adding to previoius mail.

http://www.mysite.com/audio/abc.html is a html being served by httpd
correctly
then when i try to access
http://www.mysite.com/app/audio/download/abc.htmli get following error
on browser

*Type* Status report
*message* */app/audio/download/abc.html
**description* *The requested resource (/app/audio/download/abc.html) is not
available.**

the access log(mysite.com_access_log) of apache httpd says*
[27/Apr/2009:11:09:16 -0700] "GET /app/audio/download/abc.html HTTP/1.1" 404
1135 "-" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.9)
Gecko/2009040821 Firefox/3.0.9 (.NET CLR 3.5.30729)"

*the error log(mysite.com_error_log) of appache httpd says nothing, no issue
there*

when i tried this url
http://www.mysite.com:9080/app/audio/download/abc.html (tomcat is running on
9080)
i got the same error on browser*
Type* Status report
*message* */app/audio/download/abc.html*
*description* *The requested resource (/app/audio/download/abc.html) is not
available.* *
*

There are no errors in catalina.out(and this is the only file in logs dir of
Tomcat)




On Mon, Apr 27, 2009 at 6:57 PM, André Warnier  wrote:

>
> Ravi,
>
> First :
> > so basically if i try to access any thing with
> > http://www.mysite.com/app/audio, it should be served from audio  dir in
> > webapps which in turn audio dir from appache httpd.
> >
> > But its not working. :(
> >
> "its not working" is not something that allows anyone to help you.
> HOW is it not working ? What do you do, what do you expect, and what are
> you getting as an error ?
> That means :
> - tell us what URL you are using in the browser
> - what error do you see in the browser ?
> - what error do you see in the Apache logfile ?
> - and what error do you see in the Tomcat logfile ?
>
> Then (old African proverb) : if you want to eat an elephant, you should do
> it a little bit at a time.
>
> In other words, simplify the problem if you can.
>
> Assuming that your Tomcat listens on port 8080 for example (you can see
> that in the conf/server.xml,  tags), try the following :
> - turn off Apache httpd
> - in the browser, enter the URL
> http://www.mysiste.com:8080/app/audio/download/abc.html
> (that goes to Tomcat directly, without going through Apache).
> What happens then ?
> Don't be afraid to add some details.
>
>
>
>
> Ravi Sharma wrote:
>
>> Hi All,
>> Please help me for this problem, i am not able to get to the root of the
>> problem.
>>
>> My site have few open/free pages which can be accessed by anyone/guests
>> and
>> few only for registered users. So you can access those pages only by login
>> to the site
>>
>> http://www.mysiste.com/audio/abc.html (anyone/guests can see this page)
>> http://www.mysiste.com/audio/app/download/abc.html (only logged in user
>> can
>> see this page)
>>
>> I am using tomcat 5.5 and appache httpd server 2.2.
>>
>> the root of my site reside in appache httpd server
>> so i have folder structure like
>> mysite/public_html/audio
>> mysite/public_html/app/audio/download
>>
>> in my httpd conf i have something like this
>> JkMount /app/audio/download/* ajp13w
>> ..
>> ..
>> ..
>> and mysite.com is poiniting to mysite/public_html
>>
>>
>> *app* is my tomcat application context
>>
>> and in tomcat web.xml one Filter is listning to url
>> 
>>DownLoadSecurityFilter
>>com.app.security.SecurityFilter
>>
>>
>>DownLoadSecurityFilter
>>/audio/download/*
>>
>>
>> So all the pages will be served by apache httpd except the pages which are
>> like app/audio/download.
>>
>> So now when somone try to access app/audio/download/some.html the request
>> passed to tomcat, in turns filter check this url and if user is not logged
>> in then login screen comes up.
>> User login and proceed and login screen automcatically forward the request
>> to the page which was requested app/audio/download/some.html, but here i
>> get
>> this tomcat error
>>
>> *Type* Status report
>>
>> *message* */app/audio/download/some.html*
>>
>> *description* *The requested resource (/app/audio/download/some.html) is
>> not
>> available.*
>>
>> these html pages are static pages and exists in apache http home dir of
>> websites
>> public_html/app/audio/download/some.html
>>
>> but then i thought may be it need to exists in tomcat web apps too., so
>> under web-apps/app dir i created audio link to audio directory under
>> public_html
>>
>> so now webapps dir has following link
>> webapps/app/audio -> /home/mysite/public_html/audio
>>
>> so basically if i try to access any thing with
>> http://www.mysite.com/app/audio, it should be served from audio  dir in
>> webapps which in turn audio dir from appache httpd.
>>
>> But its not working. :(
>>
>> I dont know whats wrong.
>>
>> following is my java filter class
>>
>>public void doFilter(ServletRequest request, ServletResponse response,
>> FilterChain chain)
>>throws IOException, ServletException {
>>try
>>{
>>

Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Leon Rosenberg
I'm sorry, I can't shut up my mouth on this, but you are telling myths :-)

On Mon, Apr 27, 2009 at 6:46 PM, Robin Wilson  wrote:
> I can't answer for others - but one of the big values in a 'production' 
> environment is to separate concerns. The apache servers can sit in a 
> different DMZ area, and have >only static (and unprotected) content on them. 
> The tomcat servers have another firewall between them and the apache servers 
> - and they host the webapps, and have >access to protected content (which is 
> controlled via servlets). In addition, the apache servers have no access to 
> the databases, so an attacker would have to break >through both the apache 
> and the tomcat defenses in order to gain access to the database content.

Sorry, this is no security at all. If the attacker was able to break
your os once and come to your apache httpd server, he will be able to
break it second time and come to the tomcat serving server. Increasing
complexity doesn't necessary increase security, the truth is that more
complexity usually compromise security. Anyway an unfiltered
connection between your httpd and your tomcat server exist (ajp), and
the attacker can exploit it directly, since httpd will just send all
maped request 1 on 1.
Finally, httpd is written in C and therefore vulnerable to all kind of
attacks a java program is not like buffer/heap overflows,

>
> In addition to more granular security (as described above), having isolated 
> the web layer from the application layer allows you to independently adjust 
> the performance >of each. If you are finding that your system serves a lot 
> more static content than it does 'application' functionality, you may need 
> several web servers to handle the load. >Likewise, if your system is 
> application focused, you may need more tomcat servers (probably clustered) 
> than web servers.

The short answer to that would probably be, if you have performance
concerns, you just do not use apache httpd. If you want/need to
loadbalance, a hardware loadbalancer is the weapon of choice. If you
need to server a lot of large static content (pictures) you put
reverse proxies in front of your tomcats. If you need to serve static
content (js, css etc) along with dynamic content, you let tomcat
handle it, it serves static content faster than httpd anyway.

Imho, the only valid use for httpd in front of tomcat is when you are
a one-man one-server company and need to host a lot of virtual stuff
on your box including php and such. Everything else and you are better
of without httpd :-)

regards
Leon

P.S. to determine whether you need or do not need httpd in front of
your tomcat, stick with the KISS principle: ask yourself the question:
will it ease your pain and really really solve your problems without
adding new? In most cases the answer will be no :-)

>
> All that being said, it's really a matter of the needs for your particular 
> deployment. If you have no serious security concerns, and you don't need to 
> isolate the web load from the application server load - a single server 
> running tomcat is perfectly acceptable.
>
> --
> Robin D. Wilson
> Director of Web Development
> KingsIsle Entertainment, Inc.
> WORK: 512-623-5913
> CELL: 512-426-3929
> www.KingsIsle.com
>
>
>
> -Original Message-
> From: Elmar Haneke [mailto:el...@haneke.de]
> Sent: Monday, April 27, 2009 11:27 AM
> To: Tomcat Users List
> Subject: Re: Why we need two servers (httpd and tomcat)
>
>> And why do we need these two servers in the first place.
>
> Running tomcat in stand-alone-mode might be sufficient for an website
> not depending on modules available in httpd only (as PHP, mod_rewrite or
> server-side-includes).
>
> Elmar
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Filtering URL via tomcat

2009-04-27 Thread André Warnier


Ravi,

First :
> so basically if i try to access any thing with
> http://www.mysite.com/app/audio, it should be served from audio  dir in
> webapps which in turn audio dir from appache httpd.
>
> But its not working. :(
>
"its not working" is not something that allows anyone to help you.
HOW is it not working ? What do you do, what do you expect, and what are 
you getting as an error ?

That means :
- tell us what URL you are using in the browser
- what error do you see in the browser ?
- what error do you see in the Apache logfile ?
- and what error do you see in the Tomcat logfile ?

Then (old African proverb) : if you want to eat an elephant, you should 
do it a little bit at a time.


In other words, simplify the problem if you can.

Assuming that your Tomcat listens on port 8080 for example (you can see 
that in the conf/server.xml,  tags), try the following :

- turn off Apache httpd
- in the browser, enter the URL
http://www.mysiste.com:8080/app/audio/download/abc.html
(that goes to Tomcat directly, without going through Apache).
What happens then ?
Don't be afraid to add some details.



Ravi Sharma wrote:

Hi All,
Please help me for this problem, i am not able to get to the root of the
problem.

My site have few open/free pages which can be accessed by anyone/guests and
few only for registered users. So you can access those pages only by login
to the site

http://www.mysiste.com/audio/abc.html (anyone/guests can see this page)
http://www.mysiste.com/audio/app/download/abc.html (only logged in user can
see this page)

I am using tomcat 5.5 and appache httpd server 2.2.

the root of my site reside in appache httpd server
so i have folder structure like
mysite/public_html/audio
mysite/public_html/app/audio/download

in my httpd conf i have something like this
JkMount /app/audio/download/* ajp13w
..
..
..
and mysite.com is poiniting to mysite/public_html


*app* is my tomcat application context

and in tomcat web.xml one Filter is listning to url

DownLoadSecurityFilter
com.app.security.SecurityFilter


DownLoadSecurityFilter
/audio/download/*


So all the pages will be served by apache httpd except the pages which are
like app/audio/download.

So now when somone try to access app/audio/download/some.html the request
passed to tomcat, in turns filter check this url and if user is not logged
in then login screen comes up.
User login and proceed and login screen automcatically forward the request
to the page which was requested app/audio/download/some.html, but here i get
this tomcat error

*Type* Status report

*message* */app/audio/download/some.html*

*description* *The requested resource (/app/audio/download/some.html) is not
available.*

these html pages are static pages and exists in apache http home dir of
websites
public_html/app/audio/download/some.html

but then i thought may be it need to exists in tomcat web apps too., so
under web-apps/app dir i created audio link to audio directory under
public_html

so now webapps dir has following link
webapps/app/audio -> /home/mysite/public_html/audio

so basically if i try to access any thing with
http://www.mysite.com/app/audio, it should be served from audio  dir in
webapps which in turn audio dir from appache httpd.

But its not working. :(

I dont know whats wrong.

following is my java filter class

public void doFilter(ServletRequest request, ServletResponse response,
 FilterChain chain)
throws IOException, ServletException {
try
{
checkSecurity(request);
}
catch(UserNotLoggedIn ex)
{
httpResponse.sendRedirect(httpRequest.getContextPath() +
LOGINURL +"?URL=" + targetUrl);
return;
}
catch(OperationNotAllowedForUser ex)
{
httpResponse.sendRedirect(httpRequest.getContextPath() +
DENIENDURL );
return;
}
chain.doFilter(request, response);

doAfterProcessing(request, response);

}


private void doAfterProcessing(ServletRequest request, ServletResponse
response)
throws IOException, ServletException {
}

Thanks in advance
Ravi




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Filtering URL via tomcat

2009-04-27 Thread Ravi Sharma
Hi All,
Please help me for this problem, i am not able to get to the root of the
problem.

My site have few open/free pages which can be accessed by anyone/guests and
few only for registered users. So you can access those pages only by login
to the site

http://www.mysiste.com/audio/abc.html (anyone/guests can see this page)
http://www.mysiste.com/audio/app/download/abc.html (only logged in user can
see this page)

I am using tomcat 5.5 and appache httpd server 2.2.

the root of my site reside in appache httpd server
so i have folder structure like
mysite/public_html/audio
mysite/public_html/app/audio/download

in my httpd conf i have something like this
JkMount /app/audio/download/* ajp13w
..
..
..
and mysite.com is poiniting to mysite/public_html


*app* is my tomcat application context

and in tomcat web.xml one Filter is listning to url

DownLoadSecurityFilter
com.app.security.SecurityFilter


DownLoadSecurityFilter
/audio/download/*


So all the pages will be served by apache httpd except the pages which are
like app/audio/download.

So now when somone try to access app/audio/download/some.html the request
passed to tomcat, in turns filter check this url and if user is not logged
in then login screen comes up.
User login and proceed and login screen automcatically forward the request
to the page which was requested app/audio/download/some.html, but here i get
this tomcat error

*Type* Status report

*message* */app/audio/download/some.html*

*description* *The requested resource (/app/audio/download/some.html) is not
available.*

these html pages are static pages and exists in apache http home dir of
websites
public_html/app/audio/download/some.html

but then i thought may be it need to exists in tomcat web apps too., so
under web-apps/app dir i created audio link to audio directory under
public_html

so now webapps dir has following link
webapps/app/audio -> /home/mysite/public_html/audio

so basically if i try to access any thing with
http://www.mysite.com/app/audio, it should be served from audio  dir in
webapps which in turn audio dir from appache httpd.

But its not working. :(

I dont know whats wrong.

following is my java filter class

public void doFilter(ServletRequest request, ServletResponse response,
 FilterChain chain)
throws IOException, ServletException {
try
{
checkSecurity(request);
}
catch(UserNotLoggedIn ex)
{
httpResponse.sendRedirect(httpRequest.getContextPath() +
LOGINURL +"?URL=" + targetUrl);
return;
}
catch(OperationNotAllowedForUser ex)
{
httpResponse.sendRedirect(httpRequest.getContextPath() +
DENIENDURL );
return;
}
chain.doFilter(request, response);

doAfterProcessing(request, response);

}


private void doAfterProcessing(ServletRequest request, ServletResponse
response)
throws IOException, ServletException {
}

Thanks in advance
Ravi


RE: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Robin Wilson
I can't answer for others - but one of the big values in a 'production' 
environment is to separate concerns. The apache servers can sit in a different 
DMZ area, and have only static (and unprotected) content on them. The tomcat 
servers have another firewall between them and the apache servers - and they 
host the webapps, and have access to protected content (which is controlled via 
servlets). In addition, the apache servers have no access to the databases, so 
an attacker would have to break through both the apache and the tomcat defenses 
in order to gain access to the database content.

In addition to more granular security (as described above), having isolated the 
web layer from the application layer allows you to independently adjust the 
performance of each. If you are finding that your system serves a lot more 
static content than it does 'application' functionality, you may need several 
web servers to handle the load. Likewise, if your system is application 
focused, you may need more tomcat servers (probably clustered) than web servers.

All that being said, it's really a matter of the needs for your particular 
deployment. If you have no serious security concerns, and you don't need to 
isolate the web load from the application server load - a single server running 
tomcat is perfectly acceptable.

--
Robin D. Wilson
Director of Web Development
KingsIsle Entertainment, Inc.
WORK: 512-623-5913
CELL: 512-426-3929
www.KingsIsle.com



-Original Message-
From: Elmar Haneke [mailto:el...@haneke.de] 
Sent: Monday, April 27, 2009 11:27 AM
To: Tomcat Users List
Subject: Re: Why we need two servers (httpd and tomcat)

> And why do we need these two servers in the first place.

Running tomcat in stand-alone-mode might be sufficient for an website
not depending on modules available in httpd only (as PHP, mod_rewrite or
server-side-includes).

Elmar

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Elmar Haneke
> And why do we need these two servers in the first place.

Running tomcat in stand-alone-mode might be sufficient for an website
not depending on modules available in httpd only (as PHP, mod_rewrite or
server-side-includes).

Elmar

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: what is mod_jk parameter "connection_pool_timeout" in mod_proxy / mod_proxy_ajp / apache httpd?

2009-04-27 Thread Rainer Jung
On 27.04.2009 17:39, Arne Riecken wrote:
> Thanks, I did that bevore posting but did not understand id clearly. There
> is written:
> 
> "Any connections above smax are subject to a time to live or ttl. Apache
> will never create more than the Hard Maximum or max connections to the
> backend server."
> 
> "smax [...] Upto the Soft Maximum number of connections will be created on
> demand."
> 
> "max [...] In the Prefork MPM, this is always 1"
> 
> Because I use mpm-prefork as mentioned, default smax=max=1. Does it make
> sense to set smax to 0 to get a ttl for the one and only connection?

I would say "yes, it does make sense."

> So
> "zero connections will be created on demand"? Is it bad not to have a ttl
> for the one and only connection? When will that connection be closed without
> ttl? When Tomcat connectionTimeout triggers?

Yes, but then you rely on httpd to correctly detect the closed
connection. Usually you do that via activating cping/cpong. I would use
a ttl value as a kind of double safety net.

Whether closing idle connections or not is also related to

- what kind of connection pool is the backend using (relation to backend
threads, and how precious your thread resources are)

- are there other systems influencing idle connections between the web
server and the backend (like a firewall dropping idle connections)

Regards,

Rainer

> 2009/4/26 Rainer Jung 
> 
>> Look for "ttl" on page http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: web interface for tomcat service

2009-04-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Venky,

On 4/27/2009 10:12 AM, Venky Vasant wrote:
> Its windows.. the reasons are one of our deployment server is also
> some kind of network server where i cant login and depend on some one
> else to do this for me everytime i have restart.

You will need some other kind of server to manage Tomcat, then. Are you
running Apache httpd? If not, you'll want something like httpd (or even
a second Tomcat instance) that can react to your requests by re-starting
Tomcat for you.

A simple .bat written for Windows should be runnable through httpd, or
you could write all the nasty Java required to kill the running Tomcat
(basically, run bin/shutdown.bat) and then start Tomcat again
(bin/startup.bat). Don't forget to pause for a few seconds before you
restart Tomcat or odd things may happen.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkn102oACgkQ9CaO5/Lv0PD42gCguwgv0L5NO5xSFEK3mnTKdpRt
uawAnig70s66L5ATNLy9ZHHBXkyBqiQn
=F7Sg
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: customize HTTP Status 401 error page

2009-04-27 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 4/24/2009 11:35 AM, Caldarale, Charles R wrote:

I'm not sure what you're trying to accomplish by defining an error
page for a 401 status; my understanding is that a 401 just triggers
the login dialog for the browser - there's no HTML or other data to
display with the status.


If the client aborts (such as too many attempts or user chooses "cancel"
instead of submitting credentials), the 401 page will be displayed, so
there is some utility in defining a page for this status if HTTP Auth
will be used.


Let's nitpick here.
If you're using IE, you may define 401 pages all you want, it's going to 
show its own anyway.

;-)


(ok, unless you think of making your 401 page larger than 1024 bytes or 
so, and probably also turn off its "friendly error messages" option).


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: what is mod_jk parameter "connection_pool_timeout" in mod_proxy / mod_proxy_ajp / apache httpd?

2009-04-27 Thread Arne Riecken
Thanks, I did that bevore posting but did not understand id clearly. There
is written:

"Any connections above smax are subject to a time to live or ttl. Apache
will never create more than the Hard Maximum or max connections to the
backend server."

"smax [...] Upto the Soft Maximum number of connections will be created on
demand."

"max [...] In the Prefork MPM, this is always 1"

Because I use mpm-prefork as mentioned, default smax=max=1. Does it make
sense to set smax to 0 to get a ttl for the one and only connection? So
"zero connections will be created on demand"? Is it bad not to have a ttl
for the one and only connection? When will that connection be closed without
ttl? When Tomcat connectionTimeout triggers?



2009/4/26 Rainer Jung 

> Look for "ttl" on page http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
> .
>
>


RE: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Peter Crowther
> From: Vinay Nagrik [mailto:vnag...@gmail.com]
> Can someone explain to me the basic difference between httpd
> and tomacat serer.  What one can do so the other can not do.

Apache httpd can serve static content over HTTP.  It can have modules plugged 
in (CGI, perl, PHP) to serve various kinds of dynamic content.  It has many 
modules, and very flexible configuration options.  It is written in C and needs 
to be compiled for each platform.  It cannot serve Java servlet content; for 
that you need a Java servlet container, which you can connect to it in various 
ways.

Apache Tomcat is a Java servlet specification-compliant servlet container.  It 
can serve static content over HTTP.  It has built-in facilities for serving 
Java servlets, and requires no modules to do this.  It has relatively few 
modules, and some configuration has to be done in code where Apache httpd 
allows configuration through files.  It is written in Java, and portable to any 
platform able to run a (sensible) Java virtual machine.  It can be connected to 
Apache httpd in various ways so that httpd can appear to serve servlet content.

> And why do we need these two servers in the first place.

Because httpd doesn't serve Java servlets (and Tomcat doesn't serve perl and 
PHP efficiently, though it's pretty good at static content).  Even if httpd did 
everything, someone would write a "pure Java" web server and servlet container, 
because Java developers are like that :-).

- Peter

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread David kerber

Vinay Nagrik wrote:

Hello Group,

Can someone explain to me the basic difference between httpd and tomacat
serer.  What one can do so the other can not do.  And why do we need these
two servers in the first place.

I will appreciate this.

  
While there is some overlap in their functionality, there is a need for 
both.  Tomcat is a servlet container, which lets you run jsp and java on 
the server side; httpd doesn't do this.  Tomcat also serves plain html 
pages efficiently, as does httpd.  I don't use httpd at all, so somebody 
else will describe it in more detail.


D



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Scheduling tasks in Tomcat

2009-04-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aden,

On 4/27/2009 4:18 AM, Aden Jones wrote:
> Ive got everything else working but have two tasks
> that need to be run at a certain time of the week.

Dan suggests using Java's Timer class. Lots of folks also use Quartz
(http://www.opensymphony.com/quartz/).

I'd like to recommend the use of good-old cron (or Windows Scheduler if
you're using Windows). If the webapp /must/ be self-contained, then so
be it, but I prefer to use cron so it's not tied to the webapp itself.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkn1zT8ACgkQ9CaO5/Lv0PAXaACfQyUtcT5Eo3j9nfVaHThA+flD
ALQAoLiklOPd35MRvPe2Tuj0PsK776sk
=Tayj
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread Mihamina Rakotomandimby (R12y)

George Sexton wrote:

You really don't need to have Apache httpd running.


Vinay didn't talk about Apache as HTTP ;-)
It could have been LightHTTPd or something else :-P

I think Vinay should know that Tomcat embeds an HTTP server.

--
 Chef de projet chez Vectoris
 Phone: +261 33 11 207 36
System: xUbuntu 8.10 with almost all from package install
   http://www.google.com/search?q=mihamina+rakotomandimby

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Why we need two servers (httpd and tomcat)

2009-04-27 Thread George Sexton
You really don't need to have Apache httpd running. OTOH, if you want 
things like PHP, Perl CGI, etc, then you need httpd.


For our application, we run Tomcat on port 80 and do not use Apache/mod_jk.

Vinay Nagrik wrote:

Hello Group,

Can someone explain to me the basic difference between httpd and tomacat
serer.  What one can do so the other can not do.  And why do we need these
two servers in the first place.

I will appreciate this.



--
George Sexton
MH Software, Inc.
Voice: +1 303 438 9585
URL:   http://www.mhsoftware.com/

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Dynamic Aliases and db connections?

2009-04-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ray,

On 4/26/2009 10:00 PM, Raymond Kleijngeld wrote:
> I'm writing an application to support multiple clients using the same
> tomcat application. For security purposes I want each client to have
> there own database schema and subsequently their own subdomain i.e.
> sub1.domain.com, sub2.domain.com etc. 
> 
> I know I can update the server.xml file and add extra resource tags and
> extra alias tags for each new client but I don't want the tomcat server
> to be restarted because this would interupt the service/application to
> other clients.

The hostnames must be configured in server.xml. See André's post for
more information on that.

You can configure your database resources in your webapp's
META-INF/context.xml file. Something like this:


   


When these resources are configured within the webapp, re-deploying the
webapp is enough to update the configuration. There appears to be a bug
in Tomcat where application-defined DataSources are not shut down when
the application is undeployed. I suspect a re-deploy will replace the
configuration, but if you find that you are running out of db
connections on the server-side, you may want to look into this as a
possibility.

Good luck,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkn1yY0ACgkQ9CaO5/Lv0PDu9QCfVepWutXbMttUvzBvoiYNACDy
wCoAn0i5iMQchRykPzUcsqiZfSwg81fg
=TMgr
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: How do I host multiple websites with Apache2 and Tomcat Cluster ??

2009-04-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Phil,

On 4/26/2009 2:47 AM, nohacks wrote:
> How you host multiple websites with Apache2 and Tomcat Cluster ??

When you say "multiple websites" do you mean "multiple webapps"? Serving
multiple web applications should not be a problem at all:

> JkMount /*.jsp loadbalancer
> JkMount /*.jsf loadbalancer

This appears to be a set up for a single webapp, but can certainly be
used to power several sites:

/app1/index.jsp
/app2/index.jsp
/app3/index.jsp

All of these will be sent to Tomcat using the "loadbalancer" worker.
Tomcat will determine which webapp should receive each request.

> JkMount /servlet/* loadbalancer

Use of the "/servlet" request dispatcher is not recommended. If you have
servlets using this, you might want to consider migrating to a setup
where each servlet is explicitly defined in your web.xml to make a
unique URL. You may already be doing this but have retained the /servlet
prefix for historical reasons. I figured I'm mention it, though.

> JkMount /* loadbalancer

Technically speaking, this JkMount covers all 3 previous JkMount
statements, so the others are not necessary. But, since you are using
httpd in the first place, why not have it serve your static content for
you? If I were you, I'd remove this JkMount and direct httpd to serve
static files for you, while delegating to Tomcat for things like JSPs
and servlets.

Also, I like to specifically mount each web application separately. I
happen to use different workers for each webapp (I have separate
back-end Tomcats for each one) so I /must/ do this, but it helps
document the httpd configuration file, too:

JkMount /app1/*.jsp loadbalancer
JkMount /app1/*.jsf loadbalancer

JkMount /app2/*.jsp loadbalancer
JkMount /app2/*.jsf loadbalancer

JkMount /app3/*.jsp loadbalancer
JkMount /app3/*.jsf loadbalancer

> It would be nice to have separate log files ??

You can use separate log files within the same VirtualHost section by
using environment variables:

SetEnvIf Request_URI "^/app1/" app1
CustomLog logs/app1.log env=app1

See
http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#customlog

> I am using AJP and wondering how this would work. Also, with sticky sessions
> and separate websites ??

The use of sticky sessions should have no impact on multiple webapps.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkn1x8kACgkQ9CaO5/Lv0PBKcACfZNKsAURI7lbVL3wW9VLpG1dc
oekAn17a1fq3yRKs7cLu7qlgP/b4N31i
=gfTd
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Why we need two servers (httpd and tomcat)

2009-04-27 Thread Vinay Nagrik
Hello Group,

Can someone explain to me the basic difference between httpd and tomacat
serer.  What one can do so the other can not do.  And why do we need these
two servers in the first place.

I will appreciate this.

-- 
Thanks

Nagrik


OT: GoDaddy Hosting and Tomcat

2009-04-27 Thread George Sexton

I thought I'd write up my experiences trying to get a servlet
application running on GoDaddy. Perhaps it will save someone else some pain.

I have a Java Servlet calendar application. It's a stable app and I've
got at least a thousand of running copies. I was attempting to install
it on GoDaddy's shared Linux hosting service which runs Tomcat 5.0.27.

Reading the documentation on their site, it looked like all I had to do
was upload the WAR file and wait until 1:00 AM Arizona time and the
application should be deployed. I did this and waited. The next day, I
found the application had not deployed. A call to technical support
revealed that I had to go to a certain corner of the hosting control
panel and enable Java language support. I did that and waited until the
next day.

This is one of the problems with their shared hosting account. ANY
change takes until the next day to take effect.

The next day, I looked, and the WAR file had been exploded but my App
didn't work. Since my App has a dependency on the database, I uploaded a
simple JSP to test the DB Connection. It worked. Attempts to view the
error logs failed.

I called GoDaddy support. The technician told me I need to enable error
logging. He walked me through the control panel and I enabled error
logging. I waited until the next day.

The application still didn't work. When I tried to view the error logs,
I got nothing. Another call to technical support revealed that the error
logs I had enabled would not actually contain any Tomcat log data.

I had my call escalated to a manager. I explained to him the reason I
knew my application was not working. I told him the login page was not
available. His response was "Yeah, there's no file with that name." I
told him that the URL was a virtual mapping created in the web.xml file.
After literally an hour, they came back on-line and told me that they
were going to open a trouble-ticket and call me back.

Several hours later, I got an Email from support saying. "It doesn't
work because there's no file with that name."

At this point, I had a funny feeling. I created a simple WAR file with
one servlet and a web.xml deployment descriptor. The deployment
descriptor mapped three URLs to the servlet:

/MapTest.xyz
/MapTest.jsp
/MapTest.html

I waited until the next day. Sure enough, I could access MapTest.xyz,
and MapTest.jsp. Attempts to access MapTest.html generated a 404 Not
Found error. This explains why my application was not running. All my
servlets are mapped into URLs with extension of .html. This was a design
decision because customers generally want the maximum visibility to
search engines.

So, what I found is that GoDaddy.com does not pass all requests into the
servlet container. It attempts to service as many requests with Apache
first, and then only passes the non-mapped requests into Tomcat. There
are some 50 file extensions GoDaddy co-opts including .css, .xml, and .js.

This configuration actually causes their deployment of Tomcat to be
non-compliant with the Servlet API version 2.3 specification. Section
SRV.11.2.1 says that explicit mappings in the deployment descriptor must 
take precedence over implicit mappings. Taken as a SYSTEM, their

deployment of Apache Tomcat is non-compliant.

My feeling is that ANY request that maps to a deployed context must be
passed to the servlet container. Clearly, they are not doing that.

So, after all the effort, I get to tell the customer that my application
will not work on their hosting account. Rats.

In general, even if your application isn't using servlet mapping I can't
recommend them. Since it takes until the next day before you can
re-deploy a WAR file, and there are no Tomcat logs available, it would
be a really rotten experience.


--
George Sexton
MH Software, Inc.
Voice: +1 303 438 9585
URL:   http://www.mhsoftware.com/


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: #include'ing property files into conf/catalina.properties

2009-04-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Uma,

On 4/26/2009 11:46 AM, uma...@comcast.net wrote:
> I am looking for a mechanism that would do the inclusion
> at runtime (as in when Tomcat starts up). Hence I am unable
> to use gcc. I assumed that the Java property files intrinsically
> support #include making this transparent to Tomcat itself.
> Perhaps I am mistaken?

Neither Java nor Tomcat do this at all. You will have to make your own
arrangements.

One option is to use Apache ant to start your Java processes. If you are
setting system properties, ant can run a Java process and specify system
properties for you on the command-line, including using wildcards for
selecting properties (like "myapp.*" I think).

If you'd rather run startup.sh (which I think is a good idea), you can
also merge those parameters into the JAVA_OPTS environment variable that
the shell script will use to invoke Java, which will result in those
properties being set.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkn1w4EACgkQ9CaO5/Lv0PCwgQCgo0Nj6YXhG8k7aWcix28CX+ZY
KOcAoLYJSgLHT9jRYgshzbgKAxgyHjhe
=6kkC
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: customize HTTP Status 401 error page

2009-04-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 4/24/2009 11:35 AM, Caldarale, Charles R wrote:
> I'm not sure what you're trying to accomplish by defining an error
> page for a 401 status; my understanding is that a 401 just triggers
> the login dialog for the browser - there's no HTML or other data to
> display with the status.

If the client aborts (such as too many attempts or user chooses "cancel"
instead of submitting credentials), the 401 page will be displayed, so
there is some utility in defining a page for this status if HTTP Auth
will be used.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkn1wYgACgkQ9CaO5/Lv0PBYcgCfXtuc8344m3cBkQYQDxqq+TTK
86oAn0+LZoOvruSeLFj2DG6C9/+UO8zD
=VJ/C
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread David Rush
Martin:

I'm aware that Apache httpd will do that for its pages.  But in my case it 
appears the reverse proxy forwarding is happening before httpd would try to add 
the index.html, indicated by Tomcat access log showing a request to 
/Construction/ without the index.html.

It also appears that Tomcat (rather than Apache httpd) is initially responding 
to my http://myserver/Construction URL with a 302 (Moved Temporarily) and a 
suggestion that the browser try http://myserver/Construction/ (with trailing 
slash), as it should.  I say Tomcat's doing that rather than Apache httpd since 
the 302 response says it's from Apache-Coyote/1.1 rather than Apache/2.2.11.

Anyway, it appears that adding the setContentType("text/html") before the 
include() calls has fixed my problem.

Thanks for your help.

David

Martin Gainty wrote:
> David
> 
> Apache will automaticly append index.html to requested folder via
> http://httpd.apache.org/docs/1.3/mod/mod_dir.html#directoryindex
> 
> Does this help?
> Martin 
> __ 
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note 
> de déni et de confidentialité 
> This message is confidential. If you should not be the intended receiver, 
> then we ask politely to report. Each unauthorized forwarding or manufacturing 
> of a copy is inadmissible. This message serves only for the exchange of 
> information and has no legal binding effect. Due to the easy manipulation of 
> emails we cannot take responsibility over the the contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
> dem Austausch von Informationen und entfaltet keine rechtliche 
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
> wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
> est interdite. Ce message sert à l'information seulement et n'aura pas 
> n'importe quel effet légalement obligatoire. Étant donné que les email 
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
> aucune responsabilité pour le contenu fourni.
> 
> 
> 
> 
> 
> 
>> Date: Mon, 27 Apr 2009 14:46:25 +0100
>> From: p...@pidster.com
>> To: users@tomcat.apache.org
>> Subject: Re: Browser shows source of .jsp file. Why?
>>
>> David Rush wrote:
>>> Pid:
>>>
>>> Yes, I've removed the explicit mapping.
>>>
>>> "Sometimes" because when I use the URL http://myserver:8080/Construction 
>>> (direct to Tomcat listening port) it works fine (HTML is rendered).
>>> When I use http://myserver/Construction (via reverse proxy forwarding 
>>> through Apache httpd) it fails (I get HTML markup in the browser window).
>> What about "http://myserver/Construction/"; (note extra slash)
>>
>>> When I use http://myserver/Construction/index.html (where index.html is 
>>> mapped in web.xml to a controller servlet and index.html is my sole 
>>> welcome-file) it works fine.
>>>
>>> I'm not using AJP.  I'm just using straight reverse-proxy style HTTP 
>>> forwarding with mod_proxy, with this snippet from my httpd.conf file:
>> (Sorry, I spotted that after I'd sent the reply.)
>>
>>
>>> ...
>>> ProxyPass/Construction http://localhost:8080/Construction
>>> ProxyPassReverse /Construction http://localhost:8080/Construction
>>> ...
>>>
>>> My Apache httpd docroot has always been separate and distinct from my 
>>> Tomcat webapps directory.
>> Looking at your headers again, I see that Tomcat is trying to serve the
>> result as plain html.  What happens if you use "index.jsp" as the sole
>> welcome file (and map that to the controller, obviously)?
>>
>> Check "index.jsp" is included in the DirectoryIndex in HTTPD.
>>
>>
>> p
>>
>>
>>
>>> David
>>>
>>> Pid wrote:
 David Rush wrote:
> I checked my web.xml, and found no mime-mapping elements at all.  I tried 
> adding one explicitly mapping the jsp extension to text/html, but it had 
> no effect.  I'm still getting HTML markup in the browser window with 
> Firefox.
>
> David
 Ignore that, it's a red herring, you don't need to add mime-mappings.

 You say the problem occurs 'sometimes' with Firefox, can you elaborate
 on which times and if there's a commonality between these requests?


 The fault is usually in the AJP mapping you've configured.  Are you
 using mod_jk, and if so, what is the config?

 Also, try splitting your HTTP docroot and Tomcat webapps folders (a
 correct mapping will mean it still works properly).  If the JSPs are in
 another location than the HTTP docs, they can't be served as raw HTML,
>>>

Re: customize HTTP Status 401 error page

2009-04-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jill,

On 4/24/2009 10:55 AM, Jill Han wrote:
> At this point, I just explored the options between basic and form-based 
> authentication.
> No real webapp is build yet. The displayed name is just directory name, app1, 
> under webapps.

I think it would be helpful if you were to post your entire web.xml
file. Also, are you using Tomcat all by itself, or are you using Apache
httpd or some other web server out in front? That could be complicating
things. If you /are/ using httpd, please post the configuration you use
to connect the two.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkn1wGgACgkQ9CaO5/Lv0PDbGwCfQJSNGaw0tzr/4ZGwxRnZwlBJ
cOYAmwQ8SB0MwNfOWGRsD0+SUzEJ+owH
=f2OE
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat shutdown problem

2009-04-27 Thread Pid
S Arvind wrote:
> Pid very thanks for guiding me ..  one more help alone... can u please tell
> me how to check which thread it is runnin by quartz other then checking code
> ... i am centos, jvm 5, tomcat 5 and tomcat 6..  i think i am disturbin u
> lot, but   ...

As Dan said, "kill -QUIT ", and as I said previously, familiarise
yourself with jstack, jmap and possibly jconsole, all of which are
command line tools available with the Sun JREs.

p


> -Arvind S
> 
> *
> "Many of lifes failure are people who did not realize how close they were to
> success when they gave up."
> -Thomas Edison*
> 
> 
> On Mon, Apr 27, 2009 at 7:18 PM, Pid  wrote:
> 
>> S Arvind wrote:
>>> Is the application completely unchanged for deployment on Tomcat 6?
> yes it is completely *unchanged*... is anything must be changed for
>>> quartz?
>> okay, then your best bet is to explore what the JVM is doing after
>> shutdown and check which threads are still running.
>>
>> p
>>
>>
>>
>>> --Arvind S
>>>
>>> *
>>> "Many of lifes failure are people who did not realize how close they were
>> to
>>> success when they gave up."
>>> -Thomas Edison
>>> *
>>>
>>> On Sat, Apr 25, 2009 at 5:06 PM, Pid  wrote:
>>>
 Please do not keep using "reply to all".  It is annoying and
 unnecessary.  I will obviously receive a copy of the mail if you just
 send a reply to the list.

> Did you write your application?
>>> there are team of 200 Engineers wrote that application so i dont know
> where the problem is
> Are you using Quartz in your application?
>>> yeah we have quartz scheduler in our application. But when we run in
> Tomcat 5 we dont have this kind of problem
 Is the application completely unchanged for deployment on Tomcat 6?

 When you shutdown, Quartz will log a message describing the number of
 running threads, this may help diagnose the problem.  The count may be
 above 20, but that isn't necessarily a bad thing.


> Are you starting new Threads in your app?
>>> Might be, i have to ask each team.
 Check that they are being properly terminated.  Even if the devs promise
 they are, double check.

> When you have started and stopped the application a few times are there
> still multiple java processes running?
>>> YES, this is the only thing assigned to me to correct it.
 You should ensure that the old processes are terminated before starting
 new ones, as an old one may hang onto one of the ports that Tomcat uses,
 thus preventing new instances from starting up.

 The Linux "kill" command can do this.


 However...

 After shutdown has been requested and while the process is still
 running, take a thread dump, or use the java tools to examine the state
 of the JVM.  See if you can spot which Threads are still running.

 Try jmap, jstack and jconsole (if you're on a local machine).


 p




> *"Many of lifes failure are people who did not realize how close they
 were
> to success when they gave up."
> -Thomas Edison
> *
>
> On Sat, Apr 25, 2009 at 2:21 PM, Pid  wrote:
>
>> S Arvind wrote:
>>> Thanks pid...
>>>
>>> Can u able to give me more idea to solve it if possible..
>> Did you write your application?
>>
>> Are you using Quartz in your application?
>>
>> Are you starting new Threads in your app?
>>
>> When you have started and stopped the application a few times are
>> there
>> still multiple java processes running?
>>
>>
>> p
>>
>>
>>> Thanks,
>>> Arvind S
>>>
>>>
>>> *"Many of lifes failure are people who did not realize how close they
>> were
>>> to success when they gave up."
>>> -Thomas Edison
>>> *
>>>
>>> On Sat, Apr 25, 2009 at 2:00 PM, Pid  wrote:
>>>
 S Arvind wrote:
> A wierd problem occur while shutdowning the tomcat 6 in the Fedora
 and
> Centos. Usually i use shell file to shutdown. After shutting down
 when
 see
> the postgre preocess by  [code]*ps -ef | grep java*[/code] it is
 still
 showing
> the process as running.
>
> such as
>
> [code]  tomcat   14694 1 72 Apr23 ?23:44:25
> /usr/java/jdk1.5.0_13/jre/bin/java
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>
>> -Djava.util.logging.config.file=/usr/share/tomcat6/apache-tomcat-6.0.18/conf/logging.properties
> -verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:MaxPermSize=512M
> -Xms1024M -Xmx1024M -Djava.awt.headless=true
>
>> -Djava.endorsed.dirs=/usr/share/tomcat6/apache-tomcat-6.0.18/endorsed
> -classpath
>> :/usr/share/tomcat6/apache-tomcat-6.0.18/bin/bootstrap.jar
> -Dcatalina.base=/usr/share/tomcat6/apache-tomcat-6.0.18
> -Dcatalina.home

Re: web interface for tomcat service

2009-04-27 Thread Venky Vasant
Its windows.. the reasons are one of our deployment server is also some kind of 
network server where i cant login and depend on some one else to do this for me 
everytime i have restart.   

Regards
Venkat



From: André Warnier 
To: Tomcat Users List 
Sent: Monday, April 27, 2009 7:32:26 PM
Subject: Re: web interface for tomcat service

Venky Vasant wrote:
> Is there a way i can start/stop tomcat service  through a web interface which 
> is right now setup as a service .. 
Maybe.
Now if you were as kind as indicating which Tomcat you are talking about, under 
which kind of platform, you may get better answers.
Maybe also a word or two about why you want to be able to do that ?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


  

Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread David Rush
The URL http://myserver/Construction/ (with trailing slash) yields the same 
results as http://myserver/Construction (without trailing slash).

I think I may have solved the problem.  I didn't write this webapp, but have 
inherited it so I'm still learning it's inner workings.

The controller servlet is using three 

rd = req.getRequestDispatcher("something.jsp");
rd.include(req,resp);

blocks (with essentially header, main content, and footer .jsp files) to 
assemble the final output page.  Initially there was no req.setContentType() at 
all.  Once I added req.setContentType("text/html") it appears to have resolved 
the problem.

w00t.

I've used rd.forward() and don't think I ever had to use setContentType(), but 
have never used rd.include() in my own webapps.  I guess since include() adds 
only a portion of a page, you have to treat the whole deal more like a servlet 
and explicitly set the content-type.

Thanks for the help.

David

Pid wrote:
> David Rush wrote:
>> Pid:
>>
>> Yes, I've removed the explicit mapping.
>>
>> "Sometimes" because when I use the URL http://myserver:8080/Construction 
>> (direct to Tomcat listening port) it works fine (HTML is rendered).
>> When I use http://myserver/Construction (via reverse proxy forwarding 
>> through Apache httpd) it fails (I get HTML markup in the browser window).
> 
> What about "http://myserver/Construction/"; (note extra slash)
> 
>> When I use http://myserver/Construction/index.html (where index.html is 
>> mapped in web.xml to a controller servlet and index.html is my sole 
>> welcome-file) it works fine.
>>
>> I'm not using AJP.  I'm just using straight reverse-proxy style HTTP 
>> forwarding with mod_proxy, with this snippet from my httpd.conf file:
> 
> (Sorry, I spotted that after I'd sent the reply.)
> 
> 
>> ...
>> ProxyPass/Construction http://localhost:8080/Construction
>> ProxyPassReverse /Construction http://localhost:8080/Construction
>> ...
>>
>> My Apache httpd docroot has always been separate and distinct from my Tomcat 
>> webapps directory.
> 
> Looking at your headers again, I see that Tomcat is trying to serve the
> result as plain html.  What happens if you use "index.jsp" as the sole
> welcome file (and map that to the controller, obviously)?
> 
> Check "index.jsp" is included in the DirectoryIndex in HTTPD.
> 
> 
> p
> 
> 
> 
>> David
>>
>> Pid wrote:
>>> David Rush wrote:
 I checked my web.xml, and found no mime-mapping elements at all.  I tried 
 adding one explicitly mapping the jsp extension to text/html, but it had 
 no effect.  I'm still getting HTML markup in the browser window with 
 Firefox.

 David
>>> Ignore that, it's a red herring, you don't need to add mime-mappings.
>>>
>>> You say the problem occurs 'sometimes' with Firefox, can you elaborate
>>> on which times and if there's a commonality between these requests?
>>>
>>>
>>> The fault is usually in the AJP mapping you've configured.  Are you
>>> using mod_jk, and if so, what is the config?
>>>
>>> Also, try splitting your HTTP docroot and Tomcat webapps folders (a
>>> correct mapping will mean it still works properly).  If the JSPs are in
>>> another location than the HTTP docs, they can't be served as raw HTML,
>>> by accident.
>>>
>>>
>>> p
>>>
>>>
>>>
>>>
>>>
 Martin Gainty wrote:
> David
>
> did you check your mime-mapping in your web.xml 
> perchance are you mapping jsp to text/plain?
> is any other extension mapped to text/plain?
>
> 
> jsp
> text/plain
> 
>
> Martin 
> __ 
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / 
> Note de déni et de confidentialité 
> This message is confidential. If you should not be the intended receiver, 
> then we ask politely to report. Each unauthorized forwarding or 
> manufacturing of a copy is inadmissible. This message serves only for the 
> exchange of information and has no legal binding effect. Due to the easy 
> manipulation of emails we cannot take responsibility over the the 
> contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede 
> unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese 
> Nachricht dient lediglich dem Austausch von Informationen und entfaltet 
> keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit 
> von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas 
> le destinataire prévu, nous te demandons avec bonté que pour satisfaire 
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la 
> copie de ceci est interdite. Ce message sert à l'information seulement et 
> n'aura pas n'importe quel effet légalement obligato

Re: web interface for tomcat service

2009-04-27 Thread André Warnier

Venky Vasant wrote:
Is there a way i can start/stop tomcat service  through a web interface which is right now setup as a service .. 


Maybe.
Now if you were as kind as indicating which Tomcat you are talking 
about, under which kind of platform, you may get better answers.

Maybe also a word or two about why you want to be able to do that ?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: web interface for tomcat service

2009-04-27 Thread Venky Vasant
Actually not . i generally start/stop on windows services utility but wanted 
know if it can be done on web interface like tomcat manager .

Regards
Venkat





From: Martin Gainty 
To: Tomcat Users List 
Sent: Monday, April 27, 2009 7:14:57 PM
Subject: RE: web interface for tomcat service


I'm assuming you want to start TC from within your IDE?

Eclipse IDE 
http://www.ibm.com/developerworks/library/os-ectom/

and Netbeans 
http://www.theserverside.com/discussions/thread.tss?thread_id=19934

Either option allows you to start TC within IDE

is this what your'e looking for?
Martin 
__ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de 
déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.






> Date: Mon, 27 Apr 2009 06:32:15 -0700
> From: venkat...@yahoo.com
> Subject: web interface for tomcat service
> To: users@tomcat.apache.org
> 
> Is there a way i can start/stop tomcat service  through a web interface which 
> is right now setup as a service .. 
> 
> Thanks
> Venkat
> 
> 
>      

_
Rediscover Hotmail®: Get e-mail storage that grows with you. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009


  

Re: Scheduling tasks in Tomcat

2009-04-27 Thread Dan Armbrust
The simplest way to do this is to learn the Timer API:

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Timer.html

Then put your timer code into a new servlet that you add to your
webapp.  Or add your code to an existing servlet in your webapp.

There are plenty of other open source scheduling API's as well, but
you probably don't need them for anything this simple.

Dan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Browser shows source of .jsp file. Why?

2009-04-27 Thread Martin Gainty

David

Apache will automaticly append index.html to requested folder via
http://httpd.apache.org/docs/1.3/mod/mod_dir.html#directoryindex

Does this help?
Martin 
__ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de 
déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.






> Date: Mon, 27 Apr 2009 14:46:25 +0100
> From: p...@pidster.com
> To: users@tomcat.apache.org
> Subject: Re: Browser shows source of .jsp file. Why?
> 
> David Rush wrote:
> > Pid:
> > 
> > Yes, I've removed the explicit mapping.
> > 
> > "Sometimes" because when I use the URL http://myserver:8080/Construction 
> > (direct to Tomcat listening port) it works fine (HTML is rendered).
> > When I use http://myserver/Construction (via reverse proxy forwarding 
> > through Apache httpd) it fails (I get HTML markup in the browser window).
> 
> What about "http://myserver/Construction/"; (note extra slash)
> 
> > When I use http://myserver/Construction/index.html (where index.html is 
> > mapped in web.xml to a controller servlet and index.html is my sole 
> > welcome-file) it works fine.
> > 
> > I'm not using AJP.  I'm just using straight reverse-proxy style HTTP 
> > forwarding with mod_proxy, with this snippet from my httpd.conf file:
> 
> (Sorry, I spotted that after I'd sent the reply.)
> 
> 
> > ...
> > ProxyPass/Construction http://localhost:8080/Construction
> > ProxyPassReverse /Construction http://localhost:8080/Construction
> > ...
> > 
> > My Apache httpd docroot has always been separate and distinct from my 
> > Tomcat webapps directory.
> 
> Looking at your headers again, I see that Tomcat is trying to serve the
> result as plain html.  What happens if you use "index.jsp" as the sole
> welcome file (and map that to the controller, obviously)?
> 
> Check "index.jsp" is included in the DirectoryIndex in HTTPD.
> 
> 
> p
> 
> 
> 
> > David
> > 
> > Pid wrote:
> >> David Rush wrote:
> >>> I checked my web.xml, and found no mime-mapping elements at all.  I tried 
> >>> adding one explicitly mapping the jsp extension to text/html, but it had 
> >>> no effect.  I'm still getting HTML markup in the browser window with 
> >>> Firefox.
> >>>
> >>> David
> >> Ignore that, it's a red herring, you don't need to add mime-mappings.
> >>
> >> You say the problem occurs 'sometimes' with Firefox, can you elaborate
> >> on which times and if there's a commonality between these requests?
> >>
> >>
> >> The fault is usually in the AJP mapping you've configured.  Are you
> >> using mod_jk, and if so, what is the config?
> >>
> >> Also, try splitting your HTTP docroot and Tomcat webapps folders (a
> >> correct mapping will mean it still works properly).  If the JSPs are in
> >> another location than the HTTP docs, they can't be served as raw HTML,
> >> by accident.
> >>
> >>
> >> p
> >>
> >>
> >>
> >>
> >>
> >>> Martin Gainty wrote:
>  David
> 
>  did you check your mime-mapping in your web.xml 
>  perchance are you mapping jsp to text/plain?
>  is any other extension mapped to text/plain?
> 
>  
>  jsp
>  text/plain
>  
> 
>  Martin 
>  __ 
>  Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / 
>  Note de déni et de confidentialité 
>  This message is confidential. If you should not be the intended 
>  receiver, then we ask politely to report. Each unauthorized forwarding 
>  or manufacturing of a copy is inadmissible. This message serves only for 
>  the exchange of information and has no legal binding effect. Due to the 
>  easy manipulation of emails we cannot tak

Re: tomcat shutdown problem

2009-04-27 Thread S Arvind
Pid very thanks for guiding me ..  one more help alone... can u please tell
me how to check which thread it is runnin by quartz other then checking code
... i am centos, jvm 5, tomcat 5 and tomcat 6..  i think i am disturbin u
lot, but   ...

-Arvind S

*
"Many of lifes failure are people who did not realize how close they were to
success when they gave up."
-Thomas Edison*


On Mon, Apr 27, 2009 at 7:18 PM, Pid  wrote:

> S Arvind wrote:
> > Is the application completely unchanged for deployment on Tomcat 6?
> >>> yes it is completely *unchanged*... is anything must be changed for
> > quartz?
>
> okay, then your best bet is to explore what the JVM is doing after
> shutdown and check which threads are still running.
>
> p
>
>
>
> > --Arvind S
> >
> > *
> > "Many of lifes failure are people who did not realize how close they were
> to
> > success when they gave up."
> > -Thomas Edison
> > *
> >
> > On Sat, Apr 25, 2009 at 5:06 PM, Pid  wrote:
> >
> >> Please do not keep using "reply to all".  It is annoying and
> >> unnecessary.  I will obviously receive a copy of the mail if you just
> >> send a reply to the list.
> >>
> >>> Did you write your application?
> > there are team of 200 Engineers wrote that application so i dont know
> >>> where the problem is
> >>> Are you using Quartz in your application?
> > yeah we have quartz scheduler in our application. But when we run in
> >>> Tomcat 5 we dont have this kind of problem
> >> Is the application completely unchanged for deployment on Tomcat 6?
> >>
> >> When you shutdown, Quartz will log a message describing the number of
> >> running threads, this may help diagnose the problem.  The count may be
> >> above 20, but that isn't necessarily a bad thing.
> >>
> >>
> >>> Are you starting new Threads in your app?
> > Might be, i have to ask each team.
> >> Check that they are being properly terminated.  Even if the devs promise
> >> they are, double check.
> >>
> >>> When you have started and stopped the application a few times are there
> >>> still multiple java processes running?
> > YES, this is the only thing assigned to me to correct it.
> >> You should ensure that the old processes are terminated before starting
> >> new ones, as an old one may hang onto one of the ports that Tomcat uses,
> >> thus preventing new instances from starting up.
> >>
> >> The Linux "kill" command can do this.
> >>
> >>
> >> However...
> >>
> >> After shutdown has been requested and while the process is still
> >> running, take a thread dump, or use the java tools to examine the state
> >> of the JVM.  See if you can spot which Threads are still running.
> >>
> >> Try jmap, jstack and jconsole (if you're on a local machine).
> >>
> >>
> >> p
> >>
> >>
> >>
> >>
> >>> *"Many of lifes failure are people who did not realize how close they
> >> were
> >>> to success when they gave up."
> >>> -Thomas Edison
> >>> *
> >>>
> >>> On Sat, Apr 25, 2009 at 2:21 PM, Pid  wrote:
> >>>
>  S Arvind wrote:
> > Thanks pid...
> >
> > Can u able to give me more idea to solve it if possible..
>  Did you write your application?
> 
>  Are you using Quartz in your application?
> 
>  Are you starting new Threads in your app?
> 
>  When you have started and stopped the application a few times are
> there
>  still multiple java processes running?
> 
> 
>  p
> 
> 
> > Thanks,
> > Arvind S
> >
> >
> > *"Many of lifes failure are people who did not realize how close they
>  were
> > to success when they gave up."
> > -Thomas Edison
> > *
> >
> > On Sat, Apr 25, 2009 at 2:00 PM, Pid  wrote:
> >
> >> S Arvind wrote:
> >>> A wierd problem occur while shutdowning the tomcat 6 in the Fedora
> >> and
> >>> Centos. Usually i use shell file to shutdown. After shutting down
> >> when
> >> see
> >>> the postgre preocess by  [code]*ps -ef | grep java*[/code] it is
> >> still
> >> showing
> >>> the process as running.
> >>>
> >>> such as
> >>>
> >>> [code]  tomcat   14694 1 72 Apr23 ?23:44:25
> >>> /usr/java/jdk1.5.0_13/jre/bin/java
> >>> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> >>>
> >>
> -Djava.util.logging.config.file=/usr/share/tomcat6/apache-tomcat-6.0.18/conf/logging.properties
> >>> -verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:MaxPermSize=512M
> >>> -Xms1024M -Xmx1024M -Djava.awt.headless=true
> >>>
> -Djava.endorsed.dirs=/usr/share/tomcat6/apache-tomcat-6.0.18/endorsed
> >>> -classpath
> :/usr/share/tomcat6/apache-tomcat-6.0.18/bin/bootstrap.jar
> >>>
> >>> -Dcatalina.base=/usr/share/tomcat6/apache-tomcat-6.0.18
> >>> -Dcatalina.home=/usr/share/tomcat6/apache-tomcat-6.0.18
> >>> -Djava.io.tmpdir=/usr/share/tomcat6/apache-tomcat-6.0.18/temp
> >>> org.apache.catalina.startup.Bootstrap start  [/code]
> >>>
> >>> So if i keep repeating the sta

Re: tomcat shutdown problem

2009-04-27 Thread Dan Armbrust
> Did you write your application?
>>> there are team of 200 Engineers wrote that application so i dont know
> where the problem is

One (or more) of them made a mistake, and has left a non-daemon thread
running.

You need to find out what thread is running.  One way to do this is to
get a thread dump.

First, ask Tomcat to stop normally.  When it doesn't stop, generate a
thread dump.

kill -QUIT 

will tell the JVM to print a thread dump to the console where the JVM
was started - it will probably go into your tomcat/logs/catalina.out
log file unless you have redirected it somewhere else in your
configuration.

Look at what non-daemon threads are running.  Any non-daemon threads
still running will  need to be fixed by one of your 200 Engineers :)

Dan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: web interface for tomcat service

2009-04-27 Thread S Arvind
Martin , Venkat is not aking about IDE , he is asking such as  webmin or
tomcat manager kind... so that he can restart the remote tomcat service..

-Arvind S

*
"Many of lifes failure are people who did not realize how close they were to
success when they gave up."
-Thomas Edison*


On Mon, Apr 27, 2009 at 7:14 PM, Martin Gainty  wrote:

>
> I'm assuming you want to start TC from within your IDE?
>
> Eclipse IDE
> http://www.ibm.com/developerworks/library/os-ectom/
>
> and Netbeans
> http://www.theserverside.com/discussions/thread.tss?thread_id=19934
>
> Either option allows you to start TC within IDE
>
> is this what your'e looking for?
> Martin
> __
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note
> de déni et de confidentialité
> This message is confidential. If you should not be the intended receiver,
> then we ask politely to report. Each unauthorized forwarding or
> manufacturing of a copy is inadmissible. This message serves only for the
> exchange of information and has no legal binding effect. Due to the easy
> manipulation of emails we cannot take responsibility over the the contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
>
>
> > Date: Mon, 27 Apr 2009 06:32:15 -0700
> > From: venkat...@yahoo.com
> > Subject: web interface for tomcat service
> > To: users@tomcat.apache.org
> >
> > Is there a way i can start/stop tomcat service  through a web interface
> which is right now setup as a service ..
> >
> > Thanks
> > Venkat
> >
> >
> >
>
> _
> Rediscover Hotmail®: Get e-mail storage that grows with you.
>
> http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009
>


Re: tomcat shutdown problem

2009-04-27 Thread Pid
S Arvind wrote:
> Is the application completely unchanged for deployment on Tomcat 6?
>>> yes it is completely *unchanged*... is anything must be changed for
> quartz?

okay, then your best bet is to explore what the JVM is doing after
shutdown and check which threads are still running.

p



> --Arvind S
> 
> *
> "Many of lifes failure are people who did not realize how close they were to
> success when they gave up."
> -Thomas Edison
> *
> 
> On Sat, Apr 25, 2009 at 5:06 PM, Pid  wrote:
> 
>> Please do not keep using "reply to all".  It is annoying and
>> unnecessary.  I will obviously receive a copy of the mail if you just
>> send a reply to the list.
>>
>>> Did you write your application?
> there are team of 200 Engineers wrote that application so i dont know
>>> where the problem is
>>> Are you using Quartz in your application?
> yeah we have quartz scheduler in our application. But when we run in
>>> Tomcat 5 we dont have this kind of problem
>> Is the application completely unchanged for deployment on Tomcat 6?
>>
>> When you shutdown, Quartz will log a message describing the number of
>> running threads, this may help diagnose the problem.  The count may be
>> above 20, but that isn't necessarily a bad thing.
>>
>>
>>> Are you starting new Threads in your app?
> Might be, i have to ask each team.
>> Check that they are being properly terminated.  Even if the devs promise
>> they are, double check.
>>
>>> When you have started and stopped the application a few times are there
>>> still multiple java processes running?
> YES, this is the only thing assigned to me to correct it.
>> You should ensure that the old processes are terminated before starting
>> new ones, as an old one may hang onto one of the ports that Tomcat uses,
>> thus preventing new instances from starting up.
>>
>> The Linux "kill" command can do this.
>>
>>
>> However...
>>
>> After shutdown has been requested and while the process is still
>> running, take a thread dump, or use the java tools to examine the state
>> of the JVM.  See if you can spot which Threads are still running.
>>
>> Try jmap, jstack and jconsole (if you're on a local machine).
>>
>>
>> p
>>
>>
>>
>>
>>> *"Many of lifes failure are people who did not realize how close they
>> were
>>> to success when they gave up."
>>> -Thomas Edison
>>> *
>>>
>>> On Sat, Apr 25, 2009 at 2:21 PM, Pid  wrote:
>>>
 S Arvind wrote:
> Thanks pid...
>
> Can u able to give me more idea to solve it if possible..
 Did you write your application?

 Are you using Quartz in your application?

 Are you starting new Threads in your app?

 When you have started and stopped the application a few times are there
 still multiple java processes running?


 p


> Thanks,
> Arvind S
>
>
> *"Many of lifes failure are people who did not realize how close they
 were
> to success when they gave up."
> -Thomas Edison
> *
>
> On Sat, Apr 25, 2009 at 2:00 PM, Pid  wrote:
>
>> S Arvind wrote:
>>> A wierd problem occur while shutdowning the tomcat 6 in the Fedora
>> and
>>> Centos. Usually i use shell file to shutdown. After shutting down
>> when
>> see
>>> the postgre preocess by  [code]*ps -ef | grep java*[/code] it is
>> still
>> showing
>>> the process as running.
>>>
>>> such as
>>>
>>> [code]  tomcat   14694 1 72 Apr23 ?23:44:25
>>> /usr/java/jdk1.5.0_13/jre/bin/java
>>> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>>>
>> -Djava.util.logging.config.file=/usr/share/tomcat6/apache-tomcat-6.0.18/conf/logging.properties
>>> -verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:MaxPermSize=512M
>>> -Xms1024M -Xmx1024M -Djava.awt.headless=true
>>> -Djava.endorsed.dirs=/usr/share/tomcat6/apache-tomcat-6.0.18/endorsed
>>> -classpath :/usr/share/tomcat6/apache-tomcat-6.0.18/bin/bootstrap.jar
>>>
>>> -Dcatalina.base=/usr/share/tomcat6/apache-tomcat-6.0.18
>>> -Dcatalina.home=/usr/share/tomcat6/apache-tomcat-6.0.18
>>> -Djava.io.tmpdir=/usr/share/tomcat6/apache-tomcat-6.0.18/temp
>>> org.apache.catalina.startup.Bootstrap start  [/code]
>>>
>>> So if i keep repeating the start and shutdown after few cycles it is
>>> completely refusing to start. What might be the source or reason of
 this
>>> problem? Advance Thanks,
>> If you are leaving an active process behind when you stop the server,
>> then doing it lots of times over isn't going to be healthy.
>>
>> Usually this is because your application has left non-daemon threads
>> running that haven't been shutdown.  It was was recently pointed out
>> (on
>> this list) that the Quartz job scheduler is often a culprit in this
 regard.
>> If you have are starting threads yourself, then you need to make sure
>> that you properly terminate them when the application (

Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread Pid
David Rush wrote:
> Pid:
> 
> Yes, I've removed the explicit mapping.
> 
> "Sometimes" because when I use the URL http://myserver:8080/Construction 
> (direct to Tomcat listening port) it works fine (HTML is rendered).
> When I use http://myserver/Construction (via reverse proxy forwarding through 
> Apache httpd) it fails (I get HTML markup in the browser window).

What about "http://myserver/Construction/"; (note extra slash)

> When I use http://myserver/Construction/index.html (where index.html is 
> mapped in web.xml to a controller servlet and index.html is my sole 
> welcome-file) it works fine.
> 
> I'm not using AJP.  I'm just using straight reverse-proxy style HTTP 
> forwarding with mod_proxy, with this snippet from my httpd.conf file:

(Sorry, I spotted that after I'd sent the reply.)


> ...
> ProxyPass/Construction http://localhost:8080/Construction
> ProxyPassReverse /Construction http://localhost:8080/Construction
> ...
> 
> My Apache httpd docroot has always been separate and distinct from my Tomcat 
> webapps directory.

Looking at your headers again, I see that Tomcat is trying to serve the
result as plain html.  What happens if you use "index.jsp" as the sole
welcome file (and map that to the controller, obviously)?

Check "index.jsp" is included in the DirectoryIndex in HTTPD.


p



> David
> 
> Pid wrote:
>> David Rush wrote:
>>> I checked my web.xml, and found no mime-mapping elements at all.  I tried 
>>> adding one explicitly mapping the jsp extension to text/html, but it had no 
>>> effect.  I'm still getting HTML markup in the browser window with Firefox.
>>>
>>> David
>> Ignore that, it's a red herring, you don't need to add mime-mappings.
>>
>> You say the problem occurs 'sometimes' with Firefox, can you elaborate
>> on which times and if there's a commonality between these requests?
>>
>>
>> The fault is usually in the AJP mapping you've configured.  Are you
>> using mod_jk, and if so, what is the config?
>>
>> Also, try splitting your HTTP docroot and Tomcat webapps folders (a
>> correct mapping will mean it still works properly).  If the JSPs are in
>> another location than the HTTP docs, they can't be served as raw HTML,
>> by accident.
>>
>>
>> p
>>
>>
>>
>>
>>
>>> Martin Gainty wrote:
 David

 did you check your mime-mapping in your web.xml 
 perchance are you mapping jsp to text/plain?
 is any other extension mapped to text/plain?

 
 jsp
 text/plain
 

 Martin 
 __ 
 Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / 
 Note de déni et de confidentialité 
 This message is confidential. If you should not be the intended receiver, 
 then we ask politely to report. Each unauthorized forwarding or 
 manufacturing of a copy is inadmissible. This message serves only for the 
 exchange of information and has no legal binding effect. Due to the easy 
 manipulation of emails we cannot take responsibility over the the contents.
 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
 Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte 
 Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht 
 dient lediglich dem Austausch von Informationen und entfaltet keine 
 rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von 
 E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
 Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
 destinataire prévu, nous te demandons avec bonté que pour satisfaire 
 informez l'expéditeur. N'importe quelle diffusion non autorisée ou la 
 copie de ceci est interdite. Ce message sert à l'information seulement et 
 n'aura pas n'importe quel effet légalement obligatoire. Étant donné que 
 les email peuvent facilement être sujets à la manipulation, nous ne 
 pouvons accepter aucune responsabilité pour le contenu fourni.






> Date: Sat, 25 Apr 2009 05:46:03 -0600
> From: da...@rushtone.com
> To: users@tomcat.apache.org
> Subject: Re: Browser shows source of .jsp file. Why?
>
> I'm having the same problem, where markup is sometimes appearing in the 
> browser window instead of the rendered HTML.
>
> I'm using my own server (MS Windows Server 2003), with Tomcat 6.0.18 
> behind a reverse proxy on Apache 2.2.11.
>
> When I access one of my webapps via Tomcat's port 
> (http://myserver:8080/Construction/) it works fine.  When I access it via 
> the reverse proxy (http://myserver/Construction) using Firefox 3.0.9 I 
> see the HTML markup displayed in the browser's window.  When I access the 
> webapp via IE either way, it works fine.  Google Chrome produces the same 
> results as Firefox.
>
> Via Live HTTP Headers, when I access through 

RE: web interface for tomcat service

2009-04-27 Thread Martin Gainty

I'm assuming you want to start TC from within your IDE?

Eclipse IDE 
http://www.ibm.com/developerworks/library/os-ectom/

and Netbeans 
http://www.theserverside.com/discussions/thread.tss?thread_id=19934

Either option allows you to start TC within IDE

is this what your'e looking for?
Martin 
__ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de 
déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.






> Date: Mon, 27 Apr 2009 06:32:15 -0700
> From: venkat...@yahoo.com
> Subject: web interface for tomcat service
> To: users@tomcat.apache.org
> 
> Is there a way i can start/stop tomcat service  through a web interface which 
> is right now setup as a service .. 
> 
> Thanks
> Venkat
> 
> 
>   

_
Rediscover Hotmail®: Get e-mail storage that grows with you. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009

Re: tomcat shutdown problem

2009-04-27 Thread S Arvind
Is the application completely unchanged for deployment on Tomcat 6?
>> yes it is completely *unchanged*... is anything must be changed for
quartz?

--Arvind S

*
"Many of lifes failure are people who did not realize how close they were to
success when they gave up."
-Thomas Edison
*

On Sat, Apr 25, 2009 at 5:06 PM, Pid  wrote:

>
> Please do not keep using "reply to all".  It is annoying and
> unnecessary.  I will obviously receive a copy of the mail if you just
> send a reply to the list.
>
> > Did you write your application?
> >>> there are team of 200 Engineers wrote that application so i dont know
> > where the problem is
>
> > Are you using Quartz in your application?
> >>> yeah we have quartz scheduler in our application. But when we run in
> > Tomcat 5 we dont have this kind of problem
>
> Is the application completely unchanged for deployment on Tomcat 6?
>
> When you shutdown, Quartz will log a message describing the number of
> running threads, this may help diagnose the problem.  The count may be
> above 20, but that isn't necessarily a bad thing.
>
>
> > Are you starting new Threads in your app?
> >>> Might be, i have to ask each team.
>
> Check that they are being properly terminated.  Even if the devs promise
> they are, double check.
>
> > When you have started and stopped the application a few times are there
> > still multiple java processes running?
>
> >>> YES, this is the only thing assigned to me to correct it.
>
> You should ensure that the old processes are terminated before starting
> new ones, as an old one may hang onto one of the ports that Tomcat uses,
> thus preventing new instances from starting up.
>
> The Linux "kill" command can do this.
>
>
> However...
>
> After shutdown has been requested and while the process is still
> running, take a thread dump, or use the java tools to examine the state
> of the JVM.  See if you can spot which Threads are still running.
>
> Try jmap, jstack and jconsole (if you're on a local machine).
>
>
> p
>
>
>
>
> > *"Many of lifes failure are people who did not realize how close they
> were
> > to success when they gave up."
> > -Thomas Edison
> > *
> >
> > On Sat, Apr 25, 2009 at 2:21 PM, Pid  wrote:
> >
> >> S Arvind wrote:
> >>> Thanks pid...
> >>>
> >>> Can u able to give me more idea to solve it if possible..
> >> Did you write your application?
> >>
> >> Are you using Quartz in your application?
> >>
> >> Are you starting new Threads in your app?
> >>
> >> When you have started and stopped the application a few times are there
> >> still multiple java processes running?
> >>
> >>
> >> p
> >>
> >>
> >>> Thanks,
> >>> Arvind S
> >>>
> >>>
> >>> *"Many of lifes failure are people who did not realize how close they
> >> were
> >>> to success when they gave up."
> >>> -Thomas Edison
> >>> *
> >>>
> >>> On Sat, Apr 25, 2009 at 2:00 PM, Pid  wrote:
> >>>
>  S Arvind wrote:
> > A wierd problem occur while shutdowning the tomcat 6 in the Fedora
> and
> > Centos. Usually i use shell file to shutdown. After shutting down
> when
>  see
> > the postgre preocess by  [code]*ps -ef | grep java*[/code] it is
> still
>  showing
> > the process as running.
> >
> > such as
> >
> > [code]  tomcat   14694 1 72 Apr23 ?23:44:25
> > /usr/java/jdk1.5.0_13/jre/bin/java
> > -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> >
> >>
> -Djava.util.logging.config.file=/usr/share/tomcat6/apache-tomcat-6.0.18/conf/logging.properties
> > -verbose:gc -Xloggc:gc.log -XX:+PrintGCDetails -XX:MaxPermSize=512M
> > -Xms1024M -Xmx1024M -Djava.awt.headless=true
> > -Djava.endorsed.dirs=/usr/share/tomcat6/apache-tomcat-6.0.18/endorsed
> > -classpath :/usr/share/tomcat6/apache-tomcat-6.0.18/bin/bootstrap.jar
> >
> > -Dcatalina.base=/usr/share/tomcat6/apache-tomcat-6.0.18
> > -Dcatalina.home=/usr/share/tomcat6/apache-tomcat-6.0.18
> > -Djava.io.tmpdir=/usr/share/tomcat6/apache-tomcat-6.0.18/temp
> > org.apache.catalina.startup.Bootstrap start  [/code]
> >
> > So if i keep repeating the start and shutdown after few cycles it is
> > completely refusing to start. What might be the source or reason of
> >> this
> > problem? Advance Thanks,
>  If you are leaving an active process behind when you stop the server,
>  then doing it lots of times over isn't going to be healthy.
> 
>  Usually this is because your application has left non-daemon threads
>  running that haven't been shutdown.  It was was recently pointed out
> (on
>  this list) that the Quartz job scheduler is often a culprit in this
> >> regard.
>  If you have are starting threads yourself, then you need to make sure
>  that you properly terminate them when the application (and server)
> shuts
>  down.
> 
>  A ServletContextListener is useful in this regard.
> 
> 
>  p
> 
> 
> > Arvind S
> >
> >
> >
> > *
> >>

Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread David Rush
Pid:

Yes, I've removed the explicit mapping.

"Sometimes" because when I use the URL http://myserver:8080/Construction 
(direct to Tomcat listening port) it works fine (HTML is rendered).
When I use http://myserver/Construction (via reverse proxy forwarding through 
Apache httpd) it fails (I get HTML markup in the browser window).
When I use http://myserver/Construction/index.html (where index.html is mapped 
in web.xml to a controller servlet and index.html is my sole welcome-file) it 
works fine.

I'm not using AJP.  I'm just using straight reverse-proxy style HTTP forwarding 
with mod_proxy, with this snippet from my httpd.conf file:

...
ProxyPass/Construction http://localhost:8080/Construction
ProxyPassReverse /Construction http://localhost:8080/Construction
...

My Apache httpd docroot has always been separate and distinct from my Tomcat 
webapps directory.

David

Pid wrote:
> David Rush wrote:
>> I checked my web.xml, and found no mime-mapping elements at all.  I tried 
>> adding one explicitly mapping the jsp extension to text/html, but it had no 
>> effect.  I'm still getting HTML markup in the browser window with Firefox.
>>
>> David
> 
> Ignore that, it's a red herring, you don't need to add mime-mappings.
> 
> You say the problem occurs 'sometimes' with Firefox, can you elaborate
> on which times and if there's a commonality between these requests?
> 
> 
> The fault is usually in the AJP mapping you've configured.  Are you
> using mod_jk, and if so, what is the config?
> 
> Also, try splitting your HTTP docroot and Tomcat webapps folders (a
> correct mapping will mean it still works properly).  If the JSPs are in
> another location than the HTTP docs, they can't be served as raw HTML,
> by accident.
> 
> 
> p
> 
> 
> 
> 
> 
>> Martin Gainty wrote:
>>> David
>>>
>>> did you check your mime-mapping in your web.xml 
>>> perchance are you mapping jsp to text/plain?
>>> is any other extension mapped to text/plain?
>>>
>>> 
>>> jsp
>>> text/plain
>>> 
>>>
>>> Martin 
>>> __ 
>>> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note 
>>> de déni et de confidentialité 
>>> This message is confidential. If you should not be the intended receiver, 
>>> then we ask politely to report. Each unauthorized forwarding or 
>>> manufacturing of a copy is inadmissible. This message serves only for the 
>>> exchange of information and has no legal binding effect. Due to the easy 
>>> manipulation of emails we cannot take responsibility over the the contents.
>>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
>>> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte 
>>> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht 
>>> dient lediglich dem Austausch von Informationen und entfaltet keine 
>>> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von 
>>> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
>>> destinataire prévu, nous te demandons avec bonté que pour satisfaire 
>>> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie 
>>> de ceci est interdite. Ce message sert à l'information seulement et n'aura 
>>> pas n'importe quel effet légalement obligatoire. Étant donné que les email 
>>> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
>>> aucune responsabilité pour le contenu fourni.
>>>
>>>
>>>
>>>
>>>
>>>
 Date: Sat, 25 Apr 2009 05:46:03 -0600
 From: da...@rushtone.com
 To: users@tomcat.apache.org
 Subject: Re: Browser shows source of .jsp file. Why?

 I'm having the same problem, where markup is sometimes appearing in the 
 browser window instead of the rendered HTML.

 I'm using my own server (MS Windows Server 2003), with Tomcat 6.0.18 
 behind a reverse proxy on Apache 2.2.11.

 When I access one of my webapps via Tomcat's port 
 (http://myserver:8080/Construction/) it works fine.  When I access it via 
 the reverse proxy (http://myserver/Construction) using Firefox 3.0.9 I see 
 the HTML markup displayed in the browser's window.  When I access the 
 webapp via IE either way, it works fine.  Google Chrome produces the same 
 results as Firefox.

 Via Live HTTP Headers, when I access through the reverse proxy I see:

 HTTP/1.x 200 OK
 Date: Sat, 25 Apr 2009 11:39:11 GMT
 Server: Apache-Coyote/1.1
 Keep-Alive: timeout=5, max=100
 Connection: Keep-Alive
 Transfer-Encoding: chunked
 Content-Type: text/plain

 I suspect the "Content-Type: text/plain" is a clue.  Straight to Tomcat I 
 see:

 HTTP/1.x 200 OK
 Server: Apache-Coyote/1.1
 Set-Cookie: JSESSIONID=53C3EC973BB365AAF92A1EC66F03271A; Path=/Construction
 Transfer-Encoding: chunked
 Date: S

web interface for tomcat service

2009-04-27 Thread Venky Vasant
Is there a way i can start/stop tomcat service  through a web interface which 
is right now setup as a service .. 

Thanks
Venkat


  

Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread Pid
David Rush wrote:
> I checked my web.xml, and found no mime-mapping elements at all.  I tried 
> adding one explicitly mapping the jsp extension to text/html, but it had no 
> effect.  I'm still getting HTML markup in the browser window with Firefox.
> 
> David

Ignore that, it's a red herring, you don't need to add mime-mappings.

You say the problem occurs 'sometimes' with Firefox, can you elaborate
on which times and if there's a commonality between these requests?


The fault is usually in the AJP mapping you've configured.  Are you
using mod_jk, and if so, what is the config?

Also, try splitting your HTTP docroot and Tomcat webapps folders (a
correct mapping will mean it still works properly).  If the JSPs are in
another location than the HTTP docs, they can't be served as raw HTML,
by accident.


p





> Martin Gainty wrote:
>> David
>>
>> did you check your mime-mapping in your web.xml 
>> perchance are you mapping jsp to text/plain?
>> is any other extension mapped to text/plain?
>>
>> 
>> jsp
>> text/plain
>> 
>>
>> Martin 
>> __ 
>> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note 
>> de déni et de confidentialité 
>> This message is confidential. If you should not be the intended receiver, 
>> then we ask politely to report. Each unauthorized forwarding or 
>> manufacturing of a copy is inadmissible. This message serves only for the 
>> exchange of information and has no legal binding effect. Due to the easy 
>> manipulation of emails we cannot take responsibility over the the contents.
>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene 
>> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte 
>> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht 
>> dient lediglich dem Austausch von Informationen und entfaltet keine 
>> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von 
>> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
>> destinataire prévu, nous te demandons avec bonté que pour satisfaire 
>> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie 
>> de ceci est interdite. Ce message sert à l'information seulement et n'aura 
>> pas n'importe quel effet légalement obligatoire. Étant donné que les email 
>> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
>> aucune responsabilité pour le contenu fourni.
>>
>>
>>
>>
>>
>>
>>> Date: Sat, 25 Apr 2009 05:46:03 -0600
>>> From: da...@rushtone.com
>>> To: users@tomcat.apache.org
>>> Subject: Re: Browser shows source of .jsp file. Why?
>>>
>>> I'm having the same problem, where markup is sometimes appearing in the 
>>> browser window instead of the rendered HTML.
>>>
>>> I'm using my own server (MS Windows Server 2003), with Tomcat 6.0.18 behind 
>>> a reverse proxy on Apache 2.2.11.
>>>
>>> When I access one of my webapps via Tomcat's port 
>>> (http://myserver:8080/Construction/) it works fine.  When I access it via 
>>> the reverse proxy (http://myserver/Construction) using Firefox 3.0.9 I see 
>>> the HTML markup displayed in the browser's window.  When I access the 
>>> webapp via IE either way, it works fine.  Google Chrome produces the same 
>>> results as Firefox.
>>>
>>> Via Live HTTP Headers, when I access through the reverse proxy I see:
>>>
>>> HTTP/1.x 200 OK
>>> Date: Sat, 25 Apr 2009 11:39:11 GMT
>>> Server: Apache-Coyote/1.1
>>> Keep-Alive: timeout=5, max=100
>>> Connection: Keep-Alive
>>> Transfer-Encoding: chunked
>>> Content-Type: text/plain
>>>
>>> I suspect the "Content-Type: text/plain" is a clue.  Straight to Tomcat I 
>>> see:
>>>
>>> HTTP/1.x 200 OK
>>> Server: Apache-Coyote/1.1
>>> Set-Cookie: JSESSIONID=53C3EC973BB365AAF92A1EC66F03271A; Path=/Construction
>>> Transfer-Encoding: chunked
>>> Date: Sat, 25 Apr 2009 11:37:06 GMT
>>>
>>> No "Content-Type" produced at all.
>>>
>>> When I access it with Firefox via the Apache reverse proxy via the URL 
>>> http://myserver/Construction/index.html (which is just mapped in web.xml to 
>>> the controlling servlet, and my welcome-file is index.html), the webapp 
>>> displays correctly, and the headers say:
>>>
>>> HTTP/1.x 200 OK
>>> Date: Sat, 25 Apr 2009 11:42:27 GMT
>>> Server: Apache-Coyote/1.1
>>> Keep-Alive: timeout=5, max=100
>>> Connection: Keep-Alive
>>> Transfer-Encoding: chunked
>>> Content-Type: text/html
>>>
>>> I have 3 different webapps, but I only see the problem with one of them.
>>>
>>> My reverse proxy configuration includes:
>>>
>>> ProxyPass/Construction http://localhost:8080/Construction
>>> ProxyPassReverse /Construction http://localhost:8080/Construction
>>>
>>> David
>>>
>>> dfobox wrote:
 I have JSP-based website running on my own server and I want to move it to
 hosting company. I've copied the files, they said they have enabl

Re: Browser shows source of .jsp file. Why?

2009-04-27 Thread David Rush
I checked my web.xml, and found no mime-mapping elements at all.  I tried 
adding one explicitly mapping the jsp extension to text/html, but it had no 
effect.  I'm still getting HTML markup in the browser window with Firefox.

David

Martin Gainty wrote:
> David
> 
> did you check your mime-mapping in your web.xml 
> perchance are you mapping jsp to text/plain?
> is any other extension mapped to text/plain?
> 
> 
> jsp
> text/plain
> 
> 
> Martin 
> __ 
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note 
> de déni et de confidentialité 
> This message is confidential. If you should not be the intended receiver, 
> then we ask politely to report. Each unauthorized forwarding or manufacturing 
> of a copy is inadmissible. This message serves only for the exchange of 
> information and has no legal binding effect. Due to the easy manipulation of 
> emails we cannot take responsibility over the the contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich 
> dem Austausch von Informationen und entfaltet keine rechtliche 
> Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen 
> wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci 
> est interdite. Ce message sert à l'information seulement et n'aura pas 
> n'importe quel effet légalement obligatoire. Étant donné que les email 
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter 
> aucune responsabilité pour le contenu fourni.
> 
> 
> 
> 
> 
> 
>> Date: Sat, 25 Apr 2009 05:46:03 -0600
>> From: da...@rushtone.com
>> To: users@tomcat.apache.org
>> Subject: Re: Browser shows source of .jsp file. Why?
>>
>> I'm having the same problem, where markup is sometimes appearing in the 
>> browser window instead of the rendered HTML.
>>
>> I'm using my own server (MS Windows Server 2003), with Tomcat 6.0.18 behind 
>> a reverse proxy on Apache 2.2.11.
>>
>> When I access one of my webapps via Tomcat's port 
>> (http://myserver:8080/Construction/) it works fine.  When I access it via 
>> the reverse proxy (http://myserver/Construction) using Firefox 3.0.9 I see 
>> the HTML markup displayed in the browser's window.  When I access the webapp 
>> via IE either way, it works fine.  Google Chrome produces the same results 
>> as Firefox.
>>
>> Via Live HTTP Headers, when I access through the reverse proxy I see:
>>
>> HTTP/1.x 200 OK
>> Date: Sat, 25 Apr 2009 11:39:11 GMT
>> Server: Apache-Coyote/1.1
>> Keep-Alive: timeout=5, max=100
>> Connection: Keep-Alive
>> Transfer-Encoding: chunked
>> Content-Type: text/plain
>>
>> I suspect the "Content-Type: text/plain" is a clue.  Straight to Tomcat I 
>> see:
>>
>> HTTP/1.x 200 OK
>> Server: Apache-Coyote/1.1
>> Set-Cookie: JSESSIONID=53C3EC973BB365AAF92A1EC66F03271A; Path=/Construction
>> Transfer-Encoding: chunked
>> Date: Sat, 25 Apr 2009 11:37:06 GMT
>>
>> No "Content-Type" produced at all.
>>
>> When I access it with Firefox via the Apache reverse proxy via the URL 
>> http://myserver/Construction/index.html (which is just mapped in web.xml to 
>> the controlling servlet, and my welcome-file is index.html), the webapp 
>> displays correctly, and the headers say:
>>
>> HTTP/1.x 200 OK
>> Date: Sat, 25 Apr 2009 11:42:27 GMT
>> Server: Apache-Coyote/1.1
>> Keep-Alive: timeout=5, max=100
>> Connection: Keep-Alive
>> Transfer-Encoding: chunked
>> Content-Type: text/html
>>
>> I have 3 different webapps, but I only see the problem with one of them.
>>
>> My reverse proxy configuration includes:
>>
>> ProxyPass/Construction http://localhost:8080/Construction
>> ProxyPassReverse /Construction http://localhost:8080/Construction
>>
>> David
>>
>> dfobox wrote:
>>> I have JSP-based website running on my own server and I want to move it to
>>> hosting company. I've copied the files, they said they have enabled Tomcat
>>> for me, but browser shows source of the pages, even of those which don't
>>> have any script code inside - only properly formatted html. What could be a
>>> problem? Thanks!
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
> 
> _
> Rediscover Hotmail®: Get e-mail storage that grows with you. 
> http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009


RE: AW: Permanent Redirect?

2009-04-27 Thread Martin Gainty

Alex-

you can use tuckey to rewrite the URL to redirect to your SSL enabled site
http://tuckey.org/urlrewrite

any ContextPath of / will direct to ROOT.war for that Tomcat
http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html

Viel Gluck/Good Luck
Martin 
__ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de 
déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.






> From: adied...@tecracer.de
> To: users@tomcat.apache.org
> Date: Mon, 27 Apr 2009 13:59:02 +0200
> Subject: AW: Permanent Redirect?
> 
> I think the ways seems to be right. 
> It has to be a safe procedure, that a
> http://www.websiteA.de/index.cfm?uuid=230942iwpofiswfksdsdf has to be
> redirected with the same URL Parameters to the
> http://www.websiteB.de/index.cfm?uuid=230942iwpofiswfksdsdf in Tomcat. We
> have to implement a new SSL Certificate with the new Domain, that is already
> known.
> 
> Greetings
> Alexander
> 
> 
> 
> -Ursprüngliche Nachricht-
> Von: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
> Gesendet: Montag, 27. April 2009 11:14
> An: Tomcat Users List
> Betreff: RE: Permanent Redirect?
> 
> > From: Pid [mailto:p...@pidster.com]
> > Subject: Re: Permanent Redirect?
> > 
> > A small webapp deployed in websiteA.de/ROOT that contains a servlet
> > Filter which is coded to issue an appropriate redirect to the new URL.
> 
> Since this is over SSL, will there be certificate problems in trying to do
> the above?
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

_
Rediscover Hotmail®: Get e-mail storage that grows with you. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage2_042009

Re: Having tomcat as an OSGi bundle

2009-04-27 Thread Mark Thomas
Saminda Wijeratne wrote:
> I saw a mail thread talking abt osgifying tomcat. but couldn't really
> determine at the end whether it worked out or not.

Nothing happened in the Tomcat project.

Try Googling for "dm Server"
(full disclosure: I work for Spring)

Mark

> 
> On Mon, Apr 27, 2009 at 5:25 PM, Pid  wrote:
> 
>> Saminda Wijeratne wrote:
>>> Hi,
>>>
>>> Is there an OSGI bundle available embedding tomcat? I want to start
>> tomcat
>>> inside an OSGI environment.
>> Not that I've heard of.
>>
>> p
>>
>>
>>> Thank you,
>>> Saminda
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Having tomcat as an OSGi bundle

2009-04-27 Thread Saminda Wijeratne
I saw a mail thread talking abt osgifying tomcat. but couldn't really
determine at the end whether it worked out or not.

On Mon, Apr 27, 2009 at 5:25 PM, Pid  wrote:

> Saminda Wijeratne wrote:
> > Hi,
> >
> > Is there an OSGI bundle available embedding tomcat? I want to start
> tomcat
> > inside an OSGI environment.
>
> Not that I've heard of.
>
> p
>
>
> > Thank you,
> > Saminda
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


AW: Permanent Redirect?

2009-04-27 Thread Alexander Diedler
I think the ways seems to be right. 
It has to be a safe procedure, that a
http://www.websiteA.de/index.cfm?uuid=230942iwpofiswfksdsdf has to be
redirected with the same URL Parameters to the
http://www.websiteB.de/index.cfm?uuid=230942iwpofiswfksdsdf in Tomcat. We
have to implement a new SSL Certificate with the new Domain, that is already
known.

Greetings
Alexander



-Ursprüngliche Nachricht-
Von: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Gesendet: Montag, 27. April 2009 11:14
An: Tomcat Users List
Betreff: RE: Permanent Redirect?

> From: Pid [mailto:p...@pidster.com]
> Subject: Re: Permanent Redirect?
> 
> A small webapp deployed in websiteA.de/ROOT that contains a servlet
> Filter which is coded to issue an appropriate redirect to the new URL.

Since this is over SSL, will there be certificate problems in trying to do
the above?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



smime.p7s
Description: S/MIME cryptographic signature


Re: Having tomcat as an OSGi bundle

2009-04-27 Thread Pid
Saminda Wijeratne wrote:
> Hi,
> 
> Is there an OSGI bundle available embedding tomcat? I want to start tomcat
> inside an OSGI environment.

Not that I've heard of.

p


> Thank you,
> Saminda
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Having tomcat as an OSGi bundle

2009-04-27 Thread Saminda Wijeratne
Hi,

Is there an OSGI bundle available embedding tomcat? I want to start tomcat
inside an OSGI environment.

Thank you,
Saminda


Session Replication problems

2009-04-27 Thread Mohamedin
Dear All,

I use these configuration to enable session replication:


Master server:
























===
S2 server:
===
























==
S3 server:
==

























S1 server:

























=

My problem is the Master server (First One) did not replicate the sessions 
well. Also sometimes it refuse to stop and thread dump show it is in session 
replication

Some threads like this:

"TP-Processor15" daemon prio=1 tid=0x2b039e80 nid=0x7014 waiting on 
condition [0x472c2000..0x472c3e40]
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:118)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:716)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:746)
at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1076)
at 
java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync.wlock(ReentrantReadWriteLock.java:342)
at 
java.util.concurrent.locks.ReentrantReadWriteLock$WriteLock.lock(ReentrantReadWriteLock.java:637)
at 
org.apache.catalina.ha.session.DeltaSession.lock(DeltaSession.java:184)
at 
org.apache.catalina.ha.session.DeltaSession.setAttribute(DeltaSession.java:517)
at 
org.apache.catalina.ha.session.DeltaSession.setAttribute(DeltaSession.java:502)
at 
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:130)
at 
com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSession.setHttpSession(ContainerAdapterSession.java:230)
at 
com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager.getSession(ContainerAdapterSessionManager.java:311)
at 
com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager.getSession(ContainerAdapterSessionManager.java:342)
at 
com.lutris.appserver.server.sessionContainerAdapter.TomcatContainerAdapterSessionManager.getSession(TomcatContainerAdapterSessionManager.java:273)
at 
com.lutris.appserver.server.StandardAppUtil.getRequestSession(StandardAppUtil.java:323)
at 
com.lutris.appserver.server.StandardApplication.ensureSession(StandardApplication.java:718)
at 
com.lutris.appserver.server.StandardApplication.requestPreprocessor(StandardApplication.java:900)
at com.ours.WebApp.requestPreprocessor(WebApp.java:83)
at 
com.lutris.appserver.server.httpPresentation.HttpPresentationManager.runRequestPreprocessor(HttpPresentationManager.java:400)
at 
com.lutris.appserver.server.httpPresentation.HttpPresentationManager.Run(HttpPresentationManager.java:247)
at 
com.lutris.appserver.server.httpPresentation.servlet.HttpPresentationServlet.serviceDirect(HttpPresentationServlet.java:682)
at 
com.lutris.appserver.server.httpPresentation.servlet.HttpPresentationServlet.service(HttpPresentationServlet.java:807)
at javax.servlet.http.Http

Re: adding files to classpath

2009-04-27 Thread Leon Rosenberg
On Mon, Apr 27, 2009 at 11:19 AM, Leon Rosenberg
 wrote:
> On Mon, Apr 27, 2009 at 10:59 AM, Caldarale, Charles R
>>
>> This is one of those rare instances where you actually could extend the 
>> Tomcat classpath with a reference to your config directory, as long as you 
>> don't mind sharing >those resources across all your webapps and don't mind 
>> restarting Tomcat to change the config.

update, i added to the bottom of setclasspath.sh:

export CLASSPATH=$CLASSPATH:$HOME/etc/configuration

everything seems to work (including new stuff and old stuff), could I
have broken anything I don't see yet by this?

My classpath now is:  ::/Users/lrosenberg/etc/configuration
(yes its a mac)

regards
Leon

P.S. Chuck, I still don't get the "don't mind restarting Tomcat to
change the config" line, what do you mean? I actually see changes in
my configs propagated into the code:-)

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Send tomcat logs to syslog-ng

2009-04-27 Thread André Warnier

Caldarale, Charles R wrote:

From: André Warnier [mailto:a...@ice-sa.com]
Subject: Re: Send tomcat logs to syslog-ng

You may want to have a look here :
http://blog.the-mitchells.org/archives/2004/09/21/tomcat-on-windows-
and-swallowoutput/


That's a bit out of date for current versions of Tomcat (but the OP didn't tell 
us which version he's using).

If you want to use log4j for Tomcat's internal logging look here:
http://tomcat.apache.org/tomcat-6.0-doc/logging.html

If you can live with JULI doing the logging, just fiddle with the config in 
conf/logging.properties.

The OP is under Windows, so probably running Tomcat under the 
commons-daemon stuff (tomcatxx.exe). Does that also work as such in that 
case ?
(Actually he did not tell us either, if he is using the MSI or the zip 
version, and running as a service or not. I'm just guessing).


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: adding files to classpath

2009-04-27 Thread Leon Rosenberg
On Mon, Apr 27, 2009 at 10:59 AM, Caldarale, Charles R
 wrote:
>> From: Leon Rosenberg [mailto:rosenberg.l...@googlemail.com]
>> Subject: adding files to classpath
>>
>> Is there any other possibility to add something to the classpath
>> without screwing up my tomcat installation completely? Something
>> similar to common/endorsed prior to 6.x?
>
> This is one of those rare instances where you actually could extend the 
> Tomcat classpath with a reference to your config directory, as long as you 
> don't mind sharing >those resources across all your webapps and don't mind 
> restarting Tomcat to change the config.

Why should I restart tomcat to change the config in this case?

>  I wouldn't put any class files in that directory, though.

neither would I :-)

>
> The common/endorsed directory still works, since that's handled by the JVM, 
> not Tomcat.  The value is given to the JVM via the java.endorsed.dirs system 
> property; the >catalina.bat and catalina.sh scripts will set that property 
> based on the contents of the JAVA_ENDORSED_DIRS environment variable.  If you 
> set >JAVA_ENDORSED_DIRS=$HOME/etc/config/ either before starting Tomcat or in 
> setenv.sh, it should work, although again, this will be shared across all 
> webapps.
so its basically the same as the above, the only difference being that
I'm modifying the classpath indirectly.

So I'll probably stick with the first option and set the dir to be
part of the classpath.
Thanks!
Leon

>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
> MATERIAL and is thus for use only by the intended recipient. If you received 
> this in error, please contact the sender and delete the e-mail and its 
> attachments from all computers.
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Permanent Redirect?

2009-04-27 Thread Caldarale, Charles R
> From: Pid [mailto:p...@pidster.com]
> Subject: Re: Permanent Redirect?
> 
> A small webapp deployed in websiteA.de/ROOT that contains a servlet
> Filter which is coded to issue an appropriate redirect to the new URL.

Since this is over SSL, will there be certificate problems in trying to do the 
above?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Permanent Redirect?

2009-04-27 Thread Pid
Alexander Diedler wrote:
> Hello everybody,
> 
> I have a question to implement a permanent redirect for an old domain to
> a new domain on the Tomcat 6.0.16 Server.
> 
> It is definied in the server.xml as it own connector (for SSL) and now
> we want, that if we fill-in www.websiteA.de  we
> will be redirected to www.websiteB.de 
> automatically.

A small webapp deployed in websiteA.de/ROOT that contains a servlet
Filter which is coded to issue an appropriate redirect to the new URL.

You could avoid rolling your own and try: tuckey.org/urlrewrite/

p


> Greetings
> 
> Alexander
> 
>  
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Scheduling tasks in Tomcat

2009-04-27 Thread Pid
Aden Jones wrote:
> Okay Iam new to Tomcat so please go easy on me.
> 
> Basically I've been given an assignment that employs JSF, Hibernate and
> Tomcat as the servlet. 

Tomcat is the "Servlet Container".
You write or add Servlets to it.

> Ive got everything else working but have two tasks
> that need to be run at a certain time of the week. Searching online I've had
> a lot of trouble finding anything coherent. My teacher seems to think that
> the servlet itself can run the scheduled task by inserting something into my
> web.xml file and it will run the classes that are the scheduled tasks.

A Servlet coded to do such a thing could do.

Tomcat does not have a job scheduler built into it.

There are open source job scheduler libraries written in Java that are
easy to use with Servlet Containers. GIYF.


p


> Any help would be greatly appreciated.
> 
> Cheers 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Send tomcat logs to syslog-ng

2009-04-27 Thread Caldarale, Charles R
> From: André Warnier [mailto:a...@ice-sa.com]
> Subject: Re: Send tomcat logs to syslog-ng
> 
> You may want to have a look here :
> http://blog.the-mitchells.org/archives/2004/09/21/tomcat-on-windows-
> and-swallowoutput/

That's a bit out of date for current versions of Tomcat (but the OP didn't tell 
us which version he's using).

If you want to use log4j for Tomcat's internal logging look here:
http://tomcat.apache.org/tomcat-6.0-doc/logging.html

If you can live with JULI doing the logging, just fiddle with the config in 
conf/logging.properties.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Permanent Redirect?

2009-04-27 Thread Alexander Diedler
Hello everybody,

I have a question to implement a permanent redirect for an old domain to a
new domain on the Tomcat 6.0.16 Server.

It is definied in the server.xml as it own connector (for SSL) and now we
want, that if we fill-in www.websiteA.de we will be redirected to
www.websiteB.de automatically.

 

Greetings

Alexander

 



smime.p7s
Description: S/MIME cryptographic signature


Re: Installing problem : Tomcat

2009-04-27 Thread Pid
André Warnier wrote:
> parin123 wrote:
>> Hello Everyone,
>>
>> I am trying to install Tomcat on Ubuntu Linux and here is the problem
> ...
> Hi.
> 
> I am taking advantage of the fact that Chuck is on holiday, and maybe
> not  watching this forum with his accustomed eagle eye.
> 
> Considering that this is Ubuntu, and considering that as I believe
> Ubuntu is relatively close to Debian, I would recommend that you just
> use the Tomcat package available through "apt-get install tomcatx.x.",
> and save yourself a lot of aggravation.
> 
> Explanation and caveats :
> 
> There are two schools of thought :
> 
> One school recommends that you always install Tomcat from the official
> Tomcat site.  That has the following advantages :
> - you will get the latest version
> - all the Tomcat files get installed under one single directory
> - you will be able to get better support on this forum
> But it has the disadvantage that you will in the future not be able to
> use the Ubuntu-specific facilities to de-install/upgrade your Tomcat
> easily.
> 
> The other school recommends (for some platforms) to install packages
> using the platform-specific utilities (like apt) to install and manage
> all packages, including Tomcat.  That has the opposite
> avantages/inconvenients to the above.
> 
> The problem for later support of that solution on this forum, is not
> that people here are unwilling to help, but that it is more difficult
> for them to help, because they cannot know, for all the different
> platforms, where these platform-specific packages install the Tomcat
> files, or what they put exactly in them.
> It can also be the case that some of these pre-packaged versions are
> "broken".  My personal experience so far with Debian has been quite
> good, and I never had problems installing and running Tomcat from these
> packages.
> 
> Anyone's mileage may vary.
> 
> If you would like guidance, I can provide some, based on Debian.

Also, did you set your JAVA_HOME environment variable to /usr/bin, or
did the system come like that?


p


> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: adding files to classpath

2009-04-27 Thread Caldarale, Charles R
> From: Leon Rosenberg [mailto:rosenberg.l...@googlemail.com]
> Subject: adding files to classpath
> 
> Is there any other possibility to add something to the classpath
> without screwing up my tomcat installation completely? Something
> similar to common/endorsed prior to 6.x?

This is one of those rare instances where you actually could extend the Tomcat 
classpath with a reference to your config directory, as long as you don't mind 
sharing those resources across all your webapps and don't mind restarting 
Tomcat to change the config.  I wouldn't put any class files in that directory, 
though.

The common/endorsed directory still works, since that's handled by the JVM, not 
Tomcat.  The value is given to the JVM via the java.endorsed.dirs system 
property; the catalina.bat and catalina.sh scripts will set that property based 
on the contents of the JAVA_ENDORSED_DIRS environment variable.  If you set 
JAVA_ENDORSED_DIRS=$HOME/etc/config/ either before starting Tomcat or in 
setenv.sh, it should work, although again, this will be shared across all 
webapps.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Send tomcat logs to syslog-ng

2009-04-27 Thread André Warnier

Julien Vermet wrote:

Hello

I'm running an apache/tomcat server under Windows Server 2003. I would like
to send tomcat logs to syslog-ng server under Debian. I tried with log4j,
but I receive only application log, no tomcat logs. Do you have a solution?


You may want to have a look here :
http://blog.the-mitchells.org/archives/2004/09/21/tomcat-on-windows-and-swallowoutput/

I got this link in Google, searching for "tomcat +swallowoutput".


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Scheduling tasks in Tomcat

2009-04-27 Thread Aden Jones

Okay Iam new to Tomcat so please go easy on me.

Basically I've been given an assignment that employs JSF, Hibernate and
Tomcat as the servlet. Ive got everything else working but have two tasks
that need to be run at a certain time of the week. Searching online I've had
a lot of trouble finding anything coherent. My teacher seems to think that
the servlet itself can run the scheduled task by inserting something into my
web.xml file and it will run the classes that are the scheduled tasks.

Any help would be greatly appreciated.

Cheers 
-- 
View this message in context: 
http://www.nabble.com/Scheduling-tasks-in-Tomcat-tp23251939p23251939.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Send tomcat logs to syslog-ng

2009-04-27 Thread Julien Vermet
Hello

I'm running an apache/tomcat server under Windows Server 2003. I would like
to send tomcat logs to syslog-ng server under Debian. I tried with log4j,
but I receive only application log, no tomcat logs. Do you have a solution?

Thnaks


adding files to classpath

2009-04-27 Thread Leon Rosenberg
Hello,

we are at the moment migrating to new configuration framework
(http://configureme.dev.java.net) which is working with plain json
files reading them from classpath.
We don't want the configuration files to be part of application
anymore. Instead we want them to be located under $HOME/etc/config/ to
separate application and config.
The problem is now, how to bring those files into the classpath. The
easiest solution I can think of is to link every file under
$HOME/etc/config/ into WEB-INF/classes.
However this doesn't seem very elegant.

Is there any other possibility to add something to the classpath
without screwing up my tomcat installation completely? Something
similar to common/endorsed prior to 6.x? Or is there any possibility
to manipulate classpath via context.xml?

regards
Leon

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org