Java Mailing List Archive

http://www.junlu.com/

Home » users-digest.tomcat »

users Digest 15 Mar 2013 06:46:35 -0000 Issue 11297

users-digest-help

2013-03-15


Author LoginPost Reply

users Digest 15 Mar 2013 06:46:35 -0000 Issue 11297

Topics (messages 240394 through 240419)

Re: NullPointerException in MapperListener; Tomcat#start() does not create a Container?
 240394 by: Nick Williams
 240408 by: Konstantin Kolinko

Re: tomcat dead, service won't start
 240395 by: Mark Thomas
 240397 by: solar.essnmag.com
 240398 by: Mark Thomas
 240400 by: André Warnier
 240401 by: solar.essnmag.com
 240402 by: Mark Thomas
 240403 by: Harris, Jeffrey E.
 240404 by: solar.essnmag.com
 240405 by: Mark Thomas
 240407 by: Harris, Jeffrey E.
 240409 by: Mark Thomas

Re: configuring tomcat7 with apache 2.2.22
 240396 by: solar.essnmag.com
 240399 by: Harris, Jeffrey E.

Re: tomcat 6.0.35 in production maintaince
 240406 by: fachhoch
 240411 by: fachhoch

check load
 240410 by: fachhoch
 240412 by: André Warnier

Re: Running a binary program from a JSP
 240413 by: Martin Gainty

WebSockets problem Re: NullPointerException in MapperListener; Tomcat#start() does not create a Container?
 240414 by: Nick Williams

Standard or OCSP Native Lib?
 240415 by: Nick Williams

Re: Procrun and Tomcat service/OS shutdown on Windows
 240416 by: Howard W. Smith, Jr.

Re: AJP suddenly Stopps acting: ajp on 7009 and 9009 : connections keept open
 240417 by: David Kumar
 240418 by: David Kumar

AW:AJP suddenly Stopps acting: ajp on 7009 and 9009 : connections keept open
 240419 by: David Kumar

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: users@(protected)
To unsubscribe, e-mail: users-digest-unsubscribe@(protected)
For additional commands, e-mail: users-digest-help@(protected)

----------------------------------------------------------------------


Attachment: users_240394.eml (zipped)

On Mar 14, 2013, at 2:56 PM, Nick Williams wrote:

> Using a variety of tutorials I found online and the documentation for o.a.c.startup.Tomcat, I created the following main method to start up an embedded Tomcat. I'm using 7.0.37 Tomcat JARs.
>
>   public static void main(String... arguments) throws Exception
>   {
>     Tomcat tomcat = new Tomcat();
>     tomcat.setBaseDir(".basedir");
>     tomcat.setPort(8973);
>     tomcat.enableNaming();
>     tomcat.init();
>     tomcat.start();
>
>     System.out.println("X: " + tomcat.getConnector().getService().getContainer());
>
>     tomcat.getServer().await();
>   }
>
> The System.out.println is for debugging purposes, because I'm getting a NullPointerException. Obviously I'm doing something wrong, because about an hour of Googling turned up precisely zero results of anyone who's getting a NullPointerException in MapperListener#findDefaultHost. For some reason, it looks like a Container is never created. What gives? Here's the full output of running the JAR file:
>
> Mar 14, 2013 2:39:04 PM org.apache.coyote.AbstractProtocol init
> INFO: Initializing ProtocolHandler ["http-bio-8973"]
> Mar 14, 2013 2:39:04 PM org.apache.catalina.core.StandardService startInternal
> INFO: Starting service Tomcat
> Mar 14, 2013 2:39:04 PM org.apache.coyote.AbstractProtocol start
> INFO: Starting ProtocolHandler ["http-bio-8973"]
> Mar 14, 2013 2:39:04 PM org.apache.catalina.core.StandardService startInternal
> SEVERE: Failed to start connector [Connector[HTTP/1.1-8973]]
> org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8973]]
>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
>     at org.apache.catalina.core.StandardService.startInternal (StandardService.java:459)
>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>     at org.apache.catalina.core.StandardServer.startInternal (StandardServer.java:732)
>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>     at org.apache.catalina.startup.Tomcat.start (Tomcat.java:335)
>     at com.ul.Bootstrap.main(Bootstrap.java:15)
> Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.connector.MapperListener@(protected)]
>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
>     at org.apache.catalina.connector.Connector.startInternal (Connector.java:1022)
>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>     ... 6 more
> Caused by: java.lang.NullPointerException
>     at org.apache.catalina.connector.MapperListener.findDefaultHost (MapperListener.java:252)
>     at org.apache.catalina.connector.MapperListener.startInternal (MapperListener.java:104)
>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>     ... 8 more
>
> X: null

I resolved the NullPointerException by calling tomcat.getService().setContainer(tomcat.getEngine()) between init() and start(). Everything is working fine now, and I can go to http://localhost:8973/MyServlet and it's working great, but I still suspect I'm doing something wrong, since no documentation or tutorials anywhere mention needing to do that and it seems that the container should automatically be set on the service...

I'm open to suggestions if anybody has any, but at least it's working now.

Attachment: users_240408.eml (zipped)
2013/3/15 Nick Williams <nicholas@(protected)>:
>
> On Mar 14, 2013, at 2:56 PM, Nick Williams wrote:
>
>> Using a variety of tutorials I found online and the documentation for o.a.c.startup.Tomcat, I created the following main method to start up an embedded Tomcat. I'm using 7.0.37 Tomcat JARs.
>>
>>   public static void main(String... arguments) throws Exception
>>   {
>>     Tomcat tomcat = new Tomcat();
>>     tomcat.setBaseDir(".basedir");
>>     tomcat.setPort(8973);
>>     tomcat.enableNaming();
>>     tomcat.init();
>>     tomcat.start();
>>
>>     System.out.println("X: " + tomcat.getConnector().getService().getContainer());
>>
>>     tomcat.getServer().await();
>>   }
>>
>> The System.out.println is for debugging purposes, because I'm getting a NullPointerException. Obviously I'm doing something wrong, because about an hour of Googling turned up precisely zero results of anyone who's getting a NullPointerException in MapperListener#findDefaultHost. For some reason, it looks like a Container is never created. What gives? Here's the full output of running the JAR file:


Why do you expect that default "Host" exist, if you have not created
one, nor asked for one, nor deployed a web application, all of them
auto-create it if it is missing.

There may be different implementations of a Host. It needs
configuration (name). Thus initially there is none created.

Calling tomcat.getHost() should be enough.

Note, that Tomcat needs a default web application (aka context with
path "", aka ROOT) for certain features (error reporting) to work
properly.

