Re: Restarting tomcat 7.0.23 on MAC OS X 10.6

2012-01-24 Thread Francis GALIEGUE
On Mon, Jan 23, 2012 at 17:52, Caldarale, Charles R
 wrote:
>> From: Oliver Due Billing [mailto:o...@watagame.com]
>> Subject: Restarting tomcat 7.0.23 on MAC OS X 10.6
>
>> I have a test-server on my macbook pro and it takes forever to
>> restart the server do anyone have a clue to whats happening.
>
> It may be collecting entropy.  Take a thread dump, and see what the JVM is 
> doing during the pause.
>
> You can try setting
>
>   -Djava.security.egd=file:/dev/./urandom
>
> as a system property.  Note that the apparently extra "/." is required to 
> trick the JVM into using the alternate random byte source.
>

I was about to suggest this but wasn't sure that the problem also
existed for Mac OS X...

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Caching of protected static content with Expires header: Expires Thu, 01 Jan 1970 03:00:00 EET?

2012-01-20 Thread Francis GALIEGUE
On Fri, Jan 20, 2012 at 15:05,   wrote:
> Violeta Georgieva  wrote:
>
[...]
>>My question is why the expires header is set with this value? Doesn't
>>this
>>prevent caching?
>
> Yes. That is the point.
>

But there is no need for an expires header if you don't want caching.
It is enough to "Cache-control: no-cache" (or "no-store", though the
latter wreaks havoc on IE and downloads) or, if you are _still_ using
HTTP/1.0, "Pragma: no-cache". The "Expires" is not needed at all.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Caching of protected static content with Expires header: Expires Thu, 01 Jan 1970 03:00:00 EET?

2012-01-20 Thread Francis GALIEGUE
On Fri, Jan 20, 2012 at 14:03, Violeta Georgieva  wrote:
> Hi,
>
> If the static content is not protected then by default it is cached and the
> corresponding headers are set - see screenshot1 & screenshot2.
> but when I put it as protected content the following headers are set:
> Cache-control:private and Expires header: Expires Thu, 01 Jan 1970 03:00:00
> EET - see screenshot3 & screenshot4
> My question is why the expires header is set with this value? Doesn't this
> prevent caching?
>
> I'm running Tomcat 7.0.23
>

I take it you are using Tomcat's caching directives, so...

Show us the relevant portions of the configuration file.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: path used for tc-natuve

2011-12-12 Thread Francis GALIEGUE
On Mon, Dec 12, 2011 at 23:25, André Warnier  wrote:
[...]
>
> 1) these are the tomcat6 processes, as shown by "ps" :
> (sorry for the format, I hope it is readable)
>
> root     21245     1  0 21:19 ?        00:00:00 /usr/bin/jsvc -user tomcat55
> -cp /usr/share/java/commons-daemon.jar:/opt/tomcat6/bin/bootstrap.jar
> -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat6.pid
> -Djava.awt.headless=true -Xms256M -Xmx256M
> -Djava.endorsed.dirs=/opt/tomcat6/common/endorsed
> -Dcatalina.base=/opt/tomcat6 -Dcatalina.home=/opt/tomcat6
> -Djava.io.tmpdir=/opt/tomcat6/temp
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.util.logging.config.file=/opt/tomcat6/conf/logging.properties
> org.apache.catalina.startup.Bootstrap
>

Ah, jsvc... I though you invoked the JVM directly.

Does it have a configuration file? I have never used it, but I'd
definitely look there. There is no reason at all why the JVM alone
would play with shared objects unless you ask it to.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: path used for tc-natuve

2011-12-12 Thread Francis GALIEGUE
On Mon, Dec 12, 2011 at 17:36, André Warnier  wrote:
> Hi
>
> On a Debian Linux system, was running a Debian-pre-packaged Tomcat 5.5.
> We stopped this Tomcat 5.5, but did not remove the corresponding package(s).
> Then we installed an "official" Tomcat 6, downloaded from the Tomcat
> website, in /opt/tomcat6 as "CATALINA_HOME".
> We then made a copy of the /etc/init.d startup script which used to start
> Tomcat 5.5, and modified it to start this new Tomcat6 instead.
>
> Now when stopping and starting this Tomcat6, we are getting the message
> below (about APR) in the Tomcat6 logfile.
>
> My question is : where could Tomcat6 find this APR tc-native of the wrong
> version ?
> As far as I can tell, there is no unpacked tc-native anything in the Tomcat6
> directories.
>
>
> Dec 12, 2011 12:37:14 PM org.apache.coyote.http11.Http11Protocol destroy
> INFO: Stopping Coyote HTTP/1.1 on http-8180
> 12.12.2011 12:37:24 org.apache.catalina.core.AprLifecycleListener init
> SCHWERWIEGEND: An incompatible version 1.1.12 of the APR based Apache Tomcat
> Native library is installed, while Tomcat requires version 1.1.17

Can you:

perl -ple 's,\00,\n,g' /proc/$(pgrep java)/environ

and see what LD_LIBRARY_PATH is, if anything? (this is provided that
only one java process is running, otherwise adapt the pgrep command)

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Tomcat Silently Dies and then Won't Restart -- Error 1067

2011-12-09 Thread Francis GALIEGUE
On Fri, Dec 9, 2011 at 21:33, Robinson, Eric  wrote:
> Tomcat 6 on our Windows 2003 R2 x64 server runs fine for a day or two,
> then silently dies without leaving any messages in the log files. Then
> when we try to restart it, we get a Windows error 1067 and the service
> will not start. We have to reboot the whole server and then tomcat will
> work fine again for a couple of days. Has anyone else seen a problem
> like this?
>

It looks like a native error, ie a JVM error. Can you locate some
hs_err_ files in your Tomcat installation?

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: [OT] Recommendations for Amazon EC2 Linux Flavor

2011-12-07 Thread Francis GALIEGUE
On Wed, Dec 7, 2011 at 02:02, André Warnier  wrote:
[...]>
>
> I'd comment too on the lack of packages in RHEL.
> I know that lots of missing perl modules won't bother you much, but maybe a
> missing mod_jk will leave you less serene ?
>

Why use mod_jk when you have mod_proxy_ajp?


-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: [OT] Recommendations for Amazon EC2 Linux Flavor

2011-12-06 Thread Francis GALIEGUE
On Tue, Dec 6, 2011 at 23:23, Christopher Schultz
 wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> All,
>
> I'm provisioning my first Amazon EC2 instance and I was wondering if
> anyone has any recommendations on the flavor of Linux I choose.
>
> I am most familiar with the Debian/Ubuntu package management and
> administration and, of course, Amazon has neither of those as image
> types to choose. It looks like I can choose:
>
> * Fedora
> * CentOS
> * SUSE
> * "Amazon Linux"
>
> I have no idea what that last one is... it uses yum as it's package
> manager so I assume it's related to Fedora/RHEL.
>
> Any thoughts?
>

What are your primary concerns? If stability I'd definitely go for
CentOS, it is just an RHEL recompiled, and RHEL is damn stable (I use
it at work on all servers and haven't had an OS crash for five _years_
with it). And you have EPEL if you want extra packages which RHEL does
not provide.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: [OT]RE: Maximum memory that can be assigned to Tomcat on windows platform

2011-12-01 Thread Francis GALIEGUE
On Thu, Dec 1, 2011 at 12:29, Casper Wandahl Schmidt
 wrote:
[...]
>
> That didn't quite help me understand, because how can the OS map from ie.
> 0-4GB to 4-8GB (the window is moved) when it can only use a 32bit register
> to tell the machine where to look in the psysical memory, that is where my
> knowledge ends :) So I read about PAE and found out that it uses 2 registers
> (36 bits due to some bits being used as flags) and that makes good sense,
> but how can the cpu calculate an address without overflow and send a command
> to the bus containing a 36bit address (or whatever fetches the bits from
> RAM)? That is where I'm puzzled but I guess it is because I'm not at all
> into ISA-level and below :)
>

It is the role of the MMU to do that. At any one time, it can map a
"virtual", 32-bit wide, address to a "real", 36-bit wide address. It
uses TLBs (Translation Lookaside Buffers) for that, and it is the OS'
role to have the correct TLB in place at any time.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: [OT] Re: Maximum memory that can be assigned to Tomcat on windows platform

2011-11-30 Thread Francis GALIEGUE
On Wed, Nov 30, 2011 at 22:38, André Warnier  wrote:
[...]
>
> I am not knowledgeable at all in such questions, and while you are at it let
> me ask a question :
> Does the fact of having a system with a 64-bit CPU (and OS) necessarily (or
> usually) imply that data transfers between CPU and RAM happen also 64-bit in
> parallel ?
>

No, this depends on the bus width, not the address space. And bus
widths nowadays are rather in the range of 256/512 bits.

> For example, let' suppose that I have an application which handles a very
> large table of integers (the integers themselves being < 2exp31), and that
> periodically all elements of this table have to be updated.
> My understanding is that under a 32-bit platform, each integer will occupy
> 32 bit, while on a 64-bit platform each will occupy 64 bit (the source
> program remaining the same).
>
> If there is not a corresponding 64-bit parallel transfer between CPU and
> memory, then using a 64-bit CPU would be detrimental, no ?
> Or is this a non-sensical case nowadays ?
>

This depends on the alignment the JVM uses. If it aligns to 8 bytes,
then yes, any integer will take up 8 bytes, but so will any byte. In
general, the alignment is 4 bytes, except for long values of course.

With a 4 byte alignment, this means you can store two ints in a
register, and it's then only a matter of logical ands/shifting to
obtain the value you want. And these operations are ultra fast ;)

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



[OT] Re: Maximum memory that can be assigned to Tomcat on windows platform

2011-11-30 Thread Francis GALIEGUE
On Wed, Nov 30, 2011 at 18:51, Christopher Schultz
 wrote:
[...]
>
> Running a machine with more than 4GiB in 32-bit mode isn't stupid at
> all IMO. If you have relatively small processes, there's no need for
> the overhead of 64-bit even if you have 16GiB or more.
>

This is quite the opposite: a 32bit OS has _more_ overhead than a
64bit OS when running on a 64bit CPU.

Just consider filesystem calls such as read(), write(), seek(): their
arguments are 64bits, not 32, and have been so before 64bit was even
common (2+ GB files are common place today). With a 32bit OS on a
64bit CPU, you eat up two registers whereas a 64bit OS will take only
one.

And of course, this is without considering wasted TLB space or the
sheer time to address just one memory page.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Maximum memory that can be assigned to Tomcat on windows platform

2011-11-30 Thread Francis GALIEGUE
On Wed, Nov 30, 2011 at 11:44,   wrote:
> Hello ,
>        The question is not why I would use 32 bit JVM , the question is
> whether there is any maximum limit on memory for Tomcat and if yes why ?


The question _is_ why you use a 32bit OS and JVM with 8 GB RAM. Tomcat
is not limited in memory usage by itself, it is the JVM which limits
what it can consume.

In the best of cases (32bit Linux and 32bit Sun 1.6 JVM), you are
limited to a 3 GB heap size.

Use a 64bit OS and JVM.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Maximum memory that can be assigned to Tomcat on windows platform

2011-11-30 Thread Francis GALIEGUE
On Wed, Nov 30, 2011 at 09:37, Casper Wandahl Schmidt
 wrote:
>
[...]
>>
> Another question to ask is, why do you have 8GB memory when running 32bit?
> That is just stupid since 32bit cannot address more than 4GB of memory no
> matter what you do. Any sysadmin should know that right?
>
> disclaimer: I'm not a sysadmin, if I'm wrong please teach me :)
>

With PAE[1] you actually can address up to 2^36 RAM (therefore 64 GB).
But not all OSes support that, and anyway the addressable memory at
one time (and therefore max memory theoretically accessible to one
process at any given moment) is still 2^32.

[1] Physical Address Extension

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Maximum memory that can be assigned to Tomcat on windows platform

