RE: FW: General / Special cause under which TOMCAT Crash been noticed

2010-05-02 Thread Karthik Nanjangude
Hi

As I have indicated that my Web application would be installed /run remotely 
with out any monitoring factor (for reasons)

I was validating in such situations ,if any known reasons for Tomcat Crash 
happens ...How to restart automatically with mail notification as the only form 
of  offline monitor for status.





With regards
karthik

-Original Message-
From: Gregor Schneider [mailto:rc4...@googlemail.com]
Sent: Friday, April 30, 2010 4:38 PM
To: Tomcat Users List
Subject: Re: FW: General / Special cause under which TOMCAT Crash been noticed

Karthik,

*If* any OutOfMemoryError occurs within Tomcat, the reason for said
error will be some faulty webapp, meaning it is likely to crash any
other servlet-container, too.

Therefore, stick to the rules I pointed out above, and you'll be fine:

> Make sure you have some solutions ready in case of DDoS, see that your
> OS is stable and on a current patchlevel and scrutinize  the software
> you're installing into Tomcat (aka Webapps) thoroughly - that's about
> it.

Rgds

Gregor
--
just because you're paranoid, don't mean they're not after you...
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available
@ http://pgpkeys.pca.dfn.de:11371
@ http://pgp.mit.edu:11371/
skype:rc46fi

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


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



Re: Tomcat Connector to Apache 2.2

2010-05-02 Thread Jie Sheng Chua
Hi André,