>>
>> Mar 14, 2013 2:39:04 PM org.apache.coyote.AbstractProtocol init
>> INFO: Initializing ProtocolHandler ["http-bio-8973"]
>> Mar 14, 2013 2:39:04 PM org.apache.catalina.core.StandardService startInternal
>> INFO: Starting service Tomcat
>> Mar 14, 2013 2:39:04 PM org.apache.coyote.AbstractProtocol start
>> INFO: Starting ProtocolHandler ["http-bio-8973"]
>> Mar 14, 2013 2:39:04 PM org.apache.catalina.core.StandardService startInternal
>> SEVERE: Failed to start connector [Connector[HTTP/1.1-8973]]
>> org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-8973]]
>>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
>>     at org.apache.catalina.core.StandardService.startInternal (StandardService.java:459)
>>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>>     at org.apache.catalina.core.StandardServer.startInternal (StandardServer.java:732)
>>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>>     at org.apache.catalina.startup.Tomcat.start (Tomcat.java:335)
>>     at com.ul.Bootstrap.main(Bootstrap.java:15)
>> Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.connector.MapperListener@(protected)]
>>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
>>     at org.apache.catalina.connector.Connector.startInternal (Connector.java:1022)
>>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>>     ... 6 more
>> Caused by: java.lang.NullPointerException
>>     at org.apache.catalina.connector.MapperListener.findDefaultHost (MapperListener.java:252)
>>     at org.apache.catalina.connector.MapperListener.startInternal (MapperListener.java:104)
>>     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>>     ... 8 more
>>
>> X: null
>
> I resolved the NullPointerException by calling tomcat.getService().setContainer(tomcat.getEngine()) between init() and start(). Everything is working fine now, and I can go to http://localhost:8973/MyServlet and it's working great, but I still suspect I'm doing something wrong, since no documentation or tutorials anywhere mention needing to do that and it seems that the container should automatically be set on the service...

There are a number of working examples in the testsuite.

Best regards,
Konstantin Kolinko


Attachment: users_240395.eml (zipped)
On 14/03/2013 20:40, solar@(protected):
> I had tomcat working earlier today, now it won't start. Not sure what I did, as I was in the process of trying to
> integrate it with apache.
>
> attaching log, but that probably won't go through.
>
> Mar 14, 2013 4:21:57 PM org.apache.catalina.startup.Catalina load
> WARNING: Catalina.start using conf/server.xml: Error at (105, 117) : org.apache.jk.config.ApacheConfig
> Mar 14, 2013 4:21:57 PM org.apache.catalina.startup.Catalina start
> SEVERE: Cannot start server. Server instance is not configured.

/me Reaches for crystal ball to try and determine key information like
Tomcat version number.

Mark


Attachment: users_240397.eml (zipped)

>
> /me Reaches for crystal ball to try and determine key information like
> Tomcat version number.
>
> Mark
>

Tomcat 7.0.37
Tomcat Connectors 1.2.37
Apache 2.2.22


Attachment: users_240398.eml (zipped)
On 14/03/2013 20:45, solar@(protected):
>
>>
>> /me Reaches for crystal ball to try and determine key information like
>> Tomcat version number.
>>
>> Mark
>>
>
> Tomcat 7.0.37
> Tomcat Connectors 1.2.37
> Apache 2.2.22

Use the real documentation [1] rather than a clearly very old, very out
of date guide you dug up vis Google that has you trying to use a class
that was removed several years ago and deprecated even longer ago.

Mark


[1] http://tomcat.apache.org/connectors-doc/generic_howto/quick.html



Attachment: users_240400.eml (zipped)
Mark Thomas wrote:
> On 14/03/2013 20:40, solar@(protected):
>> I had tomcat working earlier today, now it won't start. Not sure what I did, as I was in the process of trying to
>> integrate it with apache.
>>
>> attaching log, but that probably won't go through.
>>
>> Mar 14, 2013 4:21:57 PM org.apache.catalina.startup.Catalina load
>> WARNING: Catalina.start using conf/server.xml: Error at (105, 117) : org.apache.jk.config.ApacheConfig
>> Mar 14, 2013 4:21:57 PM org.apache.catalina.startup.Catalina start
>> SEVERE: Cannot start server. Server instance is not configured.
>
> /me Reaches for crystal ball to try and determine key information like
> Tomcat version number.
>
Yes, specially if it has this :
conf/server.xml: Error at (105, 117) : org.apache.jk.config.ApacheConfig

That sounds like something from a long-long time ago.



Attachment: users_240401.eml (zipped)


> -------Original Message-------
> From: Mark Thomas <markt@(protected)>
> To: Tomcat Users List <users@(protected)>
> Subject: Re: tomcat dead, service won't start
> Sent: Mar 14 '13 16:48
>
> On 14/03/2013 20:45, solar@(protected):
> >
> >>  
> >>  /me Reaches for crystal ball to try and determine key information like
> >>  Tomcat version number.
> >>  
> >>  Mark
> >>  
> >
> > Tomcat 7.0.37
> > Tomcat Connectors 1.2.37
> > Apache 2.2.22
>
> Use the real documentation [1] rather than a clearly very old, very out
> of date guide you dug up vis Google that has you trying to use a class
> that was removed several years ago and deprecated even longer ago.
>
> Mark
>
>
> [1] http://tomcat.apache.org/connectors-doc/generic_howto/quick.html
>
I didn't dig it up on google, i was using the docs listed on tomcat.apache.org

If they have old docs on their site, well that's on them.

Steve Spence, KK4HFJ
http://arduinotronics.blogspot.com
http://www.essnmag.com


Attachment: users_240402.eml (zipped)
On 14/03/2013 20:59, solar@(protected):
>
>
>> -------Original Message-------
>> From: Mark Thomas <markt@(protected)>
>> To: Tomcat Users List <users@(protected)>
>> Subject: Re: tomcat dead, service won't start
>> Sent: Mar 14 '13 16:48
>>
>> On 14/03/2013 20:45, solar@(protected):
>> >
>> >>
>> >> /me Reaches for crystal ball to try and determine key information like
>> >> Tomcat version number.
>> >>
>> >> Mark
>> >>
>> >
>> > Tomcat 7.0.37
>> > Tomcat Connectors 1.2.37
>> > Apache 2.2.22
>>
>> Use the real documentation [1] rather than a clearly very old, very out
>> of date guide you dug up vis Google that has you trying to use a class
>> that was removed several years ago and deprecated even longer ago.
>>
>> Mark
>>
>>
>> [1] http://tomcat.apache.org/connectors-doc/generic_howto/quick.html
>>
> I didn't dig it up on google, i was using the docs listed on tomcat.apache.org
>
> If they have old docs on their site, well that's on them.