2011-11-30 Thread Francis GALIEGUE
On Wed, Nov 30, 2011 at 07:28,   wrote:
> Hi ,
>         Is there any cap on maximum memory that can be assigned to tomcat
> on 32 bit Windows machines ? I have found out that even if we have 8GB
> memory in the server , can not assign more 1.4/1.5 GB to Tomcat . I also
> found this thread which reinforces what I have been seeing ? We are using
> Tomcat 7.0.19 .
>
> www.theserverside.com/discussions/thread.tss?thread_id=48793
>

In any event, a 32bit JVM (1.6, I don't know for lower VMs) cannot
allocate more than 3 GB heap space.

"With so much RAM, why do you still use a 32bit OS and JVM" is the
question here.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Server crash for memory limit

2011-11-29 Thread Francis GALIEGUE
On Tue, Nov 29, 2011 at 16:26, hi tanin  wrote:
> Thanks for your reply. If i upgrated into 64-bit system

__AND__ 64bit JDK...

> then what will be the memory limit for Tomcat 5.0.27? Is there any way to 
> find out the mamimum memoery limit ?

More than you will be able to buy!

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Server crash for memory limit

2011-11-29 Thread Francis GALIEGUE
On Tue, Nov 29, 2011 at 16:05, hi tanin  wrote:
> Hi,
> I am using Tomcat 5.0.27. I cannot use more then 2GB for Tomcat 5.0.27. Our 
> OS is 32-bit Linux. Can ane one tell me why this happening? And is there any 
> way to get rid of this problem and use lot of memory?
>

Normally, the JVM allows for a max of 3 GB heap size to be specified,
not 2. Well, with the 1.6 versions of them at least.

And no, there's no way around it except upgrading to a 64bit arch and OS.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: CsrfPreventionFilter - LRU cache

2011-11-04 Thread Francis GALIEGUE
On Fri, Nov 4, 2011 at 20:23, Mark Thomas  wrote:
[...]
>
> I think the thing to do here is to work out what the 'best' solution is
> and fix the docs/code accordingly. I think LRU is the way to go in which
> case the current code needs fixing.
>

I see more arguments for the LRU case: when a CSRF attack appears for
whatever app is out there, for whatever defintion of "appears", it is
more likely that the same attack pattern will appear even on
unaffected sites.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Tomcat OOM errors..

2011-11-03 Thread Francis GALIEGUE
On Thu, Nov 3, 2011 at 16:25, celtic man  wrote:
>
> I see these errors(tomcat 6) :
>
> Exception in thread "http-bio-8080-exec-21"
> java.lang.OutOfMemoryError: PermGen space
> Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner
> $PoolThread-#0" java.lang.OutOfMemoryError: PermGen space
>
> And checked the the JAVA parameters : CATALINA_OPTS=-Xmx4000M
>
> Do i need to change that to
> =-Xms2048M -Xmx2048M -XX:Permsize=512m -
> XX:MaxPermsize=512m  ??
>

-Xmx only affects the heap, and here you have an OOM at the permgen
level, so yes you need to use -XX:MaxPermSize.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: [OT] Static files not being displayed

2011-10-28 Thread Francis GALIEGUE
On Fri, Oct 28, 2011 at 22:58, Christopher Schultz
 wrote:
[...]
>
> For some reason, the US likes to spend most of it's money
>

"its" ;)

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Static files not being displayed

2011-10-28 Thread Francis GALIEGUE
On Fri, Oct 28, 2011 at 21:34, André Warnier  wrote:
[...]
>>
>> I'd say, first, configure an AccessLogValve and give the output of it.
>> Tomcat definitely cannot find the requested files and there has to be
>> a reason for it.
>>
> There is certainly a reason, but we don't know yet if it is really Tomcat
> sending the 404 replies.

Which is exactly why I suggested that ;) If 404 is not seen in the
Tomcat access log file, then we know Tomcat isn't the culprit ;)

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Static files not being displayed

2011-10-28 Thread Francis GALIEGUE
On Fri, Oct 28, 2011 at 21:08, André Warnier  wrote:
> Rajkumar Singh wrote:
>>
>> Hello guys,
>>
>> I am using tomcat version 6.0.29. The tomcat is deployed on the OS Linux.
>>
>> I created a war file named ROOT.war and dropped it under the tomcat
>> "webapps" folder. The WAR consists of JSP, JAR, XML and static files like
>> images, javascript and CSS.
>>
>> The tomcat expanded the WAR file properly and I was able to get to the
>> dynamic files of my application through the URL. However what I noticed was
>> that all the static files are not fetched from the server. I get 404 error
>> in my firebug (Using firefox as my browser).
>>
>> And the dynamic files are shown correctly, no problem with that. Even my
>> application is making the database call and making right transaction with it
>>
>> Can someone please help me in resolving the issue? Is there any
>> configuration that needs to be done on the tomcat server. To let you all
>> know, this is the first time I am working on the tomcat 6 version.
>>
>
> To my knowledge, there is nothing "special" in terms of configuration
> required to allow Tomcat to serve static files, if they are in the right
> place.
> (Of course, this applies to a "standard" Tomcat downloaded from
> tomcat.apache.org; things may be different for pre-packaged Tomcat's from
> other sources).
>
> To get more help, you will need to provide some additional information.
> Since you are using firebug, you should be able to see which exact URL the
> browser requests for one of these static elements.
> Give us an example, and also tell us the path of this same element on disk.
> What may also help is the content of the ./WEB-INF/web.xml file of your
> application, and the ./META-INF/context.xml if there is one (all comments
> and passwords removed).
>
> And also tell us where you got your Tomcat from, and where you find Tomcat's
> "server.xml" file.
>
>

I'd say, first, configure an AccessLogValve and give the output of it.
Tomcat definitely cannot find the requested files and there has to be
a reason for it.


-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: AJP Errors. Apache + Tomcat

2011-10-19 Thread Francis GALIEGUE
On Wed, Oct 19, 2011 at 11:56, Mikolaj Rydzewski  wrote:
> On Wed, 19 Oct 2011 11:42:36 +0200, Francis GALIEGUE wrote:
>
>> Extract from the script (note that the server port is not randomized,
>> it should probably be):
>
> Hi all,
>
> Why do you want to go into such deep details, like checking for particular
> ports to be opened?
>
> I have httpd, mod_proxy_ajp and tomcat. mod_proxy will catch running tomcat
> after some time. It's a matter of proper configuration how long will it
> take.
>
> I guess that we all know tools like Nagios. I prefer to use them to detect
> problems instead of hacking startup scripts.
>

Well, this is not an option for me since my sites display a static
page as long as long as the webapp is not ready. As the apps I manage
take 10 seconds to start in the best of scenarios, I need to know that
tomcat is _really_ ready to serve requests.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: AJP Errors. Apache + Tomcat

2011-10-19 Thread Francis GALIEGUE
On Wed, Oct 19, 2011 at 11:47, André Warnier  wrote:
> Francis GALIEGUE wrote:
>>
>> On Wed, Oct 19, 2011 at 11:42, Francis GALIEGUE  wrote:
>> [...]
>>>
>>>               lsof -u $TOMCAT_USER -i tcp:8005 &>/dev/null
>>>
>>
>> Sorry, that's a non working version: forget the -u option. But with
>> only the -i, it works.
>>
>
> Thanks, very useful. I'll try that.
>

Actually, I've discovered that there's a -a option... You can do lsof
-u $TOMCAT_USER -a -i tcp:8005.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: AJP Errors. Apache + Tomcat

2011-10-19 Thread Francis GALIEGUE
On Wed, Oct 19, 2011 at 11:42, Francis GALIEGUE  wrote:
[...]
>
>                lsof -u $TOMCAT_USER -i tcp:8005 &>/dev/null
>

Sorry, that's a non working version: forget the -u option. But with
only the -i, it works.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: AJP Errors. Apache + Tomcat

2011-10-19 Thread Francis GALIEGUE
On Wed, Oct 19, 2011 at 11:27, André Warnier  wrote:
> Francis GALIEGUE wrote:
[...]
>
> Yes, that would be more reliable than my 2 seconds above.
> Although if one really wanted to split hairs in 4 parts (lenghtwise), one
> could argue that the fact that the port mentioned in  is open and
> listening, does not necessarily mean that the port in the AJP Connector is
> open and listening.
>

Actually yes, it does mean that, I have double checked: connectors
start to listen before the Server port starts to listen.

> Now just by curiosity, what mechanism do you use exactly to check that the
>  port is listening ?  (yes, the script lines..)
>

Extract from the script (note that the server port is not randomized,
it should probably be):


   MAXITERS=120
ITERS=0

while true; do
ITERS=$((ITERS+1))
if [ $ITERS -gt $MAXITERS ]; then
echo
echo >&2 "BUG: Tomcat not started after
$MAXITERS seconds!"
exit 1
fi

lsof -u $TOMCAT_USER -i tcp:8005 &>/dev/null

if [ "$?" = "0" ]; then
break
fi
echo -n .
sleep 1
done

echo " Done (in $ITERS seconds)"


-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: AJP Errors. Apache + Tomcat

2011-10-19 Thread Francis GALIEGUE
On Wed, Oct 19, 2011 at 10:48, André Warnier  wrote:
> Hi.
>
> The problem can also be due just to the difference in startup time between
> Apache httpd and Tomcat.  At the time Apache httpd (and its embedded
> mod_proxy_ajp module) try to contact Tomcat, Tomcat has possibly not yet
> "opened" its Connector on port 8009, which causes the host to refuse a
> connection to that port.
>
> In my experience anything involving Java tends to take a while to "start the
> machinery" (it is after all a "java virtual machine").
> In the practice thus, what we always do in such configurations, is to start
> Tomcat first (which really means mostly "start the java virtual machine
> which runs Tomcat")
> , wait a couple of seconds, and then start the Apache httpd part.
>

Actually, there is a reliable way of waiting for Tomcat to be fully
started: wait to see the port specified in  open for
listening. Then you are sure Tomcat is fully loaded. This is what I
use and it's very reliable.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: TOMCAT_BASE and TOMCAT_HOME

2011-10-18 Thread Francis GALIEGUE
On Tue, Oct 18, 2011 at 16:58,   wrote:

>
> Yes, but is there a technical, i.e. JVM, reason that two running instances of 
> tomcat can't concurrently use the same shared libraries?
>

No there isn't.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: TOMCAT_BASE and TOMCAT_HOME

2011-10-18 Thread Francis GALIEGUE
On Tue, Oct 18, 2011 at 16:44,   wrote:
> I'm reading Tomcat: The Definitive Guide to learn how to separate your 
> instance specific files from your core installation, i.e. CATALINE_HOME; this 
> separation is for providing a clean upgrade path as well as running multiple 
> instances of tomcat off of the same installation.
>
> A lot of the stuff they recommend pulling out into instance specific 
> directories make sense, such as conf and webapps -- those folders contain the 
> obvious application specific data. However, the also recommend pulling out 
> all of the folders that contain the jars that hold runtime classes. To quote 
> directly from their book:
>
> "Also, some jar files and class files may need to be loaded from the shared, 
> server, and common directory trees. This means that for multiple instances to 
> work, each Tomcat instance has to have its own set of these directories; they 
> cannot be shared by two differently configured Tomcat JVM instances."
>
> Why would separate instances require their own jar files? Is it not possible 
> to point two concurrently executing jvm's at the same set of jar files?
>

It is entirely possible, of course. But you'll have some maintenance
work to do if ever you wish to change the jars for _one_ Tomcat
installation among many.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: URL "simplification"

2011-10-10 Thread Francis GALIEGUE
On Mon, Oct 10, 2011 at 16:04, Léa Massiot  wrote:
[...]
>
> I'm interested in Francis' proposal... please can you give me more details?
> Thanks!

I will but in private, this is getting offtopic ;)

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: URL "simplification"

2011-10-10 Thread Francis GALIEGUE
On Mon, Oct 10, 2011 at 14:01, Mark Thomas  wrote:
[...]
>>
>> C (and C++ and many others) has seteuid() and fork(), Java doesn't.
>> Apache starts as root, binds to port 80 (therefore opens an fd on it),
>> then forks. The fd is inherited by the child, which calls seteuid().
>> Then the parent exits. Done.
>
> Tomcat can.
>
> Exactly the same process is used by the jsvc wrapper from Commons Daemon.
>