The $ is because the line is too long and my putty end it up with a $.
Sorry for that problem.
The "Js-Server-Ubuntu.gateway.2wire.net" is rdns for my server ip address of
192.168.1.68. My router automatically reverse it.
Previously I used the default setting of my virtual host
(/etc/apache2/sites-available/default).
I changed the virtual host file, adding
JkMount /examples tomcat1
JkMount /examples/* tomcat1
after the line "ServerAdmin webmas...@localhost"
And IT WORK!
Also noting that after I restart my server, apache2 copied the conf
from /etc/apache2/sites-available/default
to /etc/apache2/sites-enabled/000-default

Sorry for all the little thing and Thanks André for guiding me so far.
You made me learn alot.

Thanks everyone for helping.
Hope this will help other later.

Thanks and Best Regards
Jie Sheng

On Mon, May 3, 2010 at 4:14 AM, André Warnier  wrote:

> Hi.
>
> First of all, I get all the messages posted to the list, so you do not need
> to send me a copy as a "cc", because that makes me get every message twice.
> Thanks.
>
> Next, do not change too many things at a time, that just confuses things
> for now.  So let's stick to the JkMount syntax for now.
>
> The log that you sent shows what happens when you restart Apache : the
> initialisation of mod_jk etc..
>
> It also seems that the log lines are all truncated to some length, ending
> up in a "$" sign. Is that something to do with your email program ?
> Example :
>
> > uri_worker_map_add::jk_uri_worker_map.c (720): wildchar rule
> > '/examples/*=tomcat1' source 'JkMou$
>
> The last part of that line should at least have 'JkMount' complete.
>
> Anyway, it means that apparently the JkMount directives are being read and
> understood,somewhere.
>
> What puzzles me is this part, at the end of the log :
>
>
> > [Mon May 03 02:27:18 2010] [3389:4042901264] [debug]
> jk_translate::mod_jk.c
> > (3419): missing uri map for Js-Server-Ubuntu.gateway.2wire.net:
> /examples/
> > [Mon May 03 02:27:18 2010] [3389:4042901264] [debug]
> > jk_map_to_storage::mod_jk.c (3579): missing uri map for
> > Js-Server-Ubuntu.gateway.2wire.net:/exam$
>
> Where does this "Js-Server-Ubuntu.gateway.2wire.net" come from ?
>
> You have not answered my question about VirtualHost's in Apache.
> I have a suspicion that this is where your problems come from.
> Re-read the end of my previous post.
>
> What it looks like to me, is that you have an Apache configuration using
> VirtualHost sections, and that the JkMount's are not in that VirtualHost
> section, nor are you using JkMountCopy.
>
> Basically and roughly what it means, is that the VirtualHost does have the
> mod_jk module loaded and active, but it does not know about your
> JkMount /examples
> directives.
> So it gets the request from Apache and looks at the URL, but does not
> recognise it as something it should handle.  So it gives it back to Apache
> and tells it "not for me, do it yourself".
>
> Do you understand what VirtualHost means, and where this is configured
> under Ubuntu ?
> Hava look at the httpd.conf for "Include" directives naming stuff like
> "vhosts.d" or "sites-enabled".
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Jie Sheng, Chua
(+65) 97520245
chuajiesh...@gmail.com

The contents of this email are confidential to the intended recipient and
may not be disclosed. Although it is believed that this email and any
attachments are virus free, it is the responsibility of the recipient to
confirm this.


Re: Tomcat Connector to Apache 2.2

2010-05-02 Thread André Warnier

David Smith wrote:

Personally I highly recommend the Firebug plugin for Firefox to diagnose
this stuff.  It does an amazing job of showing parameters, headers,
responses, everything.

In this case however, we know the request URL and we know the server 
response, so I don't think a browser-side plugin would tell us much.


In general though I agree, a tool like that is a must for debugging 
browser-server exchanges.
There are also, for Firefox, the LiveHttpHeaders and HttpFox plugins, 
and for IE, the Fiddler2 plugin.


My money so far is on the VirtualHost issue.


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



Re: Tomcat Connector to Apache 2.2

2010-05-02 Thread David Smith
Personally I highly recommend the Firebug plugin for Firefox to diagnose
this stuff.  It does an amazing job of showing parameters, headers,
responses, everything.

--David

On 5/2/2010 12:42 PM, André Warnier wrote:
> Hi.
>
> Jie Sheng Chua wrote:
>   
>> Hi André and Juha,
>>
>> I edit my tomcat server.xml as describe. my tomcat and apache listed that
>> the connector is started as in the log.
>> But when i access (http://192.168.1.68/examples/index.html) with IE, "The
>> webpage cannot be found" error is displayed.
>> 
> Do yourself a favor, and in IE, in the settings, unclick the option for 
> "use friendly error messages".
> This way, you will see the page really sent back by the server, and not 
> the internal built-in IE "friendly" error page, which is useless.
>
>   
>> When i access "http://192.168.1.68:8080/examples/index.html";, the page can
>> be display.
>> 
> Ok. This means that at least Tomcat can find the page.
>
> Your Apache/mod_jk configuration also looks ok to me.
>
> ...
>
>   
>> ---
>> *apache2: error.log*
>>
>> [Sun May 02 23:02:33 2010] [notice] Apache/2.2.14 (Ubuntu) mod_jk/1.2.28
>> configured -- resuming normal operations
>> [Sun May 02 23:04:27 2010] [error] [client 192.168.1.66] File does not
>> exist: /var/www/examples
>>
>> 
> The above can be 2 things :
> a) either Apache is not even trying to pass this request to mod_jk
> or
> b) Apache passes the request to mod_jk, but mod_jk returns the request 
> to Apache with the code DECLINE.
> This would mean that mod_jk has examined the URL of the request, 
> determined that it does not match any of its "JkMount", and decided this 
> request is not for him and should be handled by Apache itself.
> Then Apache tries to find (himself) the requested document under its own 
> DocumentRoot, and it fails, so it returns a 404 Not Found response.
>
> To find out more, increase the log level of mod_jk :
>
>  > # Set the jk log level [debug/error/info]
>  > JkLogLevelinfo
> to
> JkLogLevel debug
>
> Then retry and look at /var/log/apache2/mod_jk.log.
> It will tell you, step by step, how it tries to match the request URL to 
> one of its JkMount mappings.
>
> Or it will tell nothing, and in that case we are in case (a) above.
>
> One question : is does not look that way from the configuration you 
> posted, but are you using VirtualHost(s) in Apache ?
> If yes, then make sure that your JkMount directives are in the 
> VirtualHost configuration section, or lookup the "JkMountCopy" 
> directive. (JkMount's are not automatically inherited by VirtualHost 
> sections, from the main httpd section).
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>   


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



Re: Tomcat on a machine with multiple ip addresses

2010-05-02 Thread Pid
On 02/05/2010 20:35, Dave Filchak wrote:
> Due to a hard drive failure, I am needing to move some websites to a
> machine that has Tomcat already running on it with Apache as the front
> end. I was unable to get the sites working using the Apache instance
> that was already there so, I installed a second instance on the machine,
> with a separate pid and listening on a different ip. ( it would have
> been better to just use the same Apache instance but I could not get it
> to work. The default Tomcat page kept coming up) I added the address
> attribute to the server.xml files so that it would not listen on all
> interfaces. So, I have the new instance sort of working but for some
> reason, on all but two virtual sites, I cannot access them if I use
> www.somedomain.com. Only if I use somedomain.com. As I said, two of the
> sites work fine. The dns resolves correctly to either www.somedomain.com
> or somedomain.com. So, can tomcat or could tomcat be screwing this up
> somehow (actually, I guess it would have been me who screwed it up
> somewhere). I am not well versed in tomcat at this point so some help
> would be greatly appreciated. Either just to solve this issue or help on
> how I could have simply used the original instance to server my
> non-tomcat php sites.

Tomcat, HTTPD, JVM, OS exact versions please.

What are you using to connect HTTPD and Tomcat, mod_jk or mod_proxy?

Please also post some config information, with comments and passwords
removed. workers.properties (for mod_jk) or your mod_proxy config,
server.xml and any applicable context.xml definitions.


p



signature.asc
Description: OpenPGP digital signature


Re: changing tomcat-users.xml makes tomcat unresponsive

2010-05-02 Thread David Smith
You might want to check the file permissions before and after you edit
it.  Something about this smells like a permissions issue.  I have a
Ubuntu 9.10 installed tomcat and it works perfect.  Admittedly I didn't
upgrade from 8.4 but w/ editing tomcat-user.xml being the only change,
there are only a couple of things to cause your issue:

1. File permissions changed
2. The edited xml file doesn't validate as xml.  There are a number of
xml editors out that can also validate.

--David

On 5/2/2010 1:37 PM, paul geer wrote:
> Thank you for the reply.  Do you mean the original installation of ubuntu or
> tomcat?  I restored the tomcat settings back to the original state, but
> cannot see that an examples app is pre-installed.  If it's something I need
> to deploy myself, I'm not sure how to do that without access to the
> management console.
>
> If you meant the original 8.4 ubuntu, I was hoping to try other solutions
> before doing that.  I'm completely willing to, as I'm not attached to
> anything I've done, but since it's inconvenient I would rather wait.
>
> On Sat, May 1, 2010 at 2:49 PM, Pid  wrote:
>
>   
>> On 01/05/2010 18:19, paul geer wrote:
>> 
>>> Hello all,
>>>
>>> I had an installation of ubuntu 8.04 that I recently upgraded to 9.10.  I
>>> barely used it before the upgrade so the system was very close to a fresh
>>> install of 8.04 before the upgrade.
>>>
>>> I installed tomcat6 with apt-get.  After setting everything up, I checked
>>> that I could access the "It works" default page from both inside my home
>>> network and would accept outside connections.  Clicking the link for the
>>> manager console prompted me for a username and password, but since I had
>>>   
>> not
>> 
>>> yet made changes to tomcat-users.xml, it failed as expected.
>>>
>>> I edited the file (/etc/tomcat6/tomcat-users.xml), uncommented the
>>> "existing" users and added a manager role and a manager user with that
>>> role.  Upon restarting the server, any attempt to connect to the server
>>> locally or externally causes the browser to "spin" as if loading a page
>>>   
>> but
>> 
>>> with no results.  I will sit and spin for hours if I let it (I have)
>>>   
>> without
>> 
>>> timing out.
>>>
>>> I have tried various permutations of users in the file, such as
>>>   
>> uncommenting
>> 
>>> the original ones and not adding a manager role or user, adding the role
>>>   
>> to
>> 
>>> one of the default users, etc, but the only way to get the index page to
>>> actually load again is to comment out all users.
>>>
>>> Web searches of this issue have only turned up instances of people not
>>> realizing the users were commented out and editing the file anyway.
>>>
>>> Also, /var/logs/tomcat6 does not contain any logs. I've used updatedb and
>>> locate to verify that there aren't other tomcat-users files elsewhere.
>>>   
>>  I've
>> 
>>> also been unable to locate an alternate log directory.
>>>
>>> Thanks for any help the community can offer.  Enjoy your weekend,
>>>   
>> If you revert to the original installation, does the /examples app work?
>>
>> Does using the examples app generate log files in the expected location?
>>
>>
>> p
>>
>>
>>
>> 


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



Re: Tomcat Connector to Apache 2.2

2010-05-02 Thread André Warnier

Hi.

First of all, I get all the messages posted to the list, so you do not 
need to send me a copy as a "cc", because that makes me get every 
message twice. Thanks.


Next, do not change too many things at a time, that just confuses things 
for now.  So let's stick to the JkMount syntax for now.


The log that you sent shows what happens when you restart Apache : the 
initialisation of mod_jk etc..


It also seems that the log lines are all truncated to some length, 
ending up in a "$" sign. Is that something to do with your email program ?

Example :
> uri_worker_map_add::jk_uri_worker_map.c (720): wildchar rule
> '/examples/*=tomcat1' source 'JkMou$

The last part of that line should at least have 'JkMount' complete.

Anyway, it means that apparently the JkMount directives are being read 
and understood,somewhere.


What puzzles me is this part, at the end of the log :

> [Mon May 03 02:27:18 2010] [3389:4042901264] [debug] 
jk_translate::mod_jk.c

> (3419): missing uri map for Js-Server-Ubuntu.gateway.2wire.net:/examples/
> [Mon May 03 02:27:18 2010] [3389:4042901264] [debug]
> jk_map_to_storage::mod_jk.c (3579): missing uri map for
> Js-Server-Ubuntu.gateway.2wire.net:/exam$

Where does this "Js-Server-Ubuntu.gateway.2wire.net" come from ?

You have not answered my question about VirtualHost's in Apache.
I have a suspicion that this is where your problems come from.
Re-read the end of my previous post.

What it looks like to me, is that you have an Apache configuration using 
VirtualHost sections, and that the JkMount's are not in that VirtualHost 
section, nor are you using JkMountCopy.


Basically and roughly what it means, is that the VirtualHost does have 
the mod_jk module loaded and active, but it does not know about your

JkMount /examples
directives.
So it gets the request from Apache and looks at the URL, but does not 
recognise it as something it should handle.  So it gives it back to 
Apache and tells it "not for me, do it yourself".


Do you understand what VirtualHost means, and where this is configured 
under Ubuntu ?
Hava look at the httpd.conf for "Include" directives naming stuff like 
"vhosts.d" or "sites-enabled".





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



Re: Tomcat on a machine with multiple ip addresses

2010-05-02 Thread Smithan John
Hi Dave,

Please provide below information:


   - The port on which the old Apache instance is running.
   - The port on which the new Apache instance is configured.
   - Does the whole setup use only DNS resolution or do we have a CSS(Secure
   Switch) layer.

Regards,
Smithan.

On Mon, May 3, 2010 at 1:05 AM, Dave Filchak  wrote:

> Due to a hard drive failure, I am needing to move some websites to a
> machine that has Tomcat already running on it with Apache as the front end.
> I was unable to get the sites working using the Apache instance that was
> already there so, I installed a second instance on the machine, with a
> separate pid and listening on a different ip. ( it would have been better to
> just use the same Apache instance but I could not get it to work. The
> default Tomcat page kept coming up) I added the address attribute to the
> server.xml files so that it would not listen on all interfaces. So, I have
> the new instance sort of working but for some reason, on all but two virtual
> sites, I cannot access them if I use www.somedomain.com. Only if I use
> somedomain.com. As I said, two of the sites work fine. The dns resolves
> correctly to either www.somedomain.com or somedomain.com. So, can tomcat
> or could tomcat be screwing this up somehow (actually, I guess it would have
> been me who screwed it up somewhere). I am not well versed in tomcat at this
> point so some help would be greatly appreciated. Either just to solve this
> issue or help on how I could have simply used the original instance to
> server my non-tomcat php sites.
>
> Thanks in advance.
>
> Dave
>



-- 
Regards,

Smithan.


Re: changing tomcat-users.xml makes tomcat unresponsive

2010-05-02 Thread André Warnier

Hi.
I am not familiar with Ubuntu, but I am told it uses the same packages 
as Debian Linux.
In such a case, Tomcat itself, the example apps, and/or the manager 
applications, may be in 2 or 3 different packages, which you need to 
each install.

Check with "apt-cache search tomcat" to make sure.
e.g.
# apt-cache search tomcat
tomcat5.5 - Java Servlet 2.4 engine with JSP 2.0 support
tomcat5.5-admin - Java Servlet engine -- admin & manager web interfaces
tomcat5.5-webapps - Java Servlet engine -- documentation and example web 
applications



paul geer wrote:

Thank you for the reply.  Do you mean the original installation of ubuntu or
tomcat?  I restored the tomcat settings back to the original state, but
cannot see that an examples app is pre-installed.  If it's something I need
to deploy myself, I'm not sure how to do that without access to the
management console.

If you meant the original 8.4 ubuntu, I was hoping to try other solutions
before doing that.  I'm completely willing to, as I'm not attached to
anything I've done, but since it's inconvenient I would rather wait.

On Sat, May 1, 2010 at 2:49 PM, Pid  wrote:


On 01/05/2010 18:19, paul geer wrote:

Hello all,

I had an installation of ubuntu 8.04 that I recently upgraded to 9.10.  I
barely used it before the upgrade so the system was very close to a fresh
install of 8.04 before the upgrade.

I installed tomcat6 with apt-get.  After setting everything up, I checked
that I could access the "It works" default page from both inside my home
network and would accept outside connections.  Clicking the link for the
manager console prompted me for a username and password, but since I had

not

yet made changes to tomcat-users.xml, it failed as expected.

I edited the file (/etc/tomcat6/tomcat-users.xml), uncommented the
"existing" users and added a manager role and a manager user with that
role.  Upon restarting the server, any attempt to connect to the server
locally or externally causes the browser to "spin" as if loading a page

but

with no results.  I will sit and spin for hours if I let it (I have)

without

timing out.

I have tried various permutations of users in the file, such as

uncommenting

the original ones and not adding a manager role or user, adding the role

to

one of the default users, etc, but the only way to get the index page to
actually load again is to comment out all users.

Web searches of this issue have only turned up instances of people not
realizing the users were commented out and editing the file anyway.

Also, /var/logs/tomcat6 does not contain any logs. I've used updatedb and
locate to verify that there aren't other tomcat-users files elsewhere.

 I've

also been unable to locate an alternate log directory.

Thanks for any help the community can offer.  Enjoy your weekend,

If you revert to the original installation, does the /examples app work?

Does using the examples app generate log files in the expected location?


p








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



[no subject]

2010-05-02 Thread Tomcat Users List
X-zuka-RWMailScanner-ID: 49AB853821E.AE729
X-zuka-rw-MailScanner-Information: Please contact the ISP for more information
Received: from Magnolia.local (unknown [70.48.209.168])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(No client certificate requested)
(Authenticated sender: dave.filc...@zuka.net)
by rosewood.zuka.net (Postfix) with ESMTP id 49AB853821E
for ; Sun,  2 May 2010 15:36:36 -0400 (EDT)
Message-ID: <4bddd3f9.3080...@zuka.net>
Date: Sun, 02 May 2010 15:35:21 -0400
From: Dave Filchak 
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.9) 
Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4
MIME-Version: 1.0
To: users@tomcat.apache.org
Subject: Tomcat on a machine with multiple ip addresses
Content-Type: multipart/alternative;
 boundary="060208010707020700080002"
X-Virus-Checked: Checked by ClamAV on apache.org
X-Old-Spam-Status: No
X-pstn-neptune: 0/0/0.00/0
X-pstn-levels: (S:26.44926/99.9 CV:99.9000 FC:95.5390 LC:95.5390 
R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
X-pstn-settings: 4 (1.5000:1.5000) s cv gt3 gt2 gt1 r p m c 
X-pstn-addresses: from  [294/10] 

--060208010707020700080002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Due to a hard drive failure, I am needing to move some websites to a 
machine that has Tomcat already running on it with Apache as the front 
end. I was unable to get the sites working using the Apache instance 
that was already there so, I installed a second instance on the machine, 
with a separate pid and listening on a different ip. ( it would have 
been better to just use the same Apache instance but I could not get it 
to work. The default Tomcat page kept coming up) I added the address 
attribute to the server.xml files so that it would not listen on all 
interfaces. So, I have the new instance sort of working but for some 
reason, on all but two virtual sites, I cannot access them if I use 
www.somedomain.com. Only if I use somedomain.com. As I said, two of the 
sites work fine. The dns resolves correctly to either www.somedomain.com 
or somedomain.com. So, can tomcat or could tomcat be screwing this up 
somehow (actually, I guess it would have been me who screwed it up 
somewhere). I am not well versed in tomcat at this point so some help 
would be greatly appreciated. Either just to solve this issue or help on 
how I could have simply used the original instance to server my 
non-tomcat php sites.

Thanks in advance.

Dave

--060208010707020700080002--


[no subject]

2010-05-02 Thread Tomcat Users List
X-zuka-RWMailScanner-ID: 49AB853821E.AE729
X-zuka-rw-MailScanner-Information: Please contact the ISP for more information
Received: from Magnolia.local (unknown [70.48.209.168])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(No client certificate requested)
(Authenticated sender: dave.filc...@zuka.net)
by rosewood.zuka.net (Postfix) with ESMTP id 49AB853821E
for ; Sun,  2 May 2010 15:36:36 -0400 (EDT)
Message-ID: <4bddd3f9.3080...@zuka.net>
Date: Sun, 02 May 2010 15:35:21 -0400
From: Dave Filchak 
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.9) 
Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4
MIME-Version: 1.0
To: users@tomcat.apache.org
Subject: Tomcat on a machine with multiple ip addresses
Content-Type: multipart/alternative;
 boundary="060208010707020700080002"
X-Virus-Checked: Checked by ClamAV on apache.org
X-Old-Spam-Status: No
X-pstn-neptune: 0/0/0.00/0
X-pstn-levels: (S:26.44926/99.9 CV:99.9000 FC:95.5390 LC:95.5390 
R:95.9108 P:95.9108 M:97.0282 C:98.6951 )
X-pstn-settings: 4 (1.5000:1.5000) s cv gt3 gt2 gt1 r p m c 
X-pstn-addresses: from  [294/10] 

--060208010707020700080002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Due to a hard drive failure, I am needing to move some websites to a 
machine that has Tomcat already running on it with Apache as the front 
end. I was unable to get the sites working using the Apache instance 
that was already there so, I installed a second instance on the machine, 
with a separate pid and listening on a different ip. ( it would have 
been better to just use the same Apache instance but I could not get it 
to work. The default Tomcat page kept coming up) I added the address 
attribute to the server.xml files so that it would not listen on all 
interfaces. So, I have the new instance sort of working but for some 
reason, on all but two virtual sites, I cannot access them if I use 
www.somedomain.com. Only if I use somedomain.com. As I said, two of the 
sites work fine. The dns resolves correctly to either www.somedomain.com 
or somedomain.com. So, can tomcat or could tomcat be screwing this up 
somehow (actually, I guess it would have been me who screwed it up 
somewhere). I am not well versed in tomcat at this point so some help 
would be greatly appreciated. Either just to solve this issue or help on 
how I could have simply used the original instance to server my 
non-tomcat php sites.

Thanks in advance.

Dave

--060208010707020700080002--


Re: changing tomcat-users.xml makes tomcat unresponsive

2010-05-02 Thread Ken Bowen
The standard Tomcat package from apache.org comes with an examples app  
pre-installed.

The various packagers (incl. Ubuntu) mangle Tomcat in a variety of ways.
Standard advice on this list for something like your situation seems  
to be is to first
download a clean Tomcat package from apache.org, and install it in  
some other folder with a simple unzip.

Then see how it behaves, and make comparisons to your present install.

On May 2, 2010, at 1:37 PM, paul geer wrote:

Thank you for the reply.  Do you mean the original installation of  
ubuntu or
tomcat?  I restored the tomcat settings back to the original state,  
but
cannot see that an examples app is pre-installed.  If it's something  
I need

to deploy myself, I'm not sure how to do that without access to the
management console.

If you meant the original 8.4 ubuntu, I was hoping to try other  
solutions

before doing that.  I'm completely willing to, as I'm not attached to
anything I've done, but since it's inconvenient I would rather wait.

On Sat, May 1, 2010 at 2:49 PM, Pid  wrote:


On 01/05/2010 18:19, paul geer wrote:

Hello all,

I had an installation of ubuntu 8.04 that I recently upgraded to  
9.10.  I
barely used it before the upgrade so the system was very close to  
a fresh

install of 8.04 before the upgrade.

I installed tomcat6 with apt-get.  After setting everything up, I  
checked
that I could access the "It works" default page from both inside  
my home
network and would accept outside connections.  Clicking the link  
for the
manager console prompted me for a username and password, but since  
I had

not

yet made changes to tomcat-users.xml, it failed as expected.

I edited the file (/etc/tomcat6/tomcat-users.xml), uncommented the
"existing" users and added a manager role and a manager user with  
that
role.  Upon restarting the server, any attempt to connect to the  
server
locally or externally causes the browser to "spin" as if loading a  
page

but

with no results.  I will sit and spin for hours if I let it (I have)

without

timing out.

I have tried various permutations of users in the file, such as

uncommenting
the original ones and not adding a manager role or user, adding  
the role

to
one of the default users, etc, but the only way to get the index  
page to

actually load again is to comment out all users.

Web searches of this issue have only turned up instances of people  
not

realizing the users were commented out and editing the file anyway.

Also, /var/logs/tomcat6 does not contain any logs. I've used  
updatedb and
locate to verify that there aren't other tomcat-users files  
elsewhere.

I've

also been unable to locate an alternate log directory.

Thanks for any help the community can offer.  Enjoy your weekend,


If you revert to the original installation, does the /examples app  
work?


Does using the examples app generate log files in the expected  
location?



p






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



Re: Tomcat Connector to Apache 2.2

2010-05-02 Thread Jie Sheng Chua
Hi André,

Sorry as this email will become quite long.
Thanks for your help so far.
I change the log to debug and this is the first type of log that I retrieve.

*Type 1 Log:*

[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_set_time_fmt::jk_util.c (458): Pre-processed log time stamp format is
'[%a %b %d %H:%M:%S %Y]$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_open::jk_uri_worker_map.c (770): rule map size is 2
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_add::jk_uri_worker_map.c (720): wildchar rule
'/examples/*=tomcat1' source 'JkMou$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_add::jk_uri_worker_map.c (729): exact rule
'/examples=tomcat1' source 'JkMount' w$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (171): uri map dump after map open:
index=0 file='(null$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 0: size=0
nosize=0 capacity=0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (176): generation 1: size=2
nosize=0 capacity=4
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (186): NEXT (1) map #0:
uri=/examples/* worker=tomcat1 $
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
uri_worker_map_dump::jk_uri_worker_map.c (186): NEXT (1) map #1:
uri=/examples worker=tomcat1 co$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_set_time_fmt::jk_util.c (458): Pre-processed log time stamp format is
'[%a %b %d %H:%M:%S %Y]$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] init_jk::mod_jk.c
(3107): Using fcntl() for locking.
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] init_jk::mod_jk.c
(3123): Setting default connection pool max size to 25
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.list' with
value 'tomcat1' to map.
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.type'
with value 'ajp13' t$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.host'
with value 'localhos$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_map_read_property::jk_map.c (491): Adding property 'worker.tomcat1.port'
with value '8009' to$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_map_resolve_references::jk_map.c (774): Checking for references with
prefix worker. with wild$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
jk_shm_calculate_size::jk_shm.c (132): shared memory will contain 1 ajp
workers of size 320 and $
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] do_shm_open::jk_shm.c
(493): Truncated shared memory to 448
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] do_shm_open::jk_shm.c
(538): Initialized shared memory /var/log/apache2/mod_jk.shm.3385 size=448$
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
do_shm_open_lock::jk_shm.c (412): Opened shared memory lock
/var/log/apache2/mod_jk.shm.3385.lock
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'ServerRoot' -> '/etc/apache2'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.list' -> 'tomcat1'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.type' -> 'ajp13'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.host' -> 'localhost'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug] jk_map_dump::jk_map.c
(589): Dump of map: 'worker.tomcat1.port' -> '8009'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
build_worker_map::jk_worker.c (242): creating worker tomcat1
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
wc_create_worker::jk_worker.c (146): about to create instance tomcat1 of
ajp13
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
wc_create_worker::jk_worker.c (159): about to validate and init tomcat1
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_validate::jk_ajp_common.c (2512): worker tomcat1 contact is
'localhost:8009'
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2699): setting endpoint options:
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2702): keepalive:  0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2706): socket timeout: 0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2710): socket connect timeout: 0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2714): buffer size:0
[Mon May 03 02:27:12 2010] [3385:4191106880] [debug]
ajp_init::jk_ajp_common.c (2718): pool timeout:

Re: changing tomcat-users.xml makes tomcat unresponsive

2010-05-02 Thread paul geer
Thank you for the reply.  Do you mean the original installation of ubuntu or
tomcat?  I restored the tomcat settings back to the original state, but
cannot see that an examples app is pre-installed.  If it's something I need
to deploy myself, I'm not sure how to do that without access to the
management console.

If you meant the original 8.4 ubuntu, I was hoping to try other solutions
before doing that.  I'm completely willing to, as I'm not attached to
anything I've done, but since it's inconvenient I would rather wait.

On Sat, May 1, 2010 at 2:49 PM, Pid  wrote:

> On 01/05/2010 18:19, paul geer wrote:
> > Hello all,
> >
> > I had an installation of ubuntu 8.04 that I recently upgraded to 9.10.  I
> > barely used it before the upgrade so the system was very close to a fresh
> > install of 8.04 before the upgrade.
> >
> > I installed tomcat6 with apt-get.  After setting everything up, I checked
> > that I could access the "It works" default page from both inside my home
> > network and would accept outside connections.  Clicking the link for the
> > manager console prompted me for a username and password, but since I had
> not
> > yet made changes to tomcat-users.xml, it failed as expected.
> >
> > I edited the file (/etc/tomcat6/tomcat-users.xml), uncommented the
> > "existing" users and added a manager role and a manager user with that
> > role.  Upon restarting the server, any attempt to connect to the server
> > locally or externally causes the browser to "spin" as if loading a page
> but
> > with no results.  I will sit and spin for hours if I let it (I have)
> without
> > timing out.
> >
> > I have tried various permutations of users in the file, such as
> uncommenting
> > the original ones and not adding a manager role or user, adding the role
> to
> > one of the default users, etc, but the only way to get the index page to
> > actually load again is to comment out all users.
> >
> > Web searches of this issue have only turned up instances of people not
> > realizing the users were commented out and editing the file anyway.
> >
> > Also, /var/logs/tomcat6 does not contain any logs. I've used updatedb and
> > locate to verify that there aren't other tomcat-users files elsewhere.
>  I've
> > also been unable to locate an alternate log directory.
> >
> > Thanks for any help the community can offer.  Enjoy your weekend,
>
> If you revert to the original installation, does the /examples app work?
>
> Does using the examples app generate log files in the expected location?
>
>
> p
>
>
>


Re: Tomcat Connector to Apache 2.2

2010-05-02 Thread André Warnier

Hi.

Jie Sheng Chua wrote:

Hi André and Juha,

I edit my tomcat server.xml as describe. my tomcat and apache listed that
the connector is started as in the log.
But when i access (http://192.168.1.68/examples/index.html) with IE, "The
webpage cannot be found" error is displayed.


Do yourself a favor, and in IE, in the settings, unclick the option for 
"use friendly error messages".
This way, you will see the page really sent back by the server, and not 
the internal built-in IE "friendly" error page, which is useless.



When i access "http://192.168.1.68:8080/examples/index.html";, the page can
be display.


Ok. This means that at least Tomcat can find the page.

Your Apache/mod_jk configuration also looks ok to me.

...



---
*apache2: error.log*

[Sun May 02 23:02:33 2010] [notice] Apache/2.2.14 (Ubuntu) mod_jk/1.2.28
configured -- resuming normal operations
[Sun May 02 23:04:27 2010] [error] [client 192.168.1.66] File does not
exist: /var/www/examples



The above can be 2 things :
a) either Apache is not even trying to pass this request to mod_jk
or
b) Apache passes the request to mod_jk, but mod_jk returns the request 
to Apache with the code DECLINE.
This would mean that mod_jk has examined the URL of the request, 
determined that it does not match any of its "JkMount", and decided this 
request is not for him and should be handled by Apache itself.
Then Apache tries to find (himself) the requested document under its own 
DocumentRoot, and it fails, so it returns a 404 Not Found response.


To find out more, increase the log level of mod_jk :

> # Set the jk log level [debug/error/info]
> JkLogLevelinfo
to
JkLogLevel debug

Then retry and look at /var/log/apache2/mod_jk.log.
It will tell you, step by step, how it tries to match the request URL to 
one of its JkMount mappings.


Or it will tell nothing, and in that case we are in case (a) above.

One question : is does not look that way from the configuration you 
posted, but are you using VirtualHost(s) in Apache ?
If yes, then make sure that your JkMount directives are in the 
VirtualHost configuration section, or lookup the "JkMountCopy" 
directive. (JkMount's are not automatically inherited by VirtualHost 
sections, from the main httpd section).






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



Re: Tomcat Connector to Apache 2.2

2010-05-02 Thread Jie Sheng Chua
Hi André and Juha,

I edit my tomcat server.xml as describe. my tomcat and apache listed that
the connector is started as in the log.
But when i access (http://192.168.1.68/examples/index.html) with IE, "The
webpage cannot be found" error is displayed.
When i access "http://192.168.1.68:8080/examples/index.html";, the page can
be display.
This tally with the error apache display in the log "error.log". But in the
same log it says that mod_jk configured and resuming normal operation.
There is a "Jk running ID=0 time=0/18  config=null" message when tomcat
start. I don't really understand what it is.
Hope to hear from you soon.
Log and config as below.

Thanks and Best Regard
Jie Sheng

---
*apache2: error.log*

[Sun May 02 23:02:33 2010] [notice] Apache/2.2.14 (Ubuntu) mod_jk/1.2.28
configured -- resuming normal operations
[Sun May 02 23:04:27 2010] [error] [client 192.168.1.66] File does not
exist: /var/www/examples

*apache2: access.log*

192.168.1.66 - - [02/May/2010:23:04:27 +0800] "GET /examples/index.html
HTTP/1.1" 404 510 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
Tri$

*apache2: mod_jk.log*

[Sun May 02 23:02:33 2010] [1593:4161124160] [info] init_jk::mod_jk.c
(3183): mod_jk/1.2.28 initialized
[Sun May 02 23:02:33 2010] [1594:4161124160] [info] init_jk::mod_jk.c
(3183): mod_jk/1.2.28 initialized

*tomcat6: catalina.out*

May 2, 2010 11:02:19 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: $
May 2, 2010 11:02:19 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
May 2, 2010 11:02:19 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 605 ms
May 2, 2010 11:02:20 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 2, 2010 11:02:20 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor manager.xml
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor examples.xml
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
May 2, 2010 11:02:20 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
May 2, 2010 11:02:20 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
May 2, 2010 11:02:20 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
*May 2, 2010 11:02:20 PM org.apache.jk.server.JkMain start*
*INFO: Jk running ID=0 time=0/18  config=null*
May 2, 2010 11:02:20 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 571 ms

---

*apache2: workers.properties*

# Define 1 real worker using ajp13
worker.list=tomcat1

# Set properties for worker1 (ajp13)
worker.tomcat1.type=ajp13
worker.tomcat1.host=localhost
worker.tomcat1.port=8009

*apache2: httpd.conf*

# Load mod_jk module
# Update this path to match your modules location
LoadModulejk_module  /usr/lib/apache2/modules/mod_jk.so

# Declare the module for  (remove this line on Apache
2.x)
# AddModule mod_jk.c

# Where to find workers.properties
# Update this path to match your conf directory location (put
workers.properties next to httpd.conf)
JkWorkersFile /etc/apache2/workers.properties

# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/apache2/mod_jk.shm

# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log
next to access_log)
JkLogFile /var/log/apache2/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevelinfo

# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# Send everything for context /examples to worker named worker1 (ajp13)
JkMount  /examples/* tomcat1
JkMount  /examples tomcat1

*tomcat6: server.xml*





  
  
  
  

  


  

  







  
  
  

  


---

On Sun, May 2, 2010 at 6:14 PM, André Warnier  wrote:

> Jie Sheng Chua wrote:
>
>> Hi,
>>
>> I operating Ubuntu 10

Re: The purpose of maxPostSize

2010-05-02 Thread Mark Thomas
On 02/05/2010 15:06, André Warnier wrote:
> Mark Thomas wrote:
>> On 02/05/2010 14:39, André Warnier wrote:
>>
>>> There exists a "FileUpload" module for that in the Apache commons
>>> project (at http://commons.apache.org/fileupload/), but you have to
>>> install it separately.
>>> It would seem more natural to me if this module was an integral part of
>>> Tomcat, but I suppose there are reasons why this is not so.
>>
>> As of Servlert 3.0, this is part of the Servlet API.
>>
> My mistake. I was apparently using an outdated version of the servlet
> spec 3.0. In the one I found now, there is indeed a new section 3.2
> about it.
> In Tomcat 7 then ?
Already implemented.

> And what about maxPostSize then ? will it also apply ?
Limits are as defined by the spec.

Mark



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



Re: The purpose of maxPostSize

2010-05-02 Thread André Warnier

Mark Thomas wrote:

On 02/05/2010 14:39, André Warnier wrote:


There exists a "FileUpload" module for that in the Apache commons
project (at http://commons.apache.org/fileupload/), but you have to
install it separately.
It would seem more natural to me if this module was an integral part of
Tomcat, but I suppose there are reasons why this is not so.


As of Servlert 3.0, this is part of the Servlet API.

My mistake. I was apparently using an outdated version of the servlet 
spec 3.0. In the one I found now, there is indeed a new section 3.2 
about it.

In Tomcat 7 then ?
And what about maxPostSize then ? will it also apply ?

To the OP, I still recommend reading the User's Guide part of the 
on-line FileUpload documentation above, because it provides a good 
explanation and tips about multipart POSTs and file uploads.



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



Re: The purpose of maxPostSize

2010-05-02 Thread Mark Thomas
On 02/05/2010 14:39, André Warnier wrote:

> There exists a "FileUpload" module for that in the Apache commons
> project (at http://commons.apache.org/fileupload/), but you have to
> install it separately.
> It would seem more natural to me if this module was an integral part of
> Tomcat, but I suppose there are reasons why this is not so.

As of Servlert 3.0, this is part of the Servlet API.

Mark



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



Re: The purpose of maxPostSize

2010-05-02 Thread André Warnier

Mark Thomas wrote:

On 02/05/2010 12:54, Bytecode wrote:

Thanks for all the answers. But it still isn't clear to me what Tomcat guys are referring 
to by a "FORM URL." Looks like this term isn't defined anywhere else in the 
docs.


Read section 3.1.1 of the Servlet 3.0 specification.


..which does not really use the words "FORM URL" either.
The closest seems to be :
...
3. The content type is application/x-www-form-urlencoded.
...

Ok, so then (but this is HTTP stuff, not specific to Tomcat) :
- we are anyway talking about a POST request (servlet spec 3.1.1)
- a POST request always contains a body, and the "parameters" are sent 
in that body
- depending on the content-type of the POST request, this body content 
(and thus the parameters) can be presented in 1 of 2 formats :


  a) if the content-type is "application/x-www-form-urlencoded", then 
the content (parameters) will consist of one long string, of the form

"name1=value1&name2=value2[&nameN=valueN]"
and this string will be "url-encoded"
(This is the default when the html  tag does not have an "encType" 
attribute.)


  b) if the content-type is "multipart/form-data", then the content is 
constituted of multiple "parts", each part looking approximately like an 
RFC822 multi-part email part (each with its own header and body).  Each 
part represent one of the POST "parameters" (in effect, one  tag 
of the posted ).
(For this format to be used by the browser sending the POST, the  
tag must have a encType="multipart/form-data" attribute.)


I have always found it strange (but it is so in the servlet spec and in 
Tomcat) that the only POST format really described and processed by 
Tomcat itself, is the first one (a) above.
In other words, when using (b) (which is a more natural and solid one 
for file uploads), the application itself is responsible for reading and 
parsing the content body.

(*)

So, I guess that when the Tomcat documentation is using the term "FORM 
URL", it really means "a POST body with a content-type 
application/x-www-form-urlencoded".


(*)
There exists a "FileUpload" module for that in the Apache commons 
project (at http://commons.apache.org/fileupload/), but you have to 
install it separately.
It would seem more natural to me if this module was an integral part of 
Tomcat, but I suppose there are reasons why this is not so.





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



Re: The purpose of maxPostSize

2010-05-02 Thread Mark Thomas
On 02/05/2010 12:54, Bytecode wrote:
> Thanks for all the answers. But it still isn't clear to me what Tomcat guys 
> are referring to by a "FORM URL." Looks like this term isn't defined anywhere 
> else in the docs.

Read section 3.1.1 of the Servlet 3.0 specification.

Mark



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



Re: The purpose of maxPostSize

2010-05-02 Thread Mark Thomas
On 02/05/2010 12:42, André Warnier wrote:
> Mark Thomas wrote:
>> On 02/05/2010 09:57, Bytecode wrote:
>>> According to Tomcat docs, the purpose of maxPostSize is:
>>>
>>> The maximum size in bytes of the POST which will be handled by the
>>> container FORM URL parameter parsing. The limit can be disabled by
>>> setting this attribute to a value less than or equal to 0. If not
>>> specified, this attribute is set to 2097152 (2 megabytes).
>>>
>>> Now the question is what's meant by "the container FORM URL parameter
>>> parsing"? What's a FORM URL? What's the container's FORM URL
>>> parameter parsing? Also, what is a possible use case of this parameter?
>>
>> It limits the size of data that will be processed automatically by
>> Tomcat for a POST request where the content type is
>> application/x-www-form-urlencoded. See section 3.1.1 of the Servlet 3.0
>> spec.
>>
>> If the application parses the data then, regardless of content type, the
>> limit does not apply.
>>
> Does this mean that at the Tomcat container level, there is no way to
> avoid Tomcat accepting a POST of more than a certain size ?

Yes this can be avoided. If Tomcat is processing the POST as per 3.1.1
of the Servlet 3.0 spec, then the limit is set by maxPostSize.

If an application is processing the POST then the application controls
how many bytes will be read. If the applciation is written so it reads
an unlimited number of bytes then that is the application's problem.

> While apparently not mandated by the Servlet Spec, this /could/ be
> regarded as a weakness, no ?

There is no weakness here.

Mark



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



Re: The purpose of maxPostSize

2010-05-02 Thread Bytecode
Thanks for all the answers. But it still isn't clear to me what Tomcat guys are 
referring to by a "FORM URL." Looks like this term isn't defined anywhere else 
in the docs.

On 02/05/2010, at 9:42 PM, André Warnier wrote:

> Mark Thomas wrote:
>> On 02/05/2010 09:57, Bytecode wrote:
>>> According to Tomcat docs, the purpose of maxPostSize is:
>>> 
>>> The maximum size in bytes of the POST which will be handled by the 
>>> container FORM URL parameter parsing. The limit can be disabled by setting 
>>> this attribute to a value less than or equal to 0. If not specified, this 
>>> attribute is set to 2097152 (2 megabytes).
>>> 
>>> Now the question is what's meant by "the container FORM URL parameter 
>>> parsing"? What's a FORM URL? What's the container's FORM URL parameter 
>>> parsing? Also, what is a possible use case of this parameter?
>> It limits the size of data that will be processed automatically by
>> Tomcat for a POST request where the content type is
>> application/x-www-form-urlencoded. See section 3.1.1 of the Servlet 3.0
>> spec.
>> If the application parses the data then, regardless of content type, the
>> limit does not apply.
> Does this mean that at the Tomcat container level, there is no way to avoid 
> Tomcat accepting a POST of more than a certain size ?
> While apparently not mandated by the Servlet Spec, this /could/ be regarded 
> as a weakness, no ?
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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



Re: The purpose of maxPostSize

2010-05-02 Thread André Warnier

Mark Thomas wrote:

On 02/05/2010 09:57, Bytecode wrote:

According to Tomcat docs, the purpose of maxPostSize is:

The maximum size in bytes of the POST which will be handled by the container 
FORM URL parameter parsing. The limit can be disabled by setting this attribute 
to a value less than or equal to 0. If not specified, this attribute is set to 
2097152 (2 megabytes).

Now the question is what's meant by "the container FORM URL parameter parsing"? 
What's a FORM URL? What's the container's FORM URL parameter parsing? Also, what is a 
possible use case of this parameter?


It limits the size of data that will be processed automatically by
Tomcat for a POST request where the content type is
application/x-www-form-urlencoded. See section 3.1.1 of the Servlet 3.0
spec.

If the application parses the data then, regardless of content type, the
limit does not apply.

Does this mean that at the Tomcat container level, there is no way to 
avoid Tomcat accepting a POST of more than a certain size ?
While apparently not mandated by the Servlet Spec, this /could/ be 
regarded as a weakness, no ?



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



Re: The purpose of maxPostSize

2010-05-02 Thread Mark Thomas
On 02/05/2010 09:57, Bytecode wrote:
> According to Tomcat docs, the purpose of maxPostSize is:
> 
> The maximum size in bytes of the POST which will be handled by the container 
> FORM URL parameter parsing. The limit can be disabled by setting this 
> attribute to a value less than or equal to 0. If not specified, this 
> attribute is set to 2097152 (2 megabytes).
> 
> Now the question is what's meant by "the container FORM URL parameter 
> parsing"? What's a FORM URL? What's the container's FORM URL parameter 
> parsing? Also, what is a possible use case of this parameter?

It limits the size of data that will be processed automatically by
Tomcat for a POST request where the content type is
application/x-www-form-urlencoded. See section 3.1.1 of the Servlet 3.0
spec.

If the application parses the data then, regardless of content type, the
limit does not apply.

Mark



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



Re: The purpose of maxPostSize

2010-05-02 Thread Bytecode
Thanks for the response. It now makes sense, but I still don't understand why 
this is being referred to as a "FORM URL" or "the container's FORM URL".

Thanks in advance,
Bytecode

On 02/05/2010, at 8:48 PM, André Warnier wrote:

> Bytecode wrote:
>> According to Tomcat docs, the purpose of maxPostSize is:
>> The maximum size in bytes of the POST which will be handled by the container 
>> FORM URL parameter parsing. The limit can be disabled by setting this 
>> attribute to a value less than or equal to 0. If not specified, this 
>> attribute is set to 2097152 (2 megabytes).
>> Now the question is what's meant by "the container FORM URL parameter 
>> parsing"? What's a FORM URL? What's the container's FORM URL parameter 
>> parsing? Also, what is a possible use case of this parameter?
> As a ganeral explanation : at the base the "maximum post size" setting 
> (available in Tomcat but also in Apache httpd and probably most webservers), 
> is a security measure.
> It is there to avoid the possibility for some miscreant to overwhelm your 
> server by sending it a POST request with a body of, for example, 10 Gigabyte, 
> through a slow connection.
> In the absence of such a limit, this would force the server to dedicate a 
> process to just sit there reading the content of the POST, possibly for 
> hours.  It would also tie up a number of resources at the server side (to 
> store the POST content), and maybe cause difficulties when the POST is 
> finally terminated and the body has to be parsed etc..
> In other words, at best this might cause a denial-of-service, and at worst 
> crash your server with for example an out-of-memory condition.
> The setting is thus available so that you, the application developer, can 
> determine which is the maximum likely valid size of a POST to your server or 
> application, and reject POSTs above this limit.
> The webserver will then still accept POST requests, but as it is reading the 
> POST body, it will count the bytes, and as soon as this limit is reached, it 
> will interrupt this request and reject it with an error.
> 
> As to the "FORM URL parameter parsing" expression : to my knowledge, this 
> does not really correspond to any formal HTTP RFC or Servlet Spec 
> well-defined expression.  It is probably just an expression chosen by the 
> writer of the documentation you refer to, to convey the general idea that the 
> webserver, when it processes a POST request, at some point has to parse the 
> body of the request to extract the various request parameter names and 
> contents.
> And, before it can start doing that, it must have the entire POST body 
> available, which means the entire POST body has been read and saved 
> somewhere.  Which rejoins the explanation above.
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 


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



Re: The purpose of maxPostSize

2010-05-02 Thread André Warnier

Bytecode wrote:

According to Tomcat docs, the purpose of maxPostSize is:

The maximum size in bytes of the POST which will be handled by the container 
FORM URL parameter parsing. The limit can be disabled by setting this attribute 
to a value less than or equal to 0. If not specified, this attribute is set to 
2097152 (2 megabytes).

Now the question is what's meant by "the container FORM URL parameter parsing"? 
What's a FORM URL? What's the container's FORM URL parameter parsing? Also, what is a 
possible use case of this parameter?

As a ganeral explanation : at the base the "maximum post size" setting 
(available in Tomcat but also in Apache httpd and probably most 
webservers), is a security measure.
It is there to avoid the possibility for some miscreant to overwhelm 
your server by sending it a POST request with a body of, for example, 10 
Gigabyte, through a slow connection.
In the absence of such a limit, this would force the server to dedicate 
a process to just sit there reading the content of the POST, possibly 
for hours.  It would also tie up a number of resources at the server 
side (to store the POST content), and maybe cause difficulties when the 
POST is finally terminated and the body has to be parsed etc..
In other words, at best this might cause a denial-of-service, and at 
worst crash your server with for example an out-of-memory condition.
The setting is thus available so that you, the application developer, 
can determine which is the maximum likely valid size of a POST to your 
server or application, and reject POSTs above this limit.
The webserver will then still accept POST requests, but as it is reading 
the POST body, it will count the bytes, and as soon as this limit is 
reached, it will interrupt this request and reject it with an error.


As to the "FORM URL parameter parsing" expression : to my knowledge, 
this does not really correspond to any formal HTTP RFC or Servlet Spec 
well-defined expression.  It is probably just an expression chosen by 
the writer of the documentation you refer to, to convey the general idea 
that the webserver, when it processes a POST request, at some point has 
to parse the body of the request to extract the various request 
parameter names and contents.
And, before it can start doing that, it must have the entire POST body 
available, which means the entire POST body has been read and saved 
somewhere.  Which rejoins the explanation above.





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



Re: Tomcat Connector to Apache 2.2

2010-05-02 Thread André Warnier

Jie Sheng Chua wrote:

Hi,

I operating Ubuntu 10.04 with Tomcat 6.0.24 on OpenJDK 6b18-1.8.
I trying to configure tomcat connector to allow (for now) all request to be
pass from Apache 2.2 to Tomcat 6.
I downloaded 
mod_jk-1.2.28-httpd-2.2.X.so
.
With the help of the quick start
guide,
i manage to configure my workers.properties, httpd.conf and tomcat
server.xml as follows.

After the below configuration, the connector didn't work. There are no error
display on the logs too.


Can you define "didn't work" ?



Example context from tomcat is the tomcat supplied examples.

Does anyone know how to make this work out?

Thanks and Best Regards
Jie Sheng

*workers.properties*
*
*
*
# Define 1 real worker using ajp13
worker.list=tomcat1

# Set properties for worker1 (ajp13)
worker.tomcat1.type=ajp13
worker.tomcat1.host=localhost
worker.tomcat1.port=8009
*



Looks fine.



*httpd.conf*

# Load mod_jk module
# Update this path to match your modules location
LoadModulejk_module  /usr/lib/apache2/modules/mod_jk.so



Looks fine, if the module is there.  But otherwise I guess Apache would 
not start.




# Declare the module for  (remove this line on Apache
2.x)
# AddModule mod_jk.c

# Where to find workers.properties
# Update this path to match your conf directory location (put
workers.properties next to httpd.conf)
JkWorkersFile /etc/apache2/workers.properties

# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/apache2/mod_jk.shm

# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log
next to access_log)
JkLogFile /var/log/apache2/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevelinfo

# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# Send everything for context /examples to worker named worker1 (ajp13)
JkMount  /examples/* tomcat1



Note that the above will ONLY forward to the connector and Tomcat, 
requests for URLs which match the above pattern, like

/examples/something.html
It will not forward the URL
/examples
For that, you would need a second JkMount
JkMount  /examples  tomcat1

Also see note (1) below.


*tomcat server.xml*
*
*
*


  
  
  
  
  


I believe your problem is here :


  



Remove the above and try again.

I believe that you tried to mix two different techniques :
- trying to use the "Tomcat auto-configure" feature of mod_jk
and
- configuring mod_jk yourself

I think that the two do not play well together.
And anyway :
- I am not sure that the auto-configure feature still works
- the documentation also says that it is specific to Tomcat 5.x



  

  

  









The above is OK, leave it.




  
  
  

  


*




Note (1) :
As an alternative to the JkMount/JkUnMount directives, there also exists 
the following (in the Apache httpd.conf) :



  SetHandler jakarta-servlet
  ...



(You can also use  instead of )

This is described here :
http://tomcat.apache.org/connectors-doc/reference/apache.html
, at the very end of the page, in the section "Using SetHandler and 
Environment Variables".
Using this or the JkMount/JkUnMount syntax is a question of personal 
preference. I prefer this second form, because I find that it matches 
the general Apache configuration style better.  It also makes it easier 
to add additional Apache directives to be applied to the URLs which you 
forward to Tomcat.




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



Re: Tomcat Connector to Apache 2.2

2010-05-02 Thread Juha Laiho

Please clarify "does not work":
- after running the servers with the described configuration,
  what did you attempt to access?
- what was the response on the browser?
-- if using IE, do disable the "Show friendly HTTP error messages" in
   Internet Options/Advanced to see real server error messages
- what was logged of the access
-- in Apache httpd access_log, error_log?
-- in Tomcat logs?
-- in mod_jk log?

--
..Juha

On 1.5.2010 19:06, Jie Sheng Chua wrote:

Hi,

I operating Ubuntu 10.04 with Tomcat 6.0.24 on OpenJDK 6b18-1.8.
I trying to configure tomcat connector to allow (for now) all request to be
pass from Apache 2.2 to Tomcat 6.
I downloaded 
mod_jk-1.2.28-httpd-2.2.X.so
.
With the help of the quick start
guide,
i manage to configure my workers.properties, httpd.conf and tomcat
server.xml as follows.

After the below configuration, the connector didn't work. There are no error
display on the logs too.
Example context from tomcat is the tomcat supplied examples.

Does anyone know how to make this work out?

Thanks and Best Regards
Jie Sheng

*workers.properties*
*
*
*
# Define 1 real worker using ajp13
worker.list=tomcat1

# Set properties for worker1 (ajp13)
worker.tomcat1.type=ajp13
worker.tomcat1.host=localhost
worker.tomcat1.port=8009
*

*httpd.conf*

# Load mod_jk module
# Update this path to match your modules location
LoadModulejk_module  /usr/lib/apache2/modules/mod_jk.so

# Declare the module for  (remove this line on Apache
2.x)
# AddModule mod_jk.c

# Where to find workers.properties
# Update this path to match your conf directory location (put
workers.properties next to httpd.conf)
JkWorkersFile /etc/apache2/workers.properties

# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/apache2/mod_jk.shm

# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log
next to access_log)
JkLogFile /var/log/apache2/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevelinfo

# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# Send everything for context /examples to worker named worker1 (ajp13)
JkMount  /examples/* tomcat1

*tomcat server.xml*
*
*
*


   
   
   
   
   
   

   
 
   

   
 
 
 
 
   
   
   
 
   


*




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



The purpose of maxPostSize

2010-05-02 Thread Bytecode
According to Tomcat docs, the purpose of maxPostSize is:

The maximum size in bytes of the POST which will be handled by the container 
FORM URL parameter parsing. The limit can be disabled by setting this attribute 
to a value less than or equal to 0. If not specified, this attribute is set to 
2097152 (2 megabytes).

Now the question is what's meant by "the container FORM URL parameter parsing"? 
What's a FORM URL? What's the container's FORM URL parameter parsing? Also, 
what is a possible use case of this parameter?

Thanks in advance,
Bytecode