Where did you find a reference to org.apache.jk.config.ApacheConfig ?

Exact URL please.

Mark



Attachment: users_240403.eml (zipped)


> -----Original Message-----
> From: solar@(protected)]
> Sent: Thursday, March 14, 2013 4:59 PM
> To: Tomcat Users List
> Subject: Re: tomcat dead, service won't start
>
>
>
> > -------Original Message-------
> > From: Mark Thomas <markt@(protected)>
> > To: Tomcat Users List <users@(protected)>
> > Subject: Re: tomcat dead, service won't start
> > Sent: Mar 14 '13 16:48
> >
> > On 14/03/2013 20:45, solar@(protected):
> > >
> > >>
> > >> /me Reaches for crystal ball to try and determine key
> information
> > like >> Tomcat version number.
> > >>
> > >> Mark
> > >>
> > >
> > > Tomcat 7.0.37
> > > Tomcat Connectors 1.2.37
> > > Apache 2.2.22
> >
> > Use the real documentation [1] rather than a clearly very old, very
> > out of date guide you dug up vis Google that has you trying to use a
> > class that was removed several years ago and deprecated even longer
> ago.
> >
> > Mark
> >
> >
> > [1] http://tomcat.apache.org/connectors-doc/generic_howto/quick.html
> >
> I didn't dig it up on google, i was using the docs listed on
> tomcat.apache.org
>
> If they have old docs on their site, well that's on them.
>
> Steve Spence, KK4HFJ
> http://arduinotronics.blogspot.com
> http://www.essnmag.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)

Mark, Andre,

I gave him the link to http://tomcat.apache.org/connectors-doc/ and copied from the Tomcat connector page.

In looking at the quick.html page, the information is somewhat out of date:

"You should first have mod_jk.so (unix) or mod_jk.dll (Windows) installed in your Apache module directory (see your Apache documentation to locate it).

"Usual locations for modules directory on Unix:

"/usr/lib/apache/
/usr/lib/apache2/
/usr/local/apache/libexec/

"Usual locations for modules directory on Windows :

"C:\Program Files\Apache Group\Apache\modules\
C:\Program Files\Apache Group\Apache2\modules\"

Note the references to mod_jk.dll, and "Apache Group".

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.

Attachment: users_240404.eml (zipped)

  
> >>  Use the real documentation [1] rather than a clearly very old, very out
> >>  of date guide you dug up vis Google that has you trying to use a class
> >>  that was removed several years ago and deprecated even longer ago.
> >>  
> >>  Mark
> >>  
> >>  
> >>  [1] http://tomcat.apache.org/connectors-doc/generic_howto/quick.html
> >>  
> > I didn't dig it up on google, i was using the docs listed on tomcat.apache.org
> >
> > If they have old docs on their site, well that's on them.
>
> Where did you find a reference to org.apache.jk.config.ApacheConfig ?
>
> Exact URL please.
>
> Mark
>
>

http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html




Steve Spence, KK4HFJ
http://arduinotronics.blogspot.com
http://www.essnmag.com


Attachment: users_240405.eml (zipped)
On 14/03/2013 21:09, solar@(protected):
>
>  
>> >> Use the real documentation [1] rather than a clearly very old, very out
>> >> of date guide you dug up vis Google that has you trying to use a class
>> >> that was removed several years ago and deprecated even longer ago.
>> >>
>> >> Mark
>> >>
>> >>
>> >> [1] http://tomcat.apache.org/connectors-doc/generic_howto/quick.html
>> >>
>> > I didn't dig it up on google, i was using the docs listed on tomcat.apache.org
>> >
>> > If they have old docs on their site, well that's on them.
>>
>> Where did you find a reference to org.apache.jk.config.ApacheConfig ?
>>
>> Exact URL please.
>>
>> Mark
>>
>>
>
> http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html

In the section that says it is specific to Tomcat 5.5.x only?

That doc could do with a refresh but the odds of something that is
specific to 5.5.x working on Tomcat 7 are slim to say the least.

auto-configure doesn't exist in Tomcat 7.

Mark



Attachment: users_240407.eml (zipped)


> >
> > http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html
>
> In the section that says it is specific to Tomcat 5.5.x only?
>
> That doc could do with a refresh but the odds of something that is
> specific to 5.5.x working on Tomcat 7 are slim to say the least.
>
> auto-configure doesn't exist in Tomcat 7.
>

There are many common features between Tomcat 5, 6, and 7. How are we supposed to know
which ones are deprecated, unless the documentation is updated? The text says "this example is
specific to Tomcat 5.x", not "this capability is not available after Tomcat 5.x".

(I note in passing that this page also still has references to Tomcat 3.x!)

> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.

Attachment: users_240409.eml (zipped)
On 14/03/2013 21:17, Harris, Jeffrey E. wrote:
>
>
>>>
>>> http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html
>>
>> In the section that says it is specific to Tomcat 5.5.x only?
>>
>> That doc could do with a refresh but the odds of something that is
>> specific to 5.5.x working on Tomcat 7 are slim to say the least.
>>
>> auto-configure doesn't exist in Tomcat 7.
>>
>
> There are many common features between Tomcat 5, 6, and 7. How are we supposed to know
> which ones are deprecated, unless the documentation is updated? The text says "this example is
> specific to Tomcat 5.x", not "this capability is not available after Tomcat 5.x".
>
> (I note in passing that this page also still has references to Tomcat 3.x!)

Like I said, the doc needs a refresh.

I gave it a quick scan. References to httpd 1.3, Tomcat 3, Tomcat 4,
Tomcat 5, mod_jserv and auto-configure need to be removed and I don't
know how accurate the build instructions are but the bulk of it - the
directive information - looks fine.

I'd also note (as Rainer has mentioned numerous times on this list)
that the mod_jk sources include more extensive configuration examples
[1] that are probably a better starting point.

Mark

[1] http://svn.apache.org/viewvc/tomcat/jk/trunk/conf/



Attachment: users_240396.eml (zipped)
That would have been good to hear earlier, as I have now killed tomcat somehow. I'll see if I can get tomcat back
up, and try your advice.


Steve Spence, KK4HFJ
http://arduinotronics.blogspot.com
http://www.essnmag.com