And jsvc is native...

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: URL "simplification"

2011-10-10 Thread Francis GALIEGUE
On Mon, Oct 10, 2011 at 13:50, Darryl Lewis  wrote:
> Something I've always wondered about, but never figured out, is how does
> apache run as 'apache user' or 'nobody' and work on a port below 1024, but
> Tomcat can't?
> Anyone got a simple explanation?
>

C (and C++ and many others) has seteuid() and fork(), Java doesn't.
Apache starts as root, binds to port 80 (therefore opens an fd on it),
then forks. The fd is inherited by the child, which calls seteuid().
Then the parent exits. Done.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: URL "simplification"

2011-10-10 Thread Francis GALIEGUE
[...]
>
> What I use:
> -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
>

You're forgetting "-t nat" before -A. REDIRECT is a target only valid
from the nat table.


-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: URL "simplification"

2011-10-10 Thread Francis GALIEGUE
On Mon, Oct 10, 2011 at 10:56, Léa Massiot  wrote:
>
> Hello,
>
> Thank you for reading my post. Here is my question:
>
> - Presently, to access my WebApp first page, I have to type in the following
> URL in a browser:
> http://hostname-or-ip:8080/my-webapp/
> - Instead, I wish I could type in a URL such as:
> http://my-webapp/
> Is it possible?
> How?
>

For this, you'd need to deploy your webapp as root, and then make the
HTTP connector listen on port 80... Which means running Tomcat as
root, which is a pretty bad idea.

Another solution would be to install Apache and configure a vhost with proxying.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Denying IPs using the Valve command in context.xml

2011-10-05 Thread Francis GALIEGUE
On Wed, Oct 5, 2011 at 15:57, Mark H. Wood  wrote:
> Part of the problem with this valve is that regex matching is such a
> (IMHO) bizarre choice for IP address matching.  IP addresses have a
> structure which is very unlike text, and the customary and expected
> matches take a bit of finagling to do in regexes.
>
> I should try writing netmask and CIDR address matchers.
>

I'm doing just that at the moment :p

https://issues.apache.org/bugzilla/show_bug.cgi?id=51953

> Likewise the hostname valve.  Domain names also are structured, and
> people who have just discovered the valve may be expecting quite a
> different type of matching than what they get.  I had to read the
> documentation very slowly and carefully before I could get the
> customary match styles out of my head.
>
> Again, I should try writing a DNS-style globber.  It might be fun.
> (But don't hold your breath waiting for it.)
>

Ideally, all of Apache's "allow from" and "deny from" (along with
Order while we are at it) could/should be implemented. I'm starting
with the most simple case of all.

It'll be fun to implement, say, 10., .mydomain.com and such...

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Denying IPs using the Valve command in context.xml

2011-10-04 Thread Francis GALIEGUE
On Tue, Oct 4, 2011 at 23:48, André Warnier  wrote:
>>
>>> And, it seems that the Pattern class, and its own .matches()
>>> method, does work in the way that a non-exclusively-java programmer
>>> would expect, anchors and all.
>>
>> Does it?
>>
>
> Yes, because if one defines e.g. a Pattern "^abcdef" and uses it via
> yesno = Pattern.matches("^abcdef",input);
> it will actually match the pattern at the beginning of the string only,
> which is what one would expect.  Thus
>
> Pattern.matches("^abc","abcdef");
>
> would return true, while this :
>
> Pattern.compile("^abc").matcher("abcdef").matches()
>
> would return false (according to what I read in the documentation of
> Matcher.matches()).
> Not so ?
>
>>

Well, no, and here you see the incoherency of Java vocabulary vs the
rest of the regex world ;)

The Javadoc should really read "attempts to match the _whole_
input".

Bah. Too late to fix things...

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Denying IPs using the Valve command in context.xml

2011-10-04 Thread Francis GALIEGUE
On Tue, Oct 4, 2011 at 22:50, André Warnier  wrote:
[...]
>
> So my question is : which of Matcher or Pattern is really used in the
> Valve's code ?
>

You use a Matcher to match. A Pattern is only the compiled form of a regex:

final String re = "^";
final Pattern p = Pattern.compile(re);
final Matcher m = p.matcher("myinput");

if (m.matches())
// etc

So, the fact that Matcher instances are not thread safe is not really
the problem.

[...]
>
> - or the documentation should be amended to indicate that the expression
> provided for allow and deny is already automatically anchored at the
> beginning and end of the string.

Agreed. The Tomcat documentation also suffered the same problem (wrt
regex usage in its  IIRC) and I've had the doc fixed :p

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Denying IPs using the Valve command in context.xml

2011-10-04 Thread Francis GALIEGUE
On Tue, Oct 4, 2011 at 21:40, André Warnier  wrote:
[...]
>>
> I am not sure that I follow the depths of the Java implementation of all of
> this, but please note that "\.googlebot\.com$" is a regexp /anchored/ at the
> end of the string.
> In other words, I would be surprised (and disappointed) if this did not
> match the hostnames "bot1.googlebot.com" and "bot123.bots.googlebot.com"

It's quite simple really: .matches(), which is used, anchors the regex
at the beginning and end. .matches("re") is equivalent to
.lookingAt("^re$"), even if your re is already anchored.

Unfortunately, this method's misleading name and the prevalence of
Java has led a lot of people to believe that regex matching was done
on the whole input, which is of course false.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Denying IPs using the Valve command in context.xml

2011-10-04 Thread Francis GALIEGUE
On Tue, Oct 4, 2011 at 21:08, Christopher Schultz
 wrote:
[...]
>
> - From the docs:
>
> "If this attribute [allow] is specified, the remote address MUST match
> for this request to be accepted".
>
> "If this attribute [deny] is specified, the remote address MUST NOT
> match for this request to be accepted".
>
> I don't think Matacher.lookingAt is appropriate for this kind of checking.
>

Well, it depends on the definition of "match", I guess. For me, a
regex matches an input if it matches anywhere in the input! Which is
pretty much the definition of regex matching, and which is why Java's
.matches() methods are misnomers...

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Request for comments: Apache-like allow/deny remote host filtering

2011-10-04 Thread Francis GALIEGUE
On Tue, Oct 4, 2011 at 21:02, Christopher Schultz
 wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Francis,
>
> On 10/4/2011 2:50 PM, Francis GALIEGUE wrote:
>> Patch attached. I didn't know Bugzilla would treat patches this
>> way...
>
> Can you give us a link to the bug?
>

https://issues.apache.org/bugzilla/show_bug.cgi?id=51953

[...]
>
> The good thing is that you only have to do a very simple test harness.
> Something like this:
>
> FilterConfig config = .. // mock-up the filter config
> FilterChain chain = .. // mock-up the filter chain
> Filter filter = new RemoteAddrFilter();
> filter.init(config);
>
> HttpServletRequest request = ... // mock-up request
> HttpServletResponse response = ... // mock-up response
>
> foreach(ip in test_ips) {
>  // request.setRemoteAddr(ip);
>  filter.doFilter(request, response, chain);
>
>  assertEquals(expected_status_code, response.getStatusCode());
> }
>
> Of course, you'll have to do some significant work to make sure that
> the filter chain is mocked-up correctly and that your request object
> can be programmed appropriately.
>
> Perhaps that's what you were hoping to get some help doing? :)
>

Indeed. Not right now though, I want to read some more first ;)


Thanks,
-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Denying IPs using the Valve command in context.xml

2011-10-04 Thread Francis GALIEGUE
On Tue, Oct 4, 2011 at 20:46, Christopher Schultz
 wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Francis,
>
> On 10/4/2011 2:37 PM, Francis GALIEGUE wrote:
>> On Tue, Oct 4, 2011 at 19:49, André Warnier  wrote:
>> [...]
>>
>>> In this particular case, "\.googlebot\.com$" would be better
>>> (with the RemoteHostValve).
>>>
>>
>> No, that would not even work, for there is a fatal flaw in all
>> existing Valves and Filters using regexes: they use the .matches()
>> method of Matcher instead of .lookingAt(), which means you _must_
>> specify the whole hostname in the regex...
>
> Are you saying that ".*\.googlebot\.com" doesn't work?
>

No, this would work. However, "\.googlebot\.com$" will not.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Request for comments: Apache-like allow/deny remote host filtering

2011-10-04 Thread Francis GALIEGUE
On Tue, Oct 4, 2011 at 20:43, Christopher Schultz
 wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Francis,
>
> On 10/2/2011 3:57 PM, Francis GALIEGUE wrote:
>> On Sun, Oct 2, 2011 at 19:46, Konstantin Kolinko
>>  wrote:
>>> 2011/10/2 Francis GALIEGUE :
>>
>>>
>>> 1. If you want to submit it as a patch for Tomcat, you should
>>> attach it to a Bugzilla issue.
>>
>> OK, will do.
>
> +1
>
> Is there a way to see the code as a diff instead of complete files?
> This looks like a diff where the whole file is new.
>

Indeed. Patch attached. I didn't know Bugzilla would treat patches this way...

[...]
>
> It appears that no changes would be needed to either the Filter or the
> Valve -- only to the shared implementation that interprets the meaning
> of those settings.
>

I implemented those two interfaces again, since the existing abstract
class wouldn't fit the bill (it only tried regexes). Or maybe I don't
understand what you actually mean?

[...]
>>>
>>> You can run a single test by setting "test.entry" property in
>>> build.properties equal to the test name. Otherwise the full
>>> testsuite will be run.
>>>
>>
>> That's in the plan.
>
> I don't see jmock in the set of libs available for TC7, so you may
> have to play some games with HttpServletRequestWrapper in order to
> test this thing properly.
>
> Let us know if you need any help.
>

Well, I need help precisely on the above... I have a hard time
figuring out how TestRemoteIP{Filter,Valve} work at all... But I've
been only having a superficial glance at them so far.

Have fun!
-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Denying IPs using the Valve command in context.xml

2011-10-04 Thread Francis GALIEGUE
On Tue, Oct 4, 2011 at 19:49, André Warnier  wrote:
[...]

> In this particular case, "\.googlebot\.com$" would be better (with the
> RemoteHostValve).
>

No, that would not even work, for there is a fatal flaw in all
existing Valves and Filters using regexes: they use the .matches()
method of Matcher instead of .lookingAt(), which means you _must_
specify the whole hostname in the regex...

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Request for comments: Apache-like allow/deny remote host filtering

2011-10-02 Thread Francis GALIEGUE
On Sun, Oct 2, 2011 at 19:46, Konstantin Kolinko  wrote:
> 2011/10/2 Francis GALIEGUE :

>
> 1. If you want to submit it as a patch for Tomcat, you should attach
> it to a Bugzilla issue.

OK, will do.

> 2. Coding conventions:
> http://tomcat.apache.org/getinvolved.html
> 3. ASF software is collective work. @author tags are discouraged.
>

I was just copying existing code ;)

> 4. In Tomcat 7 there are  RemoteAddrValve and RemoteAddrFilter.  Both
> implement the same filtering, but one is implemented as a valve,
> another as a filter.

I hadn't seen that. Thanks for the correction!

> 5. Tomcat 7 has tests written for JUnit. I'd be nice if your valve had
> such tests.
> To start testsuite you execute the "test" target in Tomcat's build.xml.
>
> You can run a single test by setting "test.entry" property in
> build.properties equal to the test name. Otherwise the full testsuite
> will be run.
>

That's in the plan.

Thanks for the input,
-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Request for comments: Apache-like allow/deny remote host filtering

2011-10-02 Thread Francis GALIEGUE
Hello list,

Given the problems I've had with the RemoteAddrValve, I have decided
to try my hands at implementing a more sophisticated valve which acts
more like Apache's allow/deny and which takes netmasks as arguments.

Note, it has been compile tested only (in my IDE, mind), and I have
tested that it essentially works using a main() (not in the patch).
Right now I'm struggling to build the thing and figure out the
build.xml...

The patch can be seen here:

https://github.com/fge/tomcat70/commit/79e0ab03188e00163ef7f97ca84bd8a8d0815f33

Any comments are welcome!

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: [OT] Tomcat on its own SVN repository?

2011-09-29 Thread Francis GALIEGUE
On Thu, Sep 29, 2011 at 10:35, Konstantin Kolinko
 wrote:
[...]
>
> No. Why? If it ain't broken do not fix it.
>

Depends on the point of view, I guess :) SVN is broken to my eyes...

> The project has 10+ years of history, and all its versions are
> related. Also we sometimes copy code from other ASF projects.
>
> BTW, there are read-only git mirrors at ASF elsewhere.
>
> http://www.apache.org/dev/contributors.html
> http://git.apache.org/
>

Yep, I see that! I'll use this as a base then.

Thanks,
-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



[OT] Tomcat on its own SVN repository?

2011-09-29 Thread Francis GALIEGUE
Hello list,

I was trying to get the source code in order to implement my own idea
of a remote address valve (as mentioned in a previous thread).

But I use git-svn, and discovered that Tomcat is on a repository with
1M+ changes on it! git svn clone is therefore woefully impractical. Is
there any plan to move each project at least to its own SVN repo, if
not git?

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Display a static page while application loading.

2011-09-19 Thread Francis GALIEGUE
On Mon, Sep 19, 2011 at 09:45, Eric Bouer  wrote:
>
> Hello list.
> I'm using tomcat for a J2EE application that uses Spring/Hibernate/JSF.
> The spring container and hibernate bootstrap are slow and the users get a
> blank page or no response from tomcat while the application starts.
> In order to avoid that I was thinking about some static page that can be
> served by a different thread but the problem is that there are muiltiple
> wars and I wish to have a simple solution.
>
> I'd like to know if Tomcat already provides a solution for this problem or
> if it is a planned feature request (couldn't find any)
> Or is there another way to solve this issue?
> Thanks.
>

With Tomcat alone, no idea. I do that with Apache in front of Tomcat,
but this requires that Tomcat be set up in a particular way.

Here is what happens here when a webapp is started:

* Apache is configured to display a static page for the corresponding
server name and path;
* I use Tomcat's manager webapp to deploy the new context;
* on success, Apache is reconfigured to forward requests and its
configuration reloaded.

For this, Tomcat is started with only the manager webapp, and only in
text mode from localhost. Contexts are then deployed and undeployed on
demand. One problem with Tomcat is that the bundled startup scripts
will return _before_ Tomcat is fully bootstrapped, which is why I have
to use my own. This has been discussed at length a few months ago, and
is why I have my current setup. It is the only way for me to have the
behavior I seek.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: tomcat 7.0.21: bug in RemoteAddrValve?

2011-09-15 Thread Francis GALIEGUE
On Thu, Sep 15, 2011 at 14:54, André Warnier  wrote:
[...]
>
> One difficulty with implementing an Apache httpd-like scheme is that, in
> httpd, the order of the allow/deny plays a big role, and preserving the
> order is generally more difficult in XML.
>

Which is why there is "Order" ;)

> But maybe just this : the "localhost" case is so frequent, that maybe it
> could just be a separate attribute in the Valve, like :
> localhostAllow="true/false" or even localhost="allow/deny"
> and internally match any form of localhost.
> That may allow for some optimisation.  I'm sure the impact would be tiny,
> but since this is code that gets invoked at just every request and generally
> quite early, it may be significant.
>

I was rather thinking about a completely new valve, allowing to
specify CIDR ranges, subdomains, etc etc. It is certainly doable.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: tomcat 7.0.21: bug in RemoteAddrValve?

2011-09-15 Thread Francis GALIEGUE
On Thu, Sep 15, 2011 at 14:25, André Warnier  wrote:
[...]
>>
>> OK, I've found the bug...
>>
>> I have added an access log valve and here is what I see in it:
>>
>> [15/Sep/2011:11:59:14 +0200] 0:0:0:0:0:0:0:1 (132 msec/964 bytes) 403
>> GET //manager/text/list HTTP/1.0
>>
>> That explains it. So, I do have IPv6, but the valve doesn't recognize
>> ::1 as being equivalent to the fully expanded IPv6 address... If it
>> only tries and matches the regex, the behaviour is therefore normal.
>
> Aha. So I do get a Debugger Bonus Point after all.
>

Yes, indeed. Even though I have NETWORKING_IPV6=no in
/etc/sysconfig/network. Bah.

>>
>> I have added 0:0:0:0:0:0:0:1 as an alternative instead of ::1 and it
>> does work...
>>
>> So, PEBKAC mostly, but I think Tomcat should be able to treat reduced
>> IPv6 address formats.
>>
>
> That would mean that both the address configured in the Valve, and the
> client address, would need to be "canonicalised" and then compared.
> You'll probably see the traditional "patches are welcome" soon.
>
> On the other hand, using a regexp provides for quite a bit of flexibility
> regarding ranges of addresses. You could use something like :
> "(127\\.0\\.0\\.1)|((0?:0?:0?:0?:0?:0?)?:0?:1)"
>

Well, checking address ranges would be _much_ easier if regexes were
not anchored...

But anyway, the "allow" and "deny" as they exist currently just don't
cut the mustard, and are far from being as potent as, say Apache's
Allow from and Deny from. This should be the goal.
RemoteAddrValveEvolved?

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: tomcat 7.0.21: bug in RemoteAddrValve?

2011-09-15 Thread Francis GALIEGUE
On Thu, Sep 15, 2011 at 10:26, Francis GALIEGUE  wrote:
[...]
>
> I have added 0:0:0:0:0:0:0:1 as an alternative instead of ::1 and it
> does work...
>

Which makes me think: the documentation SHOULD specify that regexes in
the "allow" and "deny" parameters of the valve are ANCHORED.

That's a pity, since it means you cannot really use the full power of regexes...

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: tomcat 7.0.21: bug in RemoteAddrValve?