> -------Original Message-------
> From: André Warnier <aw@(protected)>
> To: Tomcat Users List <users@(protected)>
> Subject: Re: configuring tomcat7 with apache 2.2.22
> Sent: Mar 14 '13 16:40
>
> solar@(protected):
> > Although not a newbie to building websites in html and php, and physical computing in C/C++, I'm having a
dickens of a
> > time understanding the documentation of Integrating Tomcat 7 with my existing Apache 2.2.22 on WinXP
(company
> > supplied development pc, nothing I can do about that). Can I get a bit of handholding please?
> >
> > I'm trying to evaluate a java servlet that requires tomcat.
> >
>
> Actually, if the purpose is purely to evaluate a java servlet, you do not really need
> Apache httpd in front.  Tomcat will act as a stand-alone webserver just fine, and will
> provide access to your servlet.
>
> The simplest under Windows XP :
> - from the tomcat website tomcat.apache.org, download tomcat (the "Windows service
> installer" version is easiest in this case).
> - install it
> - check if the Tomcat service is running. If it is, stop it (for the next step).
> - under the top directory of that installation, find the "webapps" sub-directory. Copy
> your servlet there (if it comes as a .war file) (*).
> - start tomcat (the service)
> - point your browser at : http://localhost:8080/(name of your servlet)
>
> and there you go.
>
> Then once that works, you can think about configuring Apache as a front-end to tomcat and
> try that.
>
>
> (*) if your servlet (actually, I suppose "webapp" would be a better name) does not come
> packaged as a .war file, then :
> - unzip or copy it in some new directory, to see what it looks like
> - it should be a bunch of files under some top directory (say "myApp")
> - copy that whole directory and all its files (including the top directory "myApp") under
> the "webapps" directory of Tomcat, so that you have :
> C:\tomcatx.y\webapps\myApp
> - start tomcat and proceed like above
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>


Attachment: users_240399.eml (zipped)
> -----Original Message-----
> From: solar@(protected)]
> Sent: Thursday, March 14, 2013 4:43 PM
> To: Tomcat Users List
> Subject: Re: configuring tomcat7 with apache 2.2.22
>
> That would have been good to hear earlier, as I have now killed tomcat
> somehow. I'll see if I can get tomcat back up, and try your advice.
>
>
> Steve Spence, KK4HFJ
> http://arduinotronics.blogspot.com
> http://www.essnmag.com
>

If you have a connector configured for ajp_13 on port 8009, try commenting out the connector in server.xml, and then retry starting Tomcat. Remember you need to use the <!-- and --> notation for commenting out XML and you need to comment out the whole connector, not just the first line (see other sections of the file that have comments to see how to apply the syntax).

Jeffrey Harris

This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.

Attachment: users_240406.eml (zipped)
I added the access log and now I know what url is being called ,  this is
the url   I configured my loadbalancer to check application is running
fine. The url is of a servlet , this servlet sure does not create session
and it forwards to a jsp using




the jsp is



I am not creating any session with these two , resources ,am i?




--
Sent from the Tomcat - User mailing list archive at Nabble.com.


Attachment: users_240411.eml (zipped)
I think one of my filters are involved in creating session , I tried in dev
box calling the url called by load balancer ,and saw that a session is
getting created  every time its a new browser, so then I  called a html
file  still session is being created, I use some of the filters which I
cannot make changes to, so I am, wondering , If I can add something  like
a filter in web.xml which will bypass all other filters if url is lets say
/myaap/ping.html how to bypass all other filters and serve the request ?




--
Sent from the Tomcat - User mailing list archive at Nabble.com.


Attachment: users_240410.eml (zipped)
is there any way I can check load on the server , my loadbabalncer calls a
web resource to check if server is able to handle request , if time for
repononse exceeds specified linit it  launches a new server instance to
handle request.Please advice me what is the best way to detect load on a
server ?




--
Sent from the Tomcat - User mailing list archive at Nabble.com.


Attachment: users_240412.eml (zipped)
fachhoch wrote:
> is there any way I can check load on the server , my loadbabalncer calls a
> web resource to check if server is able to handle request , if time for
> repononse exceeds specified linit it  launches a new server instance to
> handle request.Please advice me what is the best way to detect load on a
> server ?
>
Hi.
Since yesterday at 16:30, you have sent 9 messages to this list, all with different
questions and making it sound like you are in a total panic.
It reminds me of a Walt Disney movie called the Sorcerer's Apprentice.
It sounds like you have set up something that you don't really know how to control,
because you do not really understand the basics of it, or because there are too many
different things to control at once.
(If you do not understand what I mean, just re-read your own posts)

Should you not take a break, have a cup of coffee, start from the beginning, with one
Tomcat on one host, read the documentation, try to understand what is going on, and then
gradually add one piece at a time and go on to bigger things when you are a bit more sure
of what you are doing ?

We can probably not help you right now anyway. You are asking too many questions, about
too many different things in too many directions, many of which go beyond what a Tomcat
User's list is there for.




Attachment: users_240413.eml (zipped)
Hi Dan

Earlier I gave him an example of a DWR backend bean which handles the mechanics of Runtime.getRuntime().exec("cmd.,exe /C 'fubar'");

I *was* going to suggest using An Applet but I didnt want to spend the rest of the month twiddling the exact permutation of execute and read permissions

Thanks for the link!
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

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.




> Subject: Re: Running a binary program from a JSP
> From: dmikusa@(protected)
> Date: Thu, 14 Mar 2013 08:06:06 -0400
> To: users@(protected)
>
> On Mar 14, 2013, at 12:34 AM, Tim Gross wrote:
>
> > Hi,
> >
> > I want to know if it is possible to execute a binary program (written in C)
> > from within a JSP.
>
> Yes.
>
> > I would like to do this on the server side, not the
> > browser, in Tomcat6. If it is possible, can somebody provide an example.
>
> Use...
>
> http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html
>
> or
>
> http://docs.oracle.com/javase/6/docs/api/java/lang/ProcessBuilder.html
>
> Google can give you examples.
>
> Dan
>
> > Sorry if I am using the wrong mailing list. Feel free to redirect me if
> > that is the case.
> >
> > Thanks,
> >
> > Tim.
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
           

Attachment: users_240414.eml (zipped)

On Mar 14, 2013, at 4:25 PM, Konstantin Kolinko wrote:

> 2013/3/15 Nick Williams <nicholas@(protected)>:
>>
>> On Mar 14, 2013, at 2:56 PM, Nick Williams wrote:
>>
>>> Using a variety of tutorials I found online and the documentation for o.a.c.startup.Tomcat, I created the following main method to start up an embedded Tomcat. I'm using 7.0.37 Tomcat JARs.
>>>
>>>  public static void main(String... arguments) throws Exception
>>>  {
>>>     Tomcat tomcat = new Tomcat();
>>>     tomcat.setBaseDir(".basedir");
>>>     tomcat.setPort(8973);
>>>     tomcat.enableNaming();
>>>     tomcat.init();
>>>     tomcat.start();
>>>
>>>     System.out.println("X: " + tomcat.getConnector().getService().getContainer());
>>>
>>>     tomcat.getServer().await();
>>>  }
>>>
>>> The System.out.println is for debugging purposes, because I'm getting a NullPointerException. Obviously I'm doing something wrong, because about an hour of Googling turned up precisely zero results of anyone who's getting a NullPointerException in MapperListener#findDefaultHost. For some reason, it looks like a Container is never created. What gives? Here's the full output of running the JAR file:
>
>
> Why do you expect that default "Host" exist, if you have not created
> one, nor asked for one, nor deployed a web application, all of them
> auto-create it if it is missing.
>
> There may be different implementations of a Host. It needs
> configuration (name). Thus initially there is none created.
>
> Calling tomcat.getHost() should be enough.
>
> Note, that Tomcat needs a default web application (aka context with
> path "", aka ROOT) for certain features (error reporting) to work
> properly.

I understand what I was doing wrong, now. I was trying to take any web application errors out of the picture so that I could solve any other problems I was having first. I didn't realize that you couldn't start normally if you didn't have any applications to deploy, so I was actually causing more problems by removing the adding of my web application.

I don't need tomcat.getService().setContainer(tomcat.getEngine()) anymore now that I'm calling addWebapp on a proper web application.

Mark, my application successfully deploys to the ROOT context in the embedded Tomcat and a test servlet (/healthCheck) starts up properly and requests to it resolve properly. However, my WebSocket endpoints were not working. I was getting 404 errors for any requests to them. It tracked it down to missing service providers. The following files are missing from the org.apache.tomcat.embed:tomcat-embed-core artifact:

META-INF/services/javax.servlet.ServletContainerInitializer
META-INF/services/javax.websocket.ContainerProvider
META-INF/services/javax.websocket.server.ServerContainerProvider
META-INF/services/javax.websocket.server.ServerEndpointConfig.Configurator

When I added those to my uber-jar embedded JAR file, WebSockets started working properly. So, looks like something about the way that artifact is built is omitting those files accidentally. I can file a bug about this if you need me to.

Attachment: users_240415.eml (zipped)
In the mirrors [1] there are two different versions of the native library: standard (presumably) and OCSP. I gathered that the OCSP versions has OCSP support. Is this support still experimental? Which one should you use? I assume since both are still provided that there are reasons that you might pick either over the other. Can anyone shed some light on when you would pick standard and when you would pick OCSP?

Thanks.

[1] http://www.bizdirusa.com/mirrors/apache/tomcat/tomcat-connectors/native/1.1.27/binaries/

Attachment: users_240416.eml (zipped)
On Thu, Mar 14, 2013 at 12:00 PM, Thomas, Steve <sthomas@(protected):

>
> Running Tomcat 7.0.23 or 7.0.37 (32 or 64-bit) installed as a service
> (either via service.bat or the exe installer) on a Windows 7 64-bit OS, we
> are seeing an issue where the Windows shutdown kills Tomcat before our
> webapp shutdown sequence has time to execute fully.


(Specifically, we just want to make sure our instance of HSQLDB shuts down
> correctly, otherwise corruption can ensue.)
>
>
Few months ago, my web app was running on Windows Server 2003 R2, 32-bit
Client JVM and Tomcat versions 7.0.34 and 7.0.35. Within the last 3 months,
my web app has been running on Windows Server 2008 R2, 64-bit Server JVM,
and Tomcat version 7.0.35 and 7.0.37 (since I am running TomEE 1.5.2+).

anyway, Windows shutdown and restarted itself because of Windows Updates
(automatic updates) and i have experienced at least 1 power outage due to
storm(s), and my Apache Derby (embedded) has not corrupted yet, at all.


> Can we guarantee that Windows won't just kill our Tomcat process and
> potentially corrupt our database? That's the question.
>
>
Per my experience, when Windows shut down, it seems as though Windows
clicks the Stop button on the tomcat7w.exe window. It 'stops' or 'shuts
down' Tomcat....'normally'. And also, as I stated earlier, it does not
leave my database corrupted.

Now, prior to using TomEE/Tomcat, I used Glassfish 3.1+, and I came across
some shutdown hook code, and wanted to use it to 'shut down my database
normally'. Do I really need it? Honestly, I don't think so, but i get no
exceptions when shutting down the Apache Derby database, so I'll leave it
in my CDI @ApplicationScoped @PreDestroy method.

So, below is my log when Tomcat shut down normally, because Windows shut
down due to Windows Update (automatic) the other night. See below. The last
line below is when server restarted and TomEE/tomcat7 restarted, since
tomcat7 service starts...automatically.