2011-09-15 Thread Francis GALIEGUE
On Thu, Sep 15, 2011 at 10:06, Francis GALIEGUE  wrote:
> On Wed, Sep 14, 2011 at 20:49, Mark Eggers  wrote:
> [...]
>>
>> I've not tried this in Tomcat, but here's a thought.
>>
>> According to:
>>
>> http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Remote_Address_Filter
>>
>>
>> Tomcat uses java.util.regex for pattern matching. This means that if you 
>> want a string regular expression to include a ".", you'll end up entering it 
>> as \\.
>>
>> Try using "127\\.0\\.0\\.1|::1" and see if that fixes your problem.
>>
>> I have no idea why it would work in previous versions (have not checked the 
>> change log).
>>
>> . . . . just my two cents.
>
> Yep, fair enough. But in this case "\." would have expanded to a dot
> and it would have matched anyway.
>
> @André: I do connect from localhost using wget, mainly:
>
> wget -O - -nv --http-user= --http-password=
> http://localhost:8080//manager/text/list
>
> But even so, using "127\\.0\\.0\\.1", I get 403... There definitely is
> something broken :(
>

OK, I've found the bug...

I have added an access log valve and here is what I see in it:

[15/Sep/2011:11:59:14 +0200] 0:0:0:0:0:0:0:1 (132 msec/964 bytes) 403
GET //manager/text/list HTTP/1.0

That explains it. So, I do have IPv6, but the valve doesn't recognize
::1 as being equivalent to the fully expanded IPv6 address... If it
only tries and matches the regex, the behaviour is therefore normal.

I have added 0:0:0:0:0:0:0:1 as an alternative instead of ::1 and it
does work...

So, PEBKAC mostly, but I think Tomcat should be able to treat reduced
IPv6 address formats.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: tomcat 7.0.21: bug in RemoteAddrValve?

2011-09-15 Thread Francis GALIEGUE
On Wed, Sep 14, 2011 at 20:49, Mark Eggers  wrote:
[...]
>
> I've not tried this in Tomcat, but here's a thought.
>
> According to:
>
> http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Remote_Address_Filter
>
>
> Tomcat uses java.util.regex for pattern matching. This means that if you want 
> a string regular expression to include a ".", you'll end up entering it as \\.
>
> Try using "127\\.0\\.0\\.1|::1" and see if that fixes your problem.
>
> I have no idea why it would work in previous versions (have not checked the 
> change log).
>
> . . . . just my two cents.

Yep, fair enough. But in this case "\." would have expanded to a dot
and it would have matched anyway.

@André: I do connect from localhost using wget, mainly:

wget -O - -nv --http-user= --http-password=
http://localhost:8080//manager/text/list

But even so, using "127\\.0\\.0\\.1", I get 403... There definitely is
something broken :(

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: tomcat 7.0.21: bug in RemoteAddrValve?

2011-09-14 Thread Francis GALIEGUE
On Wed, Sep 14, 2011 at 17:28, André Warnier  wrote:
> Francis GALIEGUE wrote:
[...]
>>    >        allow="127\.0\.0\.1|::1"/>
[...]
>>
> Maybe try to modify that regexp somewhat, like to
> allow="(127\.0\.0\.1)|(::1)"
> or
> allow="127\.0\.0\.1|\:\:1"
> just in case the regexp library version changed, and it now interprets the
> original expression slightly differently ?

Nope... I also tried 127\.0\.0\.1 alone and no dice.

I'll try your two other suggestions but if any works, it means the
regex engine used is seriously buggy!

> Could it also be that previously, Tomcat saw an IPv4 address and it worked,
> but now it sees an IPv6 address and the "::1" part in fact never worked, but
> was never used before ?
>

The machine has IPv4 only. I just put in the ::1 in prevision of a not
so distant future...

But maybe it is some other part of the configuration (server.xml?
default context.xml?) which needs to be changed?

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



tomcat 7.0.21: bug in RemoteAddrValve?

2011-09-14 Thread Francis GALIEGUE
Hello,

I have a base Tomcat install with only the manager webapp in it at
startup (I deploy other webapps using it in text mode) but since I
upgraded from 7.0.16 to 7.0.21, the manager no longer works with the
RemoteAddrValve.

The context.xml is:







This worked fine with 7.0.16 and doesn't work anymore with 7.0.21, I
get 403 each time... Anyone seeing the same problem?

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Performance for many small requests

2011-08-31 Thread Francis GALIEGUE
On Wed, Aug 31, 2011 at 16:11, David kerber  wrote:
> Has there been any comparison testing done in how the latest 7.x version of
> TC will compare to the latest 6.0.x version, in the case of tons (hundreds
> per second) of very small, quick-to-process requests?
>
> I have a machine that's starting to croak and am moving to a new machine,
> and need to decide whether to use the latest 6.x, or the latest 7.x version
> on Windows 2008.  The app will of course be identical in either situation,
> and all it does is take data sent in the upload request, un-obfuscate it,
> and write it to disk after doing a checksum test.  So it's minimal
> processing, but there are a LOT of them.
>
> Thanks for any insight!

Well, first things first, ensure keepalive works properly for the
connector(s) you use, but I guess you have it covered already, right?

Apart from that...

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Too many open files error

2011-08-24 Thread Francis GALIEGUE
On Wed, Aug 24, 2011 at 17:33, Campbell, Lance  wrote:
> The file /etc/security/limits.d is empty.  What would be an example of 
> something you would expect to see in there that would relate to changing the 
> RMILIT_NFILE value?
>

It's a directory, not a file. Create a file named tomcat in it (or
whatever name you want) and put in these two lines:

tomcat softnofile  16384
tomcat hardnofile  16384

(if the user running Tomcat is indeed called tomcat)

If you want to see the current limit, as root, run:

su tomcat -c "ulimit -n"

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Too many open files error

2011-08-24 Thread Francis GALIEGUE
On Wed, Aug 24, 2011 at 17:21, Campbell, Lance  wrote:
> Tomcat 6.0.32
> Java 1.6.27
> Apache 2.0
> RedHat 6.x 64 bit
> /proc/sys/fs/file-max = 3233344
>
> We experienced an issue where we were getting the error "too many open files" 
> in tomcat.  The server manager increase the amount of open files to the 
> above.  But the error kept coming back even after rebooting the server.  Is 
> there a max number of connections that tomcat should run within based on the 
> above specs?
>
> The servlet in question that was being hit returned an XML document after 
> doing a series of database queries.
>

file-max is not what you want to modify. It's the user's limit: RMILIT_NFILE.

Look in /etc/security/limits.d. You'll need to restart Tomcat.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Feature request: "fullstart" command

2011-06-16 Thread Francis GALIEGUE
On Thu, Jun 16, 2011 at 20:37, Christopher Schultz
 wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Francis,
>
[...]
>
> The above requirements actually might not be possible in a reasonably
> simple system.
>
> First off, the JVM provides no pure-Java way of letting a process go
> into the background. So, there's really no opportunity to do some work
> in Java and /then/ return to the calling process without terminating.
>
> Second, an OS return code requires a process termination, and you
> certainly don't want to terminate the JVM you've just started.
>

I was actually wondering about these. I think I have my answer now :/
Solutions in C or other languages are many to achieve that, Java has
none.

> About the best we could do is change catalina.sh from roughly this:
>
> java org.apache.tomcat.Bootstrap >> logs/catalina.out &
>
> to this:
>
> java org.apache.tomcat.Bootstrap >> logs/catalina.out &
>
> tail -f logs/catalina.out | grep -m 1 "INFO: Server startup"
>
> exit 0
>
> There are some problems with this approach:
>
> 1. It's not foolproof... if your server is insanely fast, it might
>   start before tail | grep runs, and you might wait forever
>
> 2. The log messages are localized, so you'll have to use the proper
>   localized message instead of just "INFO: Server startup"
>
> 3. This is so simple that you should be able to do it yourself
>
> Does this really need to be a part of the stock Tomcat? I'm not
> convinced that this exact solution would meet everyone's needs so it
> would need to be further customized, anyway.
>

Yeah well, I can understand that since this is what I use right now. I
make it darn sure that my locale is set up OK, but then any different
logging configuration will defeat that. Which is why I am right now
switching over completely to the scenario where Tomcat only starts
with the manager webapp builtin and further webapps are deployed after
the initial startup. This still requires to parse the output of the
manager webapp, but at least it's better than the default :/

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Feature request: "fullstart" command

2011-06-16 Thread Francis GALIEGUE
On Thu, Jun 16, 2011 at 15:01, Konstantin Kolinko
 wrote:
[...]
>
> Implement what you want in a listener. Throw an Error if whatever you
> want fails.
>

OK, but then, why isn't there such a listener as standard? I'm sure
you understand the need, and having this listener as standard in
Tomcat can bring great value. If it means modifying the server.xml,
I'm fine with it. I'm a systems engineer, and while I know some Java,
I'd rather let the Tomcat team do that - they will do a better job
than I in any case.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Feature request: "fullstart" command

2011-06-16 Thread Francis GALIEGUE
On Thu, Jun 16, 2011 at 14:48, Konstantin Kolinko
 wrote:
[...]
>
> Some resources are allocated only on the first access.
>
> E.g. starting servlets, or obtaining database connections from a pool.
> Unless you obtain a connection there is no knowing that the database
> is accessible.
>

I know that. Some initialization phases, though, _do_ (or, if not,
should) raise errors on deployment, and right now I have no way to
catch such errors at startup time. And I'm not talking about
connectors here. I did learn one thing though, about that
EXIT_ON_FAILURE option: it should have been the default as far as I'm
concerned, but ohwell...


Again, connectors are one part of the problem here (I use
EXIT_ON_FAILURE now on my deployments). But application deployment is
another. Unless there is some hidden meaning to a Connector which I
haven't understood.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Feature request: "fullstart" command

2011-06-16 Thread Francis GALIEGUE
On Thu, Jun 16, 2011 at 14:36, Pid  wrote:
[...]
>>>
>>> An application might report that it's started, even it hasn't finished
>>> initialising.
>>>
>>
>> That is the application's responsibility, so not the problem at hand.
>
> What is the value of indicating success or failure, if the answer is
> only partially true?  You can't know for certain whether the answer you
> have is meaningful, so it's useless.
>

I have a manichean point of view on this: an application is ready to
operate when its initialization phase is complete, or it's not.
Success, or failure. I'm not even taking OSGi and this sort of things
into account here. If the application uses OSGi, fine. What I expect
of it is to tell it's ready to answer any requests that may be thrown
at it.

>
>> Furthermore, if the application reports a successful start even though
>> it is not completely initialized, i consider this an application
>> fault, therefore not my concern.
>
> That makes no sense to me.
>

See above.

>
>> As the person being responsible for
>> the good behavior of applications in production, I expect webapps that
>> I deploy to behave correctly, ie fail to deploy in the event of an
>> initialization failure.
>
> That seems contradictory, but it's probably my misunderstanding.
>

How so? Again, see above.

>
> Tomcat won't provide me with this information,
>> EXCEPT if I use the manager webapp (in text mode, of course) to deploy
>> it, as I can parse the return "message".
>
> Yes it will, using the same mechanism that the manager webapp uses; you
> can interact with Tomcat over JMX, the API gives you detailed
> information about applications.
>

I just _don't_ _care_. I don't want to have to use JMX to monitor
webapp state in this case (although I _do_ use it for monitoring
purposes, which is a HUGE difference). I wish Tomcat to be able to
report, with startup-configured web applications, whether these
webapps were successfully deployed -- at _startup_ time -- and exit
with a meaningful error code if one or more of these webapps were NOT
deployed correctly. And yes, I rely on these webapp's startup
procedures to report failures as well.

To put an analogy with device drivers, what you basically say is "I
initialize the driver without a firmware and don't care whether the
initialization succeeds, I'll see that when the firmware loads". I
say, "a driver is considered initialized iif the basic initialization
is OK, _and_ the firmware is loaded and functional". This is a HUGE
difference. The fact that the device may fail at run time is akin to
running JMX for webapp monitoring, and this can happen as well. But I
want a _guarantee_ that the device, when the init routine returns, is
fully ready to operate.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Feature request: "fullstart" command

2011-06-16 Thread Francis GALIEGUE
On Thu, Jun 16, 2011 at 13:51, sebb  wrote:
[...]
>
> The value passed to System.exit(int) is passed to the OS.
>
> In Unix systems, 0 means success and anything else is generally not success.
>
> OpenVMS behaves differently, as already noted.
> If a process returns an error or fatal code to VMS, then by default
> the script running it will exit with an error.
>
> So changing the OS exit code can affect existing users.
>
> The point is that exit codes are not portable across OSes; the most
> one can hope for is sucess or failure indication.
>

It's not my fault if OpenVMS is broken in that regard, but anyway, I
was not talking about implementing this for existing Tomcat versions,
but for future ones (although if 7.0.x had this I'd be very happy).
And I'm mostly sure that Java can do whatever is required because it
can detect what OS it runs on. I mean, C has EXIT_SUCCESS and
EXIT_FAILURE, it's only a matter of defining such constants in the
Tomcat code as well - unless the JVM already has such exit code
defintions handy, in which case all is left to do is implementing
them.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Feature request: "fullstart" command

2011-06-16 Thread Francis GALIEGUE
On Thu, Jun 16, 2011 at 13:30, sebb  wrote:
[...]
>>
>> It's up to main() to call System.exit(), so how is that a problem?
>
> If the exit code is not passed to the OS, but is merely a method
> return code, then of course it's not a problem.
>
> But I understood the term "exit code" to mean the code returned to the
> OS through System.exit().
>

You lost me. System.exit() acts at the JVM level anyway, therefore the
process level. Don't we talk about the same thing?

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Feature request: "fullstart" command

2011-06-16 Thread Francis GALIEGUE
On Thu, Jun 16, 2011 at 13:04, sebb  wrote:
[...]
>
> And it may cause problems on some OSes which don't use unix-style exit codes.
> For example, OpenVMS uses the low order 3 bits of a process exit code
> as a severity indicator, and odd is success, even is failure.
> [IThe JVM automatically converts exit 0 to exit 1 to compensate, but
> cannot deal with all exit codes].
>

It's up to main() to call System.exit(), so how is that a problem?

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Feature request: "fullstart" command

2011-06-16 Thread Francis GALIEGUE
On Thu, Jun 16, 2011 at 12:29, Pid  wrote:
[...]
>
> An application might report that it's started, even it hasn't finished
> initialising.
>

That is the application's responsibility, so not the problem at hand.

Furthermore, if the application reports a successful start even though
it is not completely initialized, i consider this an application
fault, therefore not my concern. As the person being responsible for
the good behavior of applications in production, I expect webapps that
I deploy to behave correctly, ie fail to deploy in the event of an
initialization failure. Tomcat won't provide me with this information,
EXCEPT if I use the manager webapp (in text mode, of course) to deploy
it, as I can parse the return "message".

[...]
>
> 'fullstart' is an odd name, people might start using it thinking that
> 'start' did not fully start the server.
>

Which is the case in this particular scenario! OK, maybe not
fullstart, but appstart, something else... As long as this command
doesn't complete before all webapps configured at startup have
attempted a deployment.

> Returning an exit code which describes the number of apps successfully
> started isn't much use unless you (or the init script) know the number
> of apps configured.
>

No, you misread what I say. What I want is the return code to be the
number of webapps NOT successfully deployed. But even that, I reckon,
is not that good an idea: the JVM will return 1 in the event of an
uncaught exception (or thrown from main()). So, 1+n, where n is the
number of webapps not successfully deployed. But in any case, obey the
basic principle that 0 means success, and anything else means a
failure.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Feature request: "fullstart" command

2011-06-15 Thread Francis GALIEGUE
On Wed, Jun 15, 2011 at 22:11, Caldarale, Charles R
 wrote:
[...]
>
> Check the system property org.apache.catalina.startup.EXIT_ON_INIT_FAILURE 
> and see if it meets your needs.  (It might not be setting an exit code.)
>
> http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html
>
>  - Chuck
>

It doesn't. The only use of it in StandardService is to throw an Error
(it will then exit(1) as it is an uncaught error) if connectors
initialization fails. But this is not what I'm after (checked in
7.0.14 source code).


-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Feature request: "fullstart" command

2011-06-15 Thread Francis GALIEGUE
Tomcat has many abilities to deploy applications at run time (war,
tree, context, you name it). However, when used in production, these
abilities are used cautiously, if they are used at all.

In many scenarios, Tomcat just starts, spends its life, and stops,
with a defined set of webapps, and has no automatic deployment
capabilities configured in at all. But the builtin startup scripts,
and in fact, the Java code itself, lack at least two critical inputs
for such scenarios:

* Bootstrap will return (and therefore the startup scripts too) before
webapps configured at startup time are deployed, and while
bootstrapping is fast, deploying applications at startup can be very
long;
* even with a hackish way (watch the log file to account for complete
server startup) in order to wait for webapps to be deployed, there is
no status about these deployments at all (has this and that webapp
been deployed successfully?).

Proposal: implement a fullstart command to Bootstrap which:

* does NOT return until ALL webapps configured at start time are
(attempted to be) deployed;
* exits with a positive error code representing the number of webapps
NOT correctly deployed (or 1 - I don't care as long as it's not 0, but
please not -1, think WIFSIGNALED()).

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: redirect to another URL in tomcat

2011-06-08 Thread Francis GALIEGUE
On Wed, Jun 8, 2011 at 17:23, RenuKumar  wrote:
> Hi
>
> Hope someone could provide some information on how to redirect to another
> URL,can be configured.
>
> for example
>
>
> https://ipaddress/channelmgr/MaxisUssd --->  /http://ipaddress/soap/rpc
>
>
> Is there a way in the system we could redirect the URL?
>

What do you call the "system" exactly? Do you want a visible redirect
or a silent redirect?

You can do it at the Apache level, and with Java for sure - as I never
use Tomcat as a frontend directly, I don't know for Tomcat. But it is
certainly doable.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Switching native Tomcat logging system

2011-05-31 Thread Francis GALIEGUE
Hello,

For some obscure reasons, Tomcat insists on having its own "native"
implementation of a logging system, namely juli.

This is beyond my understanding. Log4j has existed for years, is much
better than even the native Sun's JDK logging API of today, and Tomcat
hasn't switched to it, even to the expense of requiring, or even
bundling (licenses are not incompatible after all) it with its
distributions. WHY?

And today, there is slf4j, which is even better. Especially combined
with logback. I don't even want to HEAR about the JDK's logging API,
it is miserable.

When will Tomcat's logging account at last for 21st century logging
systems? I am surprised log4j didn't even become the default for
6.0.x, and 7.0.x still doesn't make it the default...

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: access to Manager

2011-05-27 Thread Francis GALIEGUE
On Sat, May 28, 2011 at 00:27, abdelghni belfkih  wrote:
> hi guys,
>
> I can't access to the manager/html cuz i don't know how create a user login.
>
> Plz help me.
>

[c'est dans la doc de base]

This is in the base documentation of Tomcat. And anyway, I strongly
recommend AGAINST the HTML version of it. Why? It requires a Web
browser for input.

Try the text version instead. Everything is documented.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Slow SSL connections after Tomcat 5 to 7 migration

2011-05-04 Thread Francis GALIEGUE
On Wed, May 4, 2011 at 15:49, Caldarale, Charles R
 wrote:
>> From: Michał Kapituła [mailto:michal.kapit...@comarch.pl]
>> Subject: Slow SSL connections after Tomcat 5 to 7 migration
>
>> I've just tested the page generation time via local network (and
>> browser's cache off) and the page is being fully loaded in circa 2
>> seconds (with Firebug on) when using http, while loading the same
>> page using secure connection took as much as 10 times longer.
>
> If the CPU usage is not high during page generation over SSL, and the network 
> isn't inducing delays, then the threads must be waiting for something.  Can 
> you take some thread dumps during the delay period and find out what they're 
> stuck on?  (My suspicion is reads from /dev/random, but I thought that was 
> only during Tomcat initialization.)
>
> Also, is Tomcat front-ended by anything (e.g., httpd), or are you accessing 
> it directly?
>
> Did anything else change when you upgraded Tomcat?  For example, the JVM 
> version?
>

Can it be the same problem that I encountered with the long deployment
time of the manager webapp, which is cured by changing the entropy
source file?

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Tomcat 6.0.x TEMP Directory

2011-04-15 Thread Francis GALIEGUE
On Fri, Apr 15, 2011 at 09:52, Alexander Diedler  wrote:
> Hello everybody,
>
> Just a general question. Could it be a bottleneck, if we have millions of
> .tmp Files in the Tomcat tmp Folder? If we startup the Tomcat, during a
> period > 15m the are no response from the Tomcat, if we try to open
> websites, hosted by the tomcat.
>

Attack the root of the problem: fix applications which forget to
delete their temporary files after they have used them.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: [OT cluster]Request to comment

2011-04-13 Thread Francis GALIEGUE
On Wed, Apr 13, 2011 at 19:01, János Löbb  wrote:
[...]
>
> The first 3 paragraphs are done.  I have two machines  with OSX 10.6.5, httpd 
> 2.2.17, mod_jk 1.2.31, tomcat 7.0.10. [...]
>

Just one thing: since you use Apache 2.2.x, why don't you use mod_proxy_ajp?

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: [OT] servlet-specific error pages

2011-04-13 Thread Francis GALIEGUE
On Wed, Apr 13, 2011 at 00:17, Christopher Schultz
 wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> János,
>
> On 4/12/2011 4:56 PM, János Löbb wrote:
>> Look the 10.9 Error Handling in the 3.0 specifications.  It is maya
>> to me but you might find what you are looking for.
>
> Being somewhat familiar with the servlet specification, I was hoping for
> something more helpful than "RTFM". :(
>

Hello,

You can always use .setResponse() and fill the page with whatever you
want. Tomcat will only use its pages or whatever is defined in
 if you use .sendError(), and you can
.setResponse(SC_ANYTHINGOTHERTHANOK).

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Simple Tomcat monitoring ?

2011-04-12 Thread Francis GALIEGUE
On Tue, Apr 12, 2011 at 14:26, André Warnier  wrote:
> Francis GALIEGUE wrote:
>>
>> On Tue, Apr 12, 2011 at 12:20, André Warnier  wrote:
>> [...]
>>>
>>> Considering all the above, which would be the easiest/quickest way of
>>> starting to figure out what this tomcat is doing, and where the
>>> system/application bottleneck might be ?
>>>
>>
>> We have the following tools, all very easy to setup and run:
>>
>> * SNMP monitoring of the JVM (allows to see the amount of memory
>> consumed, the number of threads, and others - the MIB is well
>> defined);
>> * a shell script sending the results of a kill -3 on the JVM (a thread
>> dump);
>> * a script which triggers when a java.lang.OutOfMemoryError is thrown.
>>
>> If you are interested in any of it, I can tell you how we do it.
>>
>> And, considering that your server has 12 GB RAM, you could indeed do
>> with a little more heap space!
>>
>
> Thanks. I think I'll accept your offer of details.
>
> I don't think that OOM is a problem, but the first 2 would be a good start.
>
> About SNMP monitoring : I already have a "munin agent" installed on that
> system, and a munin server collecting stuff like overall cpu and memory
> usage.
> To your knowledge, does there exist a way to collect this JVM SNMP
> information via a munin plugin ?
>

I don't use Munin, I use cacti, but if Munin can collect SNMP
information then it's only a matter of having Munin fetch the
appropriate OIDs. More details in a separate mail.

>
> About the script doing a kill -3 : where does the thread dump go, when you
> do that ? and how does the script know which PID is Tomcat ?
>

Mine does since the environment fetches the PID file and sends the
signal to that process. It sends output to either stdout or stderr, I
don't know. Script attached. Read the comments carefully, it is
somewhat a hack (could be improved by detecting, say, if the output
went to stderr).

> On that system, the tomcat processes look like this :
>
> # ps -ef | grep java
> root     20997     1  0 12:18 ?        00:00:00 /usr/bin/jsvc -user tomcat55
> -cp
> /usr/share/java/commons-daemon.jar:/usr/share/tomcat5.5/bin/bootstrap.jar
> -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat5.5.pid
> -Djava.awt.headless=true -Xms128M -Xmx128M
> -Djava.endorsed.dirs=/usr/share/tomcat5.5/common/endorsed
> -Dcatalina.base=/var/lib/tomcat5.5 -Dcatalina.home=/usr/share/tomcat5.5
> -Djava.io.tmpdir=/var/lib/tomcat5.5/temp
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.util.logging.config.file=/var/lib/tomcat5.5/conf/logging.properties
> org.apache.catalina.startup.Bootstrap
> root     20998 20997  0 12:18 ?        00:00:00 /usr/bin/jsvc -user tomcat55
> -cp
> /usr/share/java/commons-daemon.jar:/usr/share/tomcat5.5/bin/bootstrap.jar
> -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat5.5.pid
> -Djava.awt.headless=true -Xms128M -Xmx128M
> -Djava.endorsed.dirs=/usr/share/tomcat5.5/common/endorsed
> -Dcatalina.base=/var/lib/tomcat5.5 -Dcatalina.home=/usr/share/tomcat5.5
> -Djava.io.tmpdir=/var/lib/tomcat5.5/temp
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.util.logging.config.file=/var/lib/tomcat5.5/conf/logging.properties
> org.apache.catalina.startup.Bootstrap
> tomcat55 20999 20997  0 12:18 ?        00:00:04 /usr/bin/jsvc -user tomcat55
> -cp
> /usr/share/java/commons-daemon.jar:/usr/share/tomcat5.5/bin/bootstrap.jar
> -outfile SYSLOG -errfile SYSLOG -pidfile /var/run/tomcat5.5.pid
> -Djava.awt.headless=true -Xms128M -Xmx128M
> -Djava.endorsed.dirs=/usr/share/tomcat5.5/common/endorsed
> -Dcatalina.base=/var/lib/tomcat5.5 -Dcatalina.home=/usr/share/tomcat5.5
> -Djava.io.tmpdir=/var/lib/tomcat5.5/temp
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
> -Djava.util.logging.config.file=/var/lib/tomcat5.5/conf/logging.properties
> org.apache.catalina.startup.Bootstrap
> vogon2:~#
>
> So there are 3 Tomcat-related processes, all running under jsvc.  I am not
> quite sure which one does what.
>

Wild guess: it's the one in the PID file that matters (-pidfile
/xxx). It should be a variable in the Tomcat base configuration
file.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris


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

Re: OT: Versioning in Javascript Files

2011-04-12 Thread Francis GALIEGUE
On Tue, Apr 12, 2011 at 13:31, Tim Funk  wrote:
[...]
>
> The second is trickier. Relying on random query string is not fun since it
> may cause some browsers/proxies to be less prone to caching which can really
> affect performance. Especially if the the query string is dynamic. An easier
> solution is to use place your scripts is a "special" directory - then use a
> rewrite (or similar) rule to access them. So that the path is dynamic (and
> somewhat bogus). For example:
> /scripts/2011-04-11-072730/dojo.js - and in this case - you can have a
> rewrite rule look for a pattern and remove it from the path and forward to
> the script and let the default servlet handle things.
>
> Then to populate "2011-04-11-072730" - you can do that one of 3 ways:
> - At build time - calculate the timestamp and replace it
> - At run time - use a configuration parameter in context.xml
> - A combo of both  - I like this one best since a build can trigger a new
> name, but sometimes you may run into situations where you don't need a build
> but you need it refreshed - so a server parameter tweak makes this easy too
> (and if savvy enough can be done via JMX to save a restart from occurring)
>

No need... Just have the server part calculate an appropriate ETag for
this case. It is no replacement for the first solution (which is, and
always will be, the best one), but it allows the client to query the
server with an If-None-Match header.

Apache does this by default with a combination of mtime and inode
number IIRC. I don't know, I never use ETags but only adapted
Cache-Control directives.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Simple Tomcat monitoring ?

2011-04-12 Thread Francis GALIEGUE
On Tue, Apr 12, 2011 at 12:20, André Warnier  wrote:
[...]
>
> Considering all the above, which would be the easiest/quickest way of
> starting to figure out what this tomcat is doing, and where the
> system/application bottleneck might be ?
>

We have the following tools, all very easy to setup and run:

* SNMP monitoring of the JVM (allows to see the amount of memory
consumed, the number of threads, and others - the MIB is well
defined);
* a shell script sending the results of a kill -3 on the JVM (a thread dump);
* a script which triggers when a java.lang.OutOfMemoryError is thrown.

If you are interested in any of it, I can tell you how we do it.

And, considering that your server has 12 GB RAM, you could indeed do
with a little more heap space!

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: OT: Versioning in Javascript Files

2011-04-12 Thread Francis GALIEGUE
On Mon, Apr 11, 2011 at 23:47, George Sexton  wrote:
> I'm looking for ideas on how other people are doing versioning in Javascript
> files. I'm hitting issues if I change my files in an incompatible way, or I
> upgrade files.
>
> For example, if I upgrade from DOJO 1.5 to DOJO 1.6, the user's browsers are
> not always refreshing the DOJO files, and things don't work.
>
> Similarly, if I update a javascript function to take additional arguments,
> then the browser using the old version throws an error.
>
> I've spent a lot of time in the past few days telling users to click on the
> refresh button of their browser and I'm pretty sick of it.
>
> I've thought of versioning my whole "scripts" directory. IOW, if my app
> version is 3.4.9, make the scripts directory scripts-3.4.9 to force the
> browser to get files from the new location. This is kind of a pain for
> version control reasons but otherwise it's OK.
>
> I'm really looking for ideas on how other web developers are handling this
> problem.
>

Simple solution: change paths if you change versions!

1.5 would be /static/dojo-1.5.js, 1.6 would be /static/dojo-1.6.js, etc.

I don't know your setup exactly, but it is highly probable that the
server sends back cache control headers saying that this file at this
URL expires some time in the future. If the URL doesn't change, the
browser won't even bother reloading. It is only if the path changes
that you can be sure that the new version will be reloaded.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet when embedding tomcat 7.0.11

2011-04-07 Thread Francis GALIEGUE
On Thu, Apr 7, 2011 at 10:44, "Christian Hödl"  wrote:
> Hi,
>  I'm trying to start Tomcat 7.0.11 from within an automated test.
>  Unfortunately, when I call tomcat.start(), the following
>  exception happens:
>
> Servlet /abc/ threw load() exception
> java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet
[...]
>
> classpath = 
> D:\dev\workspace\gradle_test\test\build\classes\test;D:\dev\workspace\gradle_test\test\build\classes\main;D:
[etc etc]
>
> Does anybody know, what could be the problem here?
>

There isn't either of jsp-api or servlet-api in your classpath.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Apache Tomcat Process is getting killed automatically.

2011-04-07 Thread Francis GALIEGUE
On Thu, Apr 7, 2011 at 01:42, Prashant Rajput  wrote:
> Hi,
>
> I am using Apache Tomcat 5.x and it is having two instances running on it,
> one is Flex application and the other one is Java application which is used
> by the Flex application to Export the results.
>
> My RAM is 4GB and Tomcat's xmx parameter is set to use from 512MB to 2GB.
>
> Now almost once in two days my Tomcat process is getting killed
> automatically and I have to restart the Tomcat server again and again to
> resume the application back.
>

Killed by what? What do the logs say?

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: tomcat integrity

2011-04-06 Thread Francis GALIEGUE
On Wed, Apr 6, 2011 at 14:29, Sebastian Biedermann
 wrote:
> Dear List,
>
> I´m searching for a integrity measurement module for apache tomcat which
> makes a hash (e.g. sha1) from each *.war file before starting/employing it.
>
> Can anyone give me a hint?
>

You can sign jars, so I guess you can sign wars and use the same tools
to check validity. But this means signing the war at build/package
time.

Otherwise you can just use whatever the system provides you with. I
don't know for Windows, but Linux has {md5,sha1,sha256}sum, etc etc.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Tomcat 7.0.11: bug with manager application when undeploying

2011-03-28 Thread Francis GALIEGUE
On Mon, Mar 28, 2011 at 00:55, Konstantin Kolinko
 wrote:
> 2011/3/25 Francis GALIEGUE :
>> Scenario:
>>
>> * tomcat starts, as user u1, with only the manager application in place;
>> * it is configured as to not deploy automatically;
>> * user u1 copies a webapp tree into $CATALINA_HOME/webapps, which it
>> can since it has write/execute access to this directory;
>> * the manager webapp is called to deploy that new web application;
>> * [in between, credentials on the deployed webapp directory are
>> changed so that user u1 cannot remove the webapp at all]
>> * the manager webapp is called to undeploy that application, BUG: it
>> answers OK, but it is not.
>>
>>(..)
>
> Please file an issue in Bugzilla.
>
> Best regards,
> Konstantin Kolinko
>

Done (bug 50984). However, I've had to file it as 7.0.10, I wasn't
given the choice of 7.0.11.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Tomcat 7.0.11: bug with manager application when undeploying

2011-03-25 Thread Francis GALIEGUE
Scenario:

* tomcat starts, as user u1, with only the manager application in place;
* it is configured as to not deploy automatically;
* user u1 copies a webapp tree into $CATALINA_HOME/webapps, which it
can since it has write/execute access to this directory;
* the manager webapp is called to deploy that new web application;
* [in between, credentials on the deployed webapp directory are
changed so that user u1 cannot remove the webapp at all]
* the manager webapp is called to undeploy that application, BUG: it
answers OK, but it is not.

The manager webapp documentation explicitly states that undeploying an
application means that the webapp tree is removed - but of course, in
this case it isn't. Proof:


[o3@tomcat-r8 cockpit]$ wget -O - -q --http-user=tomcat
--http-password=tomcat  http://localhost:8080/manager/text/list|sed 1d
/manager:running:6:/usr/share/tomcat7/webapps/manager
# webapp tree is created, then:
[o3@tomcat-r8 cockpit]$ wget -O - -q --http-user=tomcat
--http-password=tomcat
http://localhost:8080/manager/text/deploy'?path=/cockpit&war=file:/var/lib/o3/tomcat/installs/cockpit'
OK - Deployed application at context path /cockpit
# Note that /var/lib/o3/tomcat/installs is $CATALINA_HOME/webapps
[...]
# In another terminal:
[root@tomcat-r8 installs]# pwd
/var/lib/o3/tomcat/installs
# We now remove all access rights to o3
[root@tomcat-r8 installs]# chown -R root.root cockpit/
[...]
# Back to the first terminal:
[o3@tomcat-r8 cockpit]$ wget -O - -q --http-user=tomcat
--http-password=tomcat
http://localhost:8080/manager/text/undeploy?path=/cockpit
OK - Undeployed application at context path /cockpit
# At that point, the whole webapp tree still exists
[o3@tomcat-r8 cockpit]$ wget -O - -q --http-user=tomcat
--http-password=tomcat  http://localhost:8080/manager/text/list|sed 1d
/manager:running:9:/usr/share/tomcat7/webapps/manager
/cockpit:stopped:0:cockpit


The documentation explicitly states: "WARNING - This command will
delete any web application artifacts that exist within appBase
directory (typically "webapps") for this virtual host. This will
delete the the application .WAR, if present, the application directory
resulting either from a deploy in unpacked form or from .WAR expansion
as well as the XML Context definition from
$CATALINA_BASE/conf/[enginename]/[hostname]/ directory."

This turns out to be FALSE in this case. While the application is
indeed stopped, the "web application artifacts" are NOT removed. The
undeploy command should have failed. It hasn't. What's more, the logs
don't mention that the webapp tree has failed to be removed at all.

If I chown back the webapp tree to its rightful owner, then the webapp
is indeed undeployed in the full meaning of it: all "artifacts" are
indeed destroyed.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Tomcat 7.0.11, manager application: is this expected?

2011-03-24 Thread Francis GALIEGUE
On Thu, Mar 24, 2011 at 17:03, Mark Thomas  wrote:
[...]
>
> The only validation done is that the path is either zero length or
> starts with a '/'. Anything else is permitted. Could the validation be
> stricter? Sure. But in this case all you get (if I a reading the code
> correctly) is an application that will never have a request mapped to it
> since requests are normalised before mapping.
>

No, not only. Look at the deployed path: it has nothing to do with
what actually happened. In the list, it is marked as "..#cockpit". As
a result, while the undeploying command will work for this context,
the webapp files are not removed (tested). I haven't tried the stop,
start and reload command but I suspect they may also behave strangely.

Which turns this "feature" into a bug :p

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Tomcat 7.0.11, manager application: is this expected?

2011-03-24 Thread Francis GALIEGUE
[o3@tomcat-r8 cockpit]$ wget -O - -nv --http-user=tomcat
--http-password=tomcat
http://localhost:8080/manager/text/deploy'?path=/../cockpit&war=file:/var/lib/o3/tomcat/installs/cockpit'
OK - Deployed application at context path /../cockpit
2011-03-24 16:49:14
URL:http://localhost:8080/manager/text/deploy?path=/../cockpit&war=file:/var/lib/o3/tomcat/installs/cockpit
[54] -> "-" [1]
[o3@tomcat-r8 cockpit]$ wget -O - -nv --http-user=tomcat
--http-password=tomcat  http://localhost:8080/manager/text/list
OK - Listed applications for virtual host localhost
/manager:running:2:/usr/share/tomcat7/webapps/manager
/../cockpit:running:0:..#cockpit
2011-03-24 16:49:18 URL:http://localhost:8080/manager/text/list [139] -> "-" [1]

Strange that a path with a .. in it should be accepted imho...

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: email to system admin

2011-03-24 Thread Francis GALIEGUE
On Thu, Mar 24, 2011 at 14:27, Emil Dombagolla  wrote:
> Dear all,
>
> I have struts2 application running on tomcat 5.
>
> and i have few error pages to display the run-time errors defined in
> web.xml.
>
> in any case if the application landed to error page i want to get an email
> to my inbox with the exception details .
>
> can i configure this with tomcat.
>
> please help me with this.
>
> Thank you so much.
>

You can do this with log4j.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Advantages of using tomcat manager over the conventional approach of copy-it-to-deploy/undeploy

2011-03-24 Thread Francis GALIEGUE
On Thu, Mar 24, 2011 at 08:06, neeraj kumar  wrote:
> Mark,
>
> Thanks a lot for the reply.
>
> This was really helpful.
>
> Thanks
>

I find there is a very nice feature with the manager webapp: if you
use it in text mode and ask it to deploy/start/stop/undeploy an
application, the command you issue will terminate only when it is
finished (either well or badly). In short, it is ideally suited for
scripting purposes.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Max value of MaxPermSize

2011-03-21 Thread Francis GALIEGUE
On Mon, Mar 21, 2011 at 10:24, abhishek jain  wrote:
[...]
> what should be the appropriate settings, and on what basis should i select
> them, i want max memory given to java.
>

You cannot really know offhand what permgen size you'll need. If you
use a recent enough Sun JVM, however, you'll be able to have it
dynamically size the heap size by using the -XX:+AggressiveHeap
startup option. Unfortunately, it cannot dynamically size permgen the
way it does heap :/

> also am i writing these values in the correct location,

With the tomcat base startup scripts, this should be in
$CATALINA_BASE/setenv.sh. This file will be sourced by catalina.sh if
it exists.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: How to detect down of tomcat.

2011-03-20 Thread Francis GALIEGUE
On Sun, Mar 20, 2011 at 05:05, Hide  wrote:
[...]
>
> My explanation seems to have been bad.
> I explain it a little more.
>
> It is a method to output the information of the abnormal termination in
> "catalina.log" that I want to know.
> Would you teach it if you know some method?
>

Not really, no. If, for instance, you don't have a minimal security
configuration, you can put in your code, say, System.exit(0), and
Tomcat will die without notice.

The base scripts output the PID of a running Tomcat instance in a
file, what you can do is check for the existence of the PID in this
file. All the code is in catalina.sh already - which makes me wonder
why isn't there a catalina.sh status option while we are at it?

And even though you are running Windows, you should consider using
cygwin. I don't know for PowerShell, what I do know though is that
Unix shell expertise is far more common, and Unix shell is much more
powerful than Windows' batch files anyway.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: [OT] Tomcat 7: manager application takes forever to deploy - or not

2011-03-19 Thread Francis GALIEGUE
On Fri, Mar 18, 2011 at 22:45, Christopher Schultz
 wrote:
[...]
>
> I'm interested to see how you are able to launch Tomcat and have your
> script continue only after all webapps have been deployed.
>

This is the code right now:


if [ "$1" = "start" ]; then
STARTDATE=$(date +%Y%m%d-%H%M)
STAMP="=== START $STARTDATE ==="

cat >>"$LOGFILE" <> "$LOGFILE" 2>&1 &

echo $! > $CATALINA_PID

MAXITERS=120
ITERS=0

while true; do
ITERS=$((ITERS+1))
if [ $ITERS -gt $MAXITERS ]; then
echo
echo >&2 "BUG: Tomcat not started after
$MAXITERS seconds!"
exit 1
fi

perl -ne "print if /^$STAMP$/ .. eof()" "$LOGFILE" | \
egrep -q "^INFO: Server startup in [0-9]+ ms$"

RC=$?

if [ "$RC" = "0" ]; then
break
fi
echo -n .
sleep 1
done

echo " Done (in $ITERS seconds)"
[...]


It is with this script that I noticed the long deploying time of
/manager. This is the only way I knew of until yesterday, when I
noticed that the shutdown port only gets open after webapps are
deployed. I'll switch to this technique (using netstat -ltn|grep -w
$SHUTDOWN_PORT or something like that) since it is more reliable (and
faster) than scanning the log file: the server startup message may
change behind me... Ideally, of course, it'd be very nice if the
BootStrap class had, said, a "fullstart" command: I wouldn't need any
of these ;)