Mar 13, 2013 1:42:24 AM jsf.users.pf_UsersController logout
INFO: pf_UsersController.logout(): administrator logged out at Wed Mar 13
01:42:24 EDT 2013
Mar 13, 2013 2:42:59 AM org.apache.openejb.cdi.CdiAppContextsService
lazyStartSessionContext
WARNING: Could NOT lazily initialize session context because of null
RequestContext
Mar 13, 2013 2:42:59 AM org.apache.openejb.cdi.CdiAppContextsService
lazyStartSessionContext
WARNING: Could NOT lazily initialize session context because of null
RequestContext
Mar 13, 2013 3:03:30 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-nio-8080"]
Mar 13, 2013 3:03:31 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Mar 13, 2013 3:03:31 AM org.apache.catalina.core.StandardService
stopInternal
INFO: Stopping service Catalina
Mar 13, 2013 3:03:31 AM org.apache.openejb.assembler.classic.Assembler
destroyApplication
INFO: Undeploying app: D:\apache-tomee-plus-1.6.0-SNAPSHOT\webapps\mcmsweb
Mar 13, 2013 3:03:31 AM pf.ApplicationScopeBean destroy
INFO: ApplicationScopeBean.destroy() invoked
Mar 13, 2013 3:03:31 AM utils.database.DerbyUtil shutdown
INFO: DerbyUtil.java: shutdown() invoked
Mar 13, 2013 3:03:31 AM utils.database.DerbyUtil loadDriver
INFO: DerbyUtil.java: loadDriver(): Loaded driver
(org.apache.derby.jdbc.EmbeddedDriver) successfully
Mar 13, 2013 3:03:31 AM utils.database.DerbyUtil shutdown
INFO: DerbyUtil.java: shutdown(): Derby shut down normally
Mar 13, 2013 3:03:31 AM pf.ApplicationScopeBean destroy
INFO: ApplicationScopeBean.destroy(): gCalUtil.shutdown() completed
Mar 13, 2013 3:03:31 AM pf.ApplicationScopeBean destroy
INFO: ApplicationScopeBean.destroy(): jodConverter.shutdown() completed
Mar 13, 2013 3:03:31 AM mdb.ApplicationMessageBean shutdown
INFO: ApplicationMessageBean.shutdown() BEGIN
Mar 13, 2013 3:03:31 AM mdb.ApplicationMessageBean shutdown
INFO: ApplicationMessageBean.shutdown() END
Mar 13, 2013 3:03:31 AM pf.ApplicationScopeBean destroy
INFO: ApplicationScopeBean.destroy(): applicationMessageBean.shutdown()
completed
Mar 13, 2013 3:03:31 AM org.apache.activemq.ra.ActiveMQEndpointWorker stop
INFO: Stopping
Mar 13, 2013 3:03:31 AM org.apache.activemq.ra.ActiveMQEndpointWorker stop
INFO: Stopping
Mar 13, 2013 3:03:32 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [/mcmsweb] appears to have started a thread
named [PoolIdleReleaseTimer] but has failed to stop it. This is very likely
to create a memory leak.
Mar 13, 2013 3:03:32 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [/mcmsweb] appears to have started a thread
named [Default JMS Resource Adapter-worker-1] but has failed to stop it.
This is very likely to create a memory leak.
Mar 13, 2013 3:03:32 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [/mcmsweb] appears to have started a thread
named [Default JMS Resource Adapter-worker-2] but has failed to stop it.
This is very likely to create a memory leak.
Mar 13, 2013 3:03:32 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [/mcmsweb] appears to have started a thread
named [ActiveMQ VMTransport: vm://localhost#5-2] but has failed to stop it.
This is very likely to create a memory leak.
Mar 13, 2013 3:03:32 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [/mcmsweb] appears to have started a thread
named [ActiveMQ VMTransport: vm://localhost#5-3] but has failed to stop it.
This is very likely to create a memory leak.
Mar 13, 2013 3:03:32 AM org.apache.catalina.loader.WebappClassLoader
clearReferencesThreads
SEVERE: The web application [/mcmsweb] appears to have started a thread
named [ActiveMQ VMTransport: vm://localhost#4-2] but has failed to stop it.
This is very likely to create a memory leak.
Mar 13, 2013 3:03:32 AM org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks
SEVERE: The web application [/mcmsweb] created a ThreadLocal with key of
type [com.google.gson.Gson$1] (value [com.google.gson.Gson$1@(protected)
a value of type [java.util.HashMap] (value [{}]) but failed to remove it
when the web application was stopped. Threads are going to be renewed over
time to try and avoid a probable memory leak.
Mar 13, 2013 3:03:32 AM org.apache.catalina.loader.WebappClassLoader
checkThreadLocalMapForLeaks
SEVERE: The web application [/mcmsweb] created a ThreadLocal with key of
type [com.google.api.client.util.escape.Platform$1] (value
[com.google.api.client.util.escape.Platform$1@(protected)
[char[]] (value [[C@(protected)
application was stopped. Threads are going to be renewed over time to try
and avoid a probable memory leak.
Mar 13, 2013 3:03:33 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-nio-8080"]
Mar 13, 2013 3:03:33 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Mar 13, 2013 3:03:33 AM org.apache.openejb.server.SimpleServiceManager stop
INFO: Stopping server services
Mar 13, 2013 3:03:33 AM org.quartz.core.QuartzScheduler shutdown
INFO: Scheduler OpenEJB-TimerService-Scheduler_$_OpenEJB shutting down.
Mar 13, 2013 3:03:33 AM org.quartz.core.QuartzScheduler standby
INFO: Scheduler OpenEJB-TimerService-Scheduler_$_OpenEJB paused.
Mar 13, 2013 3:03:33 AM org.quartz.core.QuartzScheduler unregisterJMX
INFO: Scheduler unregistered from name
'quartz:type=QuartzScheduler,name=OpenEJB-TimerService-Scheduler,instance=OpenEJB'
in the local MBeanServer.
Mar 13, 2013 3:03:33 AM org.apache.openejb.assembler.classic.Assembler
destroyApplication
INFO: Undeploying app: openejb
Mar 13, 2013 3:03:33 AM org.quartz.core.QuartzScheduler shutdown
INFO: Scheduler OpenEJB-TimerService-Scheduler_$_OpenEJB shutdown complete.
Mar 13, 2013 3:03:33 AM org.apache.openejb.assembler.classic.Assembler
destroyResource
INFO: Stopping ResourceAdapter: Default JMS Resource Adapter
Mar 13, 2013 3:03:33 AM
org.apache.openejb.resource.activemq.ActiveMQResourceAdapter stop
INFO: Stopping ActiveMQ
Mar 13, 2013 3:03:35 AM
org.apache.openejb.resource.activemq.ActiveMQResourceAdapter stopImpl
INFO: Stopped ActiveMQ broker
Mar 13, 2013 3:03:35 AM org.apache.openejb.assembler.classic.Assembler
destroyResource
INFO: Closing DataSource: Default Unmanaged JDBC Database

2013-03-13 03:06:01 Commons Daemon procrun stderr initialized

Attachment: users_240417.eml (zipped)

>Interesting.
>
>If the problem was too many sockets in CLOSE_WAIT, consider looking at
>the connectionLinger setting on your AJP connector's in Tomcat.

>Mark

Mhh.. I haven't heard about the options before.. But it sound like a great idea.. Default is -1. So what would be a good time, one minute?

Thanks

Mit freundlichen Grüßen
David Kumar
Softwareentwickler, B. Sc.
Abteilung Infotech - Interaktiv
TELESTAR-DIGITAL GmbH
Am Weiher 14
D-56766 Ulmen

http://www.telestar.de/


Attachment: users_240418.eml (zipped)

sry I was wrong default is -1 what menas it is disabled, so I'm fine..?!?


>Interesting.
>
>If the problem was too many sockets in CLOSE_WAIT, consider looking at
>the connectionLinger setting on your AJP connector's in Tomcat.

>Mark

Mhh.. I haven't heard about the options before.. But it sound like a great idea.. Default is -1. So what would be a good time, one minute?

Thanks

Mit freundlichen Grüßen
David Kumar
Softwareentwickler, B. Sc.
Abteilung Infotech - Interaktiv
TELESTAR-DIGITAL GmbH
Am Weiher 14
D-56766 Ulmen

http://www.telestar.de/




Attachment: users_240419.eml (zipped)

hey,
>Yes. Whether this is the java that runs tomcat is not immediately evident.
>But it also seems that they concern port numbers like 7009, 9009 etc. which >must be your
>AJP Connectors, so let's assume the CLOSE-WAITs all involve Tomcat.
>
>The first observation hat I would make is that this looks like a pretty >busy system.
>
>Then, there are 2100+ lines in that list. Let's assume first that they are >all internal
>connections (which probable they are not, but for simplicity), so that >there are actually
>2 lines for the same connection, like these :
>
>tcp     0    0 127.0.0.1:39872      127.0.0.1:7009       >FIN_WAIT2
>20766/apache2
>. ..
>tcp6     1    0 127.0.0.1:7009       127.0.0.1:39872      >CLOSE_WAIT 20564/java
>
>..
>
>So let's say that we have in total about 1000 connections active in some >state.
>Compared to that, there are 54 connections in CLOSE_WAIT, which is like 5%.
>That does not really sound "pathological" to me, considering that >CLOSE_WAIT is a normal
>state through which any TCP connection goes at some point.
>
>If you look again at the above connection, and if I am not confusing my >clients and
>servers again, it looks here like :
>- Apache http (PID 20766), as a client, has established a connection to >port 7009 of the
>server Tomcat (PID 20564). That must be an AJP connection, from the mod_jk >module of
>Apache, to the AJP Connector in Tomcat.
>- A while later, Apache closes the connection. It sends a "FIN" packet to >Tomcat, and
>waits for Tomcat to acknowledge this FIN packet.
>- when it receives the FIN packet from Apache, Tomcat responds with an ACK, >and then goes
>to the CLOSE_WAIT state.
>- when Apache receives the ACK from Tomcat, it goes to state FIN_WAIT2.
>  (and that is the current state of the above connection)
>- now Tomcat is supposed to send a FIN to Apache, and receive an ACK in >return.
>- if Apache receives the FIN from Tomcat, it sends back an ACK, and goes >into state
>TIME_WAIT (where it doesn't expect anything anymore), and then after a >short moment, it
>discards that connection.
>
>If there are connections that remain in the CLOSE_WAIT state for very long, >it means that
>something in the last 2 steps above is not working.
>
>Now in your listing, we see about 1900 lines in the TIME_WAIT state, all of >them *to* an
>AJP port of Tomcat. This seems to suggest that the Apache side is working >as it should.
>But if the Tomcat side stays in CLOSE_WAIT for a long time, then it would >suggest that on
>the Tomcat side, that connection is never properly close()'d.

>But this is the request/response connection, so I doubt that there would be >a bug there,
>otherwise we'd have problems reports filling this list every day.
>
>Might there be that there is somewhere a discrepancy between the keep-alive >settings,
>between Apache and Tomcat ?
>
>or maybe your server is just not strong enough for the load you are putting >on it ?

According to vmtools the server is boring most times..

I almost totally agree, but I'm not sure if it is a AJP fault. Because most time everything is alright, so all of theses steps are done. Just sometimes after a arbitrarily amount of time ajp / tomcat runs crazy. And in my sample there is the sourceport 9009 / java. It looks for me that apache didn't received the ACK from tomcat after CLOSE_WAIT or it just don't care because apache thought this connections is already closed? Let's assume that is the case.. Isn't there a option to tell tomcat to wait max. time for a response and after that time kill the connection? As far as I understand connectionTimeout is just for the initial request, so after Apache did answer in first correctly connectionTimeout is valueless?

Attached you can find our configuration files, maybe you can find a / some misconfigurations?

I would agree that we have maybe a kind of misconfigured timeout problem...


thanks



Mit freundlichen Grüßen
David Kumar
Softwareentwickler, B. Sc.
Abteilung Infotech - Interaktiv
TELESTAR-DIGITAL GmbH
Am Weiher 14
D-56766 Ulmen

http://www.telestar.de/
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# The configuration directives are grouped into three basic sections:
# 1. Directives that control the operation of the Apache server process as a
#   whole (the 'global environment').
# 2. Directives that define the parameters of the 'main' or 'default' server,
#   which responds to requests that aren't handled by a virtual host.
#   These directives also provide default values for the settings
#   of all virtual hosts.
# 3. Settings for virtual hosts, which allow Web requests to be sent to
#   different IP addresses or hostnames and have them handled by the
#   same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "foo.log"
# with ServerRoot set to "/etc/apache2" will be interpreted by the
# server as "/etc/apache2/foo.log".
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
#ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
LockFile ${APACHE_LOCK_DIR}/accept.lock

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 600

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 120

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 6

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
  StartServers       5
  MinSpareServers     5
  MaxSpareServers    10
  MaxClients       150
  MaxRequestsPerChild  0
</IfModule>

# worker MPM [active]
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
#         graceful restart. ThreadLimit can only be changed by stopping
#         and starting Apache.
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves

#//siehe https://community.jboss.org/wiki/OptimalModjk12Configuration
<IfModule mpm_worker_module>
 StartServers       2
 #Apache.MaxClients = 0.8 * (Tomcat-1.maxThreads + … Tomcat-n.maxThreads) http://www.abcseo.com/tech/java/clustering-tomcat-apache#maxclients
 MaxClients       182
 MinSpareThreads    25
 MaxSpareThreads    75
 ThreadsPerChild    26
 MaxRequestsPerChild 0
</IfModule>

# event MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_event_module>
  StartServers       2
  MaxClients       150
  MinSpareThreads    25
  MaxSpareThreads    75
  ThreadLimit       64
  ThreadsPerChild    25
  MaxRequestsPerChild  0
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
  Order allow,deny
  Deny from all
  Satisfy all
</Files>

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value. If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf

# Include all the user configurations:
Include httpd.conf

# Include ports listing
Include ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
Include conf.d/

# Include the virtual host configurations:
Include sites-enabled/
<IfModule mod_jk.c>
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel error
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkRequestLogFormat "%w %V %T"
JkShmFile /var/log/apache2/jk.shm
</IfModule>
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
  define subcomponents such as "Valves" at this level.
  Documentation at /docs/config/server.html
-->
<Server port="7005" shutdown="SHUTDOWN">
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

<!-- Global JNDI resources
    Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
  <!-- Editable user database that can also be used by
     UserDatabaseRealm to authenticate users
  -->
  <Resource name="UserDatabase" auth="Container"
        type="org.apache.catalina.UserDatabase"
        description="User database that can be updated and saved"
        factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
        pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>

<!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" Note: A "Service" is not itself a "Container",
    so you may not define subcomponents such as "Valves" at this level.
    Documentation at /docs/config/service.html
 -->
<Service name="Catalina">

  <!--The connectors can use a shared executor, you can define one or more named thread pools-->
  <!--
  <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
    maxThreads="150" minSpareThreads="4"/>
  -->
 
 
  <!-- A "Connector" represents an endpoint by which requests are received
     and responses are returned. Documentation at :
     Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
     Java AJP Connector: /docs/config/ajp.html
     APR (HTTP/AJP) Connector: /docs/apr.html
     Define a non-SSL HTTP/1.1 Connector on port 7080
<Executor name="active-executor" namePrefix="activeThread-" maxThreads="200" minSpareThreads="30" maxIdleTime="60000" />
  -->
  <Connector port="7080" protocol="HTTP/1.1"
         connectionTimeout="20000"
         redirectPort="7443" />
  <!-- A "Connector" using the shared thread pool-->
  <!--
  <Connector executor="tomcatThreadPool"
         port="7080" protocol="HTTP/1.1"
         connectionTimeout="20000"
         redirectPort="8443" />
  -->      
  <!-- Define a SSL HTTP/1.1 Connector on port 8443
     This connector uses the JSSE configuration, when using APR, the
     connector should be using the OpenSSL style configuration
     described in the APR documentation -->
  <!--
  <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
         maxThreads="150" scheme="https" secure="true"
         clientAuth="false" sslProtocol="TLS" />
  -->

  <!-- Define an AJP 1.3 Connector on port 7009 -->
  <!-- siehe https://community.jboss.org/wiki/OptimalModjk12Configuration -->
  <Connector port="7009" protocol="AJP/1.3" redirectPort="7443" maxThreads="200" connectionTimeout="200000" />


  <!-- An Engine represents the entry point (within Catalina) that processes
     every request. The Engine implementation for Tomcat stand alone
     analyzes the HTTP headers included with the request, and passes them
     on to the appropriate Host (virtual host).
     Documentation at /docs/config/engine.html -->

  <!-- You should set jvmRoute to support load-balancing via AJP ie :
  <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">      
  -->
  <Engine name="Catalina" defaultHost="localhost">

   <!--For clustering, please take a look at documentation at:
      /docs/cluster-howto.html (simple how to)
      /docs/config/cluster.html (reference documentation) -->
   <!--
   <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
   -->    

   <!-- Use the LockOutRealm to prevent attempts to guess user passwords
      via a brute-force attack -->
   <Realm className="org.apache.catalina.realm.LockOutRealm">
    <!-- This Realm uses the UserDatabase configured in the global JNDI
        resources under the key "UserDatabase". Any edits
        that are performed against this UserDatabase are immediately
        available for use by the Realm. -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
         resourceName="UserDatabase"/>
   </Realm>

   <Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="false">

    <!-- SingleSignOn valve, share authentication between web applications
        Documentation at: /docs/config/valve.html -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->

    <!-- Access log processes all example.
        Documentation at: /docs/config/valve.html
        Note: The pattern used is equivalent to using pattern="common" -->
     <!-- Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
         prefix="localhost_access_log." suffix=".txt"
         pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/-->    </Host>
  </Engine>
</Service>
</Server>
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
  define subcomponents such as "Valves" at this level.
  Documentation at /docs/config/server.html
-->
<Server port="9005" shutdown="SHUTDOWN">
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

<!-- Global JNDI resources
    Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
  <!-- Editable user database that can also be used by
     UserDatabaseRealm to authenticate users
  -->
  <Resource name="UserDatabase" auth="Container"
        type="org.apache.catalina.UserDatabase"
        description="User database that can be updated and saved"
        factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
        pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>

<!-- A "Service" is a collection of one or more "Connectors" that share
    a single "Container" Note: A "Service" is not itself a "Container",
    so you may not define subcomponents such as "Valves" at this level.
    Documentation at /docs/config/service.html
 -->
<Service name="Catalina">

  <!--The connectors can use a shared executor, you can define one or more named thread pools-->
  <!--
  <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
    maxThreads="150" minSpareThreads="4"/>
  -->
 
 
  <!-- A "Connector" represents an endpoint by which requests are received
     and responses are returned. Documentation at :
     Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
     Java AJP Connector: /docs/config/ajp.html
     APR (HTTP/AJP) Connector: /docs/apr.html
     Define a non-SSL HTTP/1.1 Connector on port 9080
<Executor name="active-executor" namePrefix="activeThread-" maxThreads="200" minSpareThreads="30" maxIdleTime="60000" />
  -->
  <Connector port="9080" protocol="HTTP/1.1"
         connectionTimeout="20000"
         redirectPort="9443" />
  <!-- A "Connector" using the shared thread pool-->
  <!--
  <Connector executor="tomcatThreadPool"
         port="9080" protocol="HTTP/1.1"
         connectionTimeout="20000"
         redirectPort="9443" />
  -->      
  <!-- Define a SSL HTTP/1.1 Connector on port 8443
     This connector uses the JSSE configuration, when using APR, the
     connector should be using the OpenSSL style configuration
     described in the APR documentation -->
  <!--
  <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
         maxThreads="150" scheme="https" secure="true"
         clientAuth="false" sslProtocol="TLS" />
  -->

  <!-- Define an AJP 1.3 Connector on port 9009 -->
  <!-- siehe https://community.jboss.org/wiki/OptimalModjk12Configuration -->
  <Connector port="9009" protocol="AJP/1.3" redirectPort="9443" maxThreads="200" connectionTimeout="200000" />


  <!-- An Engine represents the entry point (within Catalina) that processes
     every request. The Engine implementation for Tomcat stand alone
     analyzes the HTTP headers included with the request, and passes them
     on to the appropriate Host (virtual host).
     Documentation at /docs/config/engine.html -->

  <!-- You should set jvmRoute to support load-balancing via AJP ie :
  <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">      
  -->
  <Engine name="Catalina" defaultHost="localhost">

   <!--For clustering, please take a look at documentation at:
      /docs/cluster-howto.html (simple how to)
      /docs/config/cluster.html (reference documentation) -->
   <!--
   <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
   -->    

   <!-- Use the LockOutRealm to prevent attempts to guess user passwords
      via a brute-force attack -->
   <Realm className="org.apache.catalina.realm.LockOutRealm">
    <!-- This Realm uses the UserDatabase configured in the global JNDI
        resources under the key "UserDatabase". Any edits
        that are performed against this UserDatabase are immediately
        available for use by the Realm. -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
         resourceName="UserDatabase"/>
   </Realm>

   <Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="false">

    <!-- SingleSignOn valve, share authentication between web applications
        Documentation at: /docs/config/valve.html -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->

    <!-- Access log processes all example.
        Documentation at: /docs/config/valve.html
        Note: The pattern used is equivalent to using pattern="common" -->
     <!-- Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
         prefix="localhost_access_log." suffix=".txt"
         pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/-->    </Host>
  </Engine>
</Service>
</Server>
©2008 junlu.com - Jax Systems, LLC, U.S.A.