Ultimately, what I really want to do anyway is a startup sequence
which starts Tomcat up only with the manager app, and which deploys
webapps the list of which I store in another place. The deploy command
only returns after the app is fully deployed, which is good (and so
does the undeploy command).

[...]
>
>> Third, what if you want to do SNMP monitoring
>> (-Dcom.sun.management.snmp.port=xxx etc etc)? You can't with the
>> bundled scripts. Why? If you set JAVA_OPTS appropriately, these
>> JAVA_OPTS will also be used for shutdown... Which means you can't
>> shutdown at all: EADDRINUSE. Unless you arrange for different
>> JAVA_OPTS on startup and shutdown, which I don't need to do with my
>> scripts.
>
> As Chuck suggests, you haven't read the documentation well enough
> because catalina.sh has options to cover your situation described above.
>

Indeed.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: [OT] Tomcat 7: manager application takes forever to deploy - or not

2011-03-18 Thread Francis GALIEGUE
On Fri, Mar 18, 2011 at 17:58, Christopher Schultz
 wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Francis,
>
> On 3/18/2011 6:16 AM, Francis GALIEGUE wrote:
>> I build my own CATALINA_HOME, the difference between the bundled
>> tar.gz and my home are:
>>
>> * no i18n jars;
>> * only the manager webapp, I don't need the others;
>> * changes in logging, I only use the consolehandler;
>> * Coyote connector only listens on localhost;
>> * I use my own startup scripts, and the java command line is as such:
>
> That's a waste of time for you. Instead, use a CATALINA_BASE with a
> custom bin/setenv.sh script to set JAVA_OPTS.
>

Beauty hides in the eye of the beholder ;)

For one, the default startup and shutdown scripts won't account for
the time taken for the webapps to deploy: when you use startup.sh, the
script terminates after the initial bootstrap is done - I don't want
that. Similarly, the shutdown script won't wait until all webapps are
undeployed and you can end with a stranded JVM trying to shutdown
uncooperative webapps.

Second, I use Linux only and don't need the cygwin/as400/etc specific stuff.

Third, what if you want to do SNMP monitoring
(-Dcom.sun.management.snmp.port=xxx etc etc)? You can't with the
bundled scripts. Why? If you set JAVA_OPTS appropriately, these
JAVA_OPTS will also be used for shutdown... Which means you can't
shutdown at all: EADDRINUSE. Unless you arrange for different
JAVA_OPTS on startup and shutdown, which I don't need to do with my
scripts.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Tomcat 7: manager application takes forever to deploy - or not

2011-03-18 Thread Francis GALIEGUE
[...]
> 3. Use a different random source with:
>   JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"
>   in setenv.sh
>

Sorry for the misinformation. This actually works!

I thought this was a typo at first, but this wasn't, you MUST use
/dev/./urandom, /dev/urandom will not work. Duh.

Reference: 
http://stackoverflow.com/questions/137212/how-to-solve-performance-problem-with-java-securerandom

This is actually a JVM bug, which Sun/Oracle doesn't consider as being
one (yeah, right), see http://bugs.sun.com/view_bug.do?bug_id=6202721

Thanks a lot!
-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Tomcat 7: manager application takes forever to deploy - or not

2011-03-18 Thread Francis GALIEGUE
On Fri, Mar 18, 2011 at 14:47, Caldarale, Charles R
 wrote:
>> From: Francis GALIEGUE [mailto:f...@one2team.com]
>> Subject: Re: Tomcat 7: manager application takes forever to deploy - or not
>
>> On a 30 seconds start sequence, I collected 3 traces and
>> all look like this one.
>
>
> You're waiting on /dev/random.  As a workaround, set the following in the 
> java.security file of your JRE:
>
> securerandom.source=file:/dev/urandom
>
> (There may be other ways to achieve this.)
>
>  - Chuck
>

I've had very high hopes about that - and I also tried
java.security.egd as suggested by Mark. But no go :(

I stumbled upon that:

http://bugs.sun.com/view_bug.do?bug_id=6366924

I tried the test program, and indeed, it hangs :(

I'll dig further...
-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Tomcat 7: manager application takes forever to deploy - or not

2011-03-18 Thread Francis GALIEGUE
>>
>> 4) TRACE is not a valid level name.
>> 1.  See JavaDoc for java.util.logging.Level. You want "FINE" or
>> "FINEST". Do not forget to add ".level" to the property name: it is
>> "packagename.level". Without the package ".level" (with a leading dot)
>> states the default. It defaults to INFO.
>>
>> 2.  The ".level" sets what logging statements are generated.
>> Those are further filtered by the Handler. (whether it writes them to
>> a particular file or not).
>>
>> If anything needs clarifying in the logging docs, please say so
>> http://tomcat.apache.org/tomcat-7.0-doc/logging.html
>>
>
> OK, I'll read up further and see what I can do.
>

OK, Here is what my logging.properties looks like now:


handlers = java.util.logging.ConsoleHandler

.handlers = java.util.logging.ConsoleHandler

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level
= FINE
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers
= java.util.logging.ConsoleHandler

Here is what I see in the logs:


INFO: Initialization processed in 1178 ms
Mar 18, 2011 2:45:52 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 18, 2011 2:45:52 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.11
Mar 18, 2011 2:45:52 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
Mar 18, 2011 2:45:52 PM org.apache.catalina.core.StandardContext listenerStart
FINE: Sending application start events
Mar 18, 2011 2:47:02 PM org.apache.catalina.core.StandardContext filterStart
FINE: Starting filters
Mar 18, 2011 2:47:02 PM org.apache.catalina.core.StandardContext filterStart
FINE:  Starting filter 'CSRF'
Mar 18, 2011 2:47:02 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 18, 2011 2:47:02 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mar 18, 2011 2:47:02 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 69826 ms


So, it's that "sending application events" which seems to take up a
lot of time. I don't know what that means...

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Tomcat 7: manager application takes forever to deploy - or not

2011-03-18 Thread Francis GALIEGUE
On Fri, Mar 18, 2011 at 11:53, Konstantin Kolinko
 wrote:
> 2011/3/18 Francis GALIEGUE :
[...]
>
> 1) You are using HTTP connector only, no AJP, no HTTPS?
>

I use AJP, which has no address restriction. I don't use HTTPS.

[...]
>
> 2) Take 3 thread dumps with several seconds between them -- to see
> what it is doing and where it is waiting
>

Done, see earlier mail.

[...]
>
> 4) TRACE is not a valid level name.
> 1.  See JavaDoc for java.util.logging.Level. You want "FINE" or
> "FINEST". Do not forget to add ".level" to the property name: it is
> "packagename.level". Without the package ".level" (with a leading dot)
> states the default. It defaults to INFO.
>
> 2.  The ".level" sets what logging statements are generated.
> Those are further filtered by the Handler. (whether it writes them to
> a particular file or not).
>
> If anything needs clarifying in the logging docs, please say so
> http://tomcat.apache.org/tomcat-7.0-doc/logging.html
>

OK, I'll read up further and see what I can do.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Tomcat 7: manager application takes forever to deploy - or not

2011-03-18 Thread Francis GALIEGUE
On Fri, Mar 18, 2011 at 11:46, Mark Thomas  wrote:
> On 18/03/2011 10:20, Francis GALIEGUE wrote:
>> Sorry, keyboard error, so I'll continue here.
>>
>>>
>>> How do I go about logging wh
>>
>> ...at the manager application is doing while it deploys? Note, I use
>> the default Tomcat logging mechanism.
>
> My guess is that something is hanging somewhere, probably on some sort
> of network activity - although I can;t think what it might be. When it
> seems to be slow, take 2 or 3 thread dumps a couple of seconds apart.
> That should point you towards the but of code causing the problem.
>

http://paste.pocoo.org/show/355534/

On a 30 seconds start sequence, I collected 3 traces and all look like
this one. I don't see anything related to the manager webapp though :/

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: Tomcat 7: manager application takes forever to deploy - or not

2011-03-18 Thread Francis GALIEGUE
Sorry, keyboard error, so I'll continue here.

>
> How do I go about logging wh

...at the manager application is doing while it deploys? Note, I use
the default Tomcat logging mechanism.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Tomcat 7: manager application takes forever to deploy - or not

2011-03-18 Thread Francis GALIEGUE
Hello,

Here is the environment:

* Tomcat 7.0.x, where x is 8 or 11;
* RHEL 6, x86_64 ;
* 64bit Sun JVM 1.6.0.24 ;
* this is a VM on ESX, 2 vCPUs, 2 GB RAM;

I build my own CATALINA_HOME, the difference between the bundled
tar.gz and my home are:

* no i18n jars;
* only the manager webapp, I don't need the others;
* changes in logging, I only use the consolehandler;
* Coyote connector only listens on localhost;
* I use my own startup scripts, and the java command line is as such:

/usr/lib/jvm/jre/bin/java -server -XX:-UsePerfData
-Djava.awt.headless=true -Djava.awt.headlesslib=true
-XX:+AggressiveHeap -classpath
:/home/o3/tomcat/bin/bootstrap.jar:/home/o3/tomcat/bin/commons-daemon.jar:/home/o3/tomcat/bin/tomcat-juli.jar
-Dcatalina.base=/home/o3/tomcat -Dcatalina.home=/home/o3/tomcat
-Djava.endorsed.dirs= -Djava.io.tmpdir=/home/o3/tomcat/temp
-Djava.util.logging.config.file=/home/o3/tomcat/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
org.apache.catalina.startup.Bootstrap start

The trouble is: most of the time, when Tomcat starts, the manager
application takes 30 seconds or more to deploy (I've seen 60, 120 and
as far as 260 seconds!). When all goes well, the startup time is 600
ms. If I remove the webapp (and therefore start Tomcat with no webapp
at all), the startup time is fast as well (~50 ms). Shutdown time is
consistent, though, and perfectly normal.

I don't even know where to start to debug. I've tried to switch the
loglevel to TRACE in logging.properties but it doesn't change anything
in catalina.out, which is strange.

How do I go about logging wh
-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
f...@one2team.com
40 avenue Raymond Poincaré
75116 Paris

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



Re: 301 permanent redirects in Apache + Tomcat using mod_jk (solved partly)

2008-04-13 Thread Francis Galiegue
2008/4/13, Shashidhar Rampally <[EMAIL PROTECTED]>:
[...]
>  Also when I tried to replace one VirtualHost with multiple
>  VirtualHosts (and hence not needing mod_rewrite), I am getting the
>  following error message:
>  [warn] VirtualHost xyz.com:80 overlaps with VirtualHost
>  www.xyz.com:80, the first has precedence, perhaps you need a
>  NameVirtualHost directive
>

Have you put a NameVirtualHost your.ip.add.ress:{443,80} before
defining your virtual hosts?

-- 
Francis Galiegue, [EMAIL PROTECTED]
"When it comes to performance, weight is everything" - Tiff Needell

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 301 permanent redirects in Apache + Tomcat using mod_jk (solved partly)

2008-04-12 Thread Francis Galiegue
2008/4/12, Christopher Schultz <[EMAIL PROTECTED]>:
> -BEGIN PGP SIGNED MESSAGE-
>  Hash: SHA1
>
>  Francis,
>
>  Francis Galiegue wrote:
>  | Apache is much better at serving static content...
>
>  To be fair, Apache httpd and Tomcat are about equal. But, if you are
>  already using Apache httpd, you may as well have it serve the static
>  content instead of forwarding such requests to Tomcat.
>
>  Sorry to pick nits, but the fallacy that Tomcat sucks as a static
>  content server just needs to die.
>

Well, the performance tests we did (Tomcat 5.0.x/Coyote vs Apache
2.0.x/AJP13/Tomcat 5.0.x) surely didn't account for it being a
"fallacy". I don't know whether this has changed in 5.5.x/6.x, but
Coyote doesn't know about mod_expires and keepalive, for one. And that
makes a huge difference.

-- 
Francis Galiegue, [EMAIL PROTECTED]
"When it comes to performance, weight is everything" - Tiff Needell

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   >