SSI Servlet Character Encoding Problem

2005-09-14 Thread KEREM ERKAN
Hi people,
 
I use Tomcat 5.5.9 with Apache 2.0.54 and jk 1.2.10 to serve my websites. I
want to set custom error pages to be served when an error like 404, 500 etc.
occurs. The website uses the iso-8859-9 character set on every page, and the
error pages are encoded with iso-8859-9 too.
 
Only *.jsp pages and servlets are mapped to Tomcat through jk. All other
static content is served by Apache.
 
My error pages are all Server Side Include shtml files. These error files
include some jsp files with:
 
!--#include virtual=file-name --
 
I have set up SSI (correctly I hope) on both Apache and Tomcat, and also set
up custom error file handling on both httpd.conf and the default web.xml for
the site I want to customize.
 
On my server.xml file, my site is configured like this:
 
Host name= http://www.foo.com www.foo.com appBase=/usr/www/foo
  Context path= docBase=/
  Context path=/servlet docBase=servlet/
/Host
 
On my default web.xml for tomcat configuration, SSI servlet has these
directives added:
 
init-param
  param-nameinputEncoding/param-name
  param-valueiso-8859-9/param-value
/init-param
init-param
  param-nameoutputEncoding/param-name
  param-valueiso-8859-9/param-value
/init-param
 
When I go to some nonexistent foo.html on my website, Apache handles the
customized error page and everything works fine. On the other hand I have
two problems:
 
One is, if the isVirtualWebappRelative variable in web.xml is set to 0,
and I go to a nonexistent foo.jsp on my server, jk sends the request to
Tomcat and when Tomcat tries to handle the customized error page, it cannot
find the included files in SSI and an error is written in the Tomcat error
log like:
 
SEVERE: ssi: #include--Couldn't include file: /include/footer.jsp
java.io.IOException: Couldn't get context for path: /include/footer.jsp

The /include folder is in the server root. I think it should be able to find
these pages, as it looks at the server root because of the state of
isVirtualWebappRelative variable, am I wrong?
 
When I set isVirtualWebappRelative to 1, this problem is solved only for
server root, my servlets (say /servlet) still cannot get the customized page
includes, because this time the SSI includes become web app relative and I
have to copy the /include folder into /servlet/include directory to work
around this problem.
 
My second problem is, when I go to this nonexistent foo.jsp with
isVirtualWebappRelative set to 1, and when Tomcat tries to handle the
error page, the encoding is always UTF-8 regardless of inputEncoding or
outputEncoding variables. So my error page becomes full of garbled
characters because the encoding should be iso-8859-9.
 
Is there any suggestions about these problems?
 
Best regards,
 
Kerem


RE: How to serve just JSP (was: Re: JSP on RHEL4 with Apache http d RPM?

2005-09-14 Thread KEREM ERKAN
 
 Unfortunately I have to keep the main port 80 httpd, as it's 
 serving 20Gb of other material (the entire campus web site).
 
 All I need is the trick to make Apache httpd hand off any 
 .jsp files to Tomcat.
 
As I am newly subscribed to this list, I don't know if you have got a
satisfactory answer for your question, but if you don't; I have the same
configuration like yours, static files are served by Apache and *.jsp files
are served by Tomcat.

All you have to do is to use Java Connector to mount jsp files to Tomcat.
You can find the necessary documentation in Connectors part of Tomcat
documentation. If you can't get out of it, I can help you set it up off or
on list.

Cheers,

Kerem


RE: mod_jk performance

2005-09-14 Thread KEREM ERKAN
Well I tried both, and as my websites do not have a very high traffic (I
have approximately a total of 50 GB per month) the speed is not primarily a
concern to me, I am looking to the security side of the problem and
Apache+mod_jk does its job better than only Tomcat concerning security.

I have stress tested Apache+Tomcat and only Tomcat and it seems like %30 is
too high. I can suggest using mod_jk 1.2.10 with Tomcat 5.5.9, surprisingly
you get very similar results. Mod_jk  1.2.10 had some performance problems
but I did not thoroughly test why.

I hope this may help a little.

Cheers,

Kerem

 -Original Message-
 From: marc ratun [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 14, 2005 2:47 PM
 To: tomcat-user@jakarta.apache.org
 Subject: mod_jk performance
 
 Hi,
 
 I just read an article about webapp benchmarks [1] and they 
 mentioned that
 apache+mod_jk+tomcat is about 30% slower than pure tomcat.
 
 This is sad. Until now I believed that the performance 
 decrease with apache/mod_jk would be marginal.
 
 Putting apache/mod_jk before tomcat is very nice. I don't 
 want to miss it because it is a good way to integrate other modules.
 
 Is there any way to speed up apache/tomcat cooperation?
 
 
 Marc
 
 [1] (german only) http://www.heise.de/ix/artikel/2005/10/124/
 
 _
 FREE pop-up blocking with the new MSN Toolbar - get it now! 
 http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


RE: mod_jk performance

2005-09-14 Thread KEREM ERKAN
AFAIK mod_proxy performs worse than mod_jk.

Just my 2 cents.

Kerem 

 -Original Message-
 From: Bruno Georges [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 14, 2005 2:58 PM
 To: Tomcat Users List
 Cc: tomcat-user@jakarta.apache.org
 Subject: Re: mod_jk performance
 
 Marc
 
 If the performance of your app is not acceptable using mod_jk 
 , you could try other alternatives and still keep apache in 
 front to serve static content and use other modules.
 You can use apache mod_proxy to forward request on 8080 [or 
 whatever your run tomcat on] to tomcat without going through 
 mod_jk There are pros and cons to take this approach, but it 
 may suffice in your case.
 
 Hope it helps.
 
 Bruno Georges
 
 Glencore International AG
 Tel. +41 41 709 3204
 Fax +41 41 709 3000
 
 
   
   
  
   marc ratun
   
  
   [EMAIL PROTECTED] To:  
 tomcat-user@jakarta.apache.org

   ail.com cc:
   
  
Subject: 
 mod_jk performance

   14.09.05 13:46  
   
  
   Please respond   Distribute:
   
  
   to Tomcat Users Personal?  
  |---|
  
   List   
  | [ ] x |
  
   
  |---|
  
   
   
  
   
   
  
 
 
 
 
 Hi,
 
 I just read an article about webapp benchmarks [1] and they 
 mentioned that
 apache+mod_jk+tomcat is about 30% slower than pure tomcat.
 
 This is sad. Until now I believed that the performance 
 decrease with apache/mod_jk would be marginal.
 
 Putting apache/mod_jk before tomcat is very nice. I don't 
 want to miss it because it is a good way to integrate other modules.
 
 Is there any way to speed up apache/tomcat cooperation?
 
 
 Marc
 
 [1] (german only) http://www.heise.de/ix/artikel/2005/10/124/
 
 _
 FREE pop-up blocking with the new MSN Toolbar - get it now!
 http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 LEGAL DISCLAIMER. The contents of this e-mail and any 
 attachments are strictly confidential and they may not be 
 used or disclosed by someone who is not a named recipient.
 If you have received this email in error please notify the 
 sender by replying to this email inserting the word 
 misdirected as the message and delete this e-mail from your system.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


RE: mod_jk performance

2005-09-14 Thread KEREM ERKAN
Apache has better directory/file restricting and handling than Tomcat, it is
more customizable and it is much user/admin friendly to configure :-) (at
least for me)

I configure all security related stuff on Apache and have my Tomcat listen
only on AJP connector with 127.0.0.1:8009.

Tomcat is harder to configure and -sadly- it has a far worse documentation
than Apache (for now).

Best regards,

Kerem

 -Original Message-
 From: Hassan Schroeder [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 14, 2005 3:13 PM
 To: Tomcat Users List
 Subject: Re: mod_jk performance
 
 KEREM ERKAN wrote:
 
  ... I am looking to the security side of the problem and
  Apache+mod_jk does its job better than only Tomcat 
 concerning security.
 
 How so?
 
 --
 Hassan Schroeder - [EMAIL PROTECTED]
 Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com
 
dream.  code.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


RE: How to serve just JSP (was: Re: JSP on RHEL4 with Apache http d RPM?

2005-09-14 Thread KEREM ERKAN
 

 -Original Message-
 From: Peter Flynn [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 14, 2005 2:40 PM
 To: Tomcat Users List
 Subject: RE: How to serve just JSP (was: Re: JSP on RHEL4 
 with Apache http d RPM?
 
 On Wed, 2005-09-14 at 12:19, KEREM ERKAN wrote:
   
   Unfortunately I have to keep the main port 80 httpd, as 
 it's serving 
   20Gb of other material (the entire campus web site).
   
   All I need is the trick to make Apache httpd hand off any 
 .jsp files 
   to Tomcat.
   
  As I am newly subscribed to this list, I don't know if you 
 have got a 
  satisfactory answer for your question, but if you don't; I have the 
  same configuration like yours, static files are served by 
 Apache and 
  *.jsp files are served by Tomcat.
 
 That's exactly what I want.

OK, start with downloading and installing a binary version of Tomcat for
your OS and also download the 1.2.10 version of mod_jk. I think we should
handle the rest off list not to bother the list anymore.



RE: mod_jk performance

2005-09-14 Thread KEREM ERKAN
 

 -Original Message-
 From: Hassan Schroeder [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 14, 2005 3:30 PM
 To: Tomcat Users List
 Subject: Re: mod_jk performance
 
 KEREM ERKAN wrote:
  Apache has better directory/file restricting and handling 
 than Tomcat
 
 better in what way? What actual *security* issue are we 
 talking about -- in other words, what exploit is Tomcat 
 susceptible to that Apache is not?
 
I am not aware of any critical exploits Apache or Tomcat have. As I said, I
only think about restricting access to some of my server files. You may be
able to do this with Tomcat but from my point of view, it is harder to
configure. That's all.

Cheers,

Kerem


smime.p7s
Description: S/MIME cryptographic signature


RE: mod_jk performance

2005-09-14 Thread KEREM ERKAN
Well, mod_jk  1.2.10 seems slower than 1.2.10 when stress tested. The tests
completed in more time. I do not have the actual test results, because we
have been using 1.2.10 for several months, maybe I can send them when I test
1.2.14.

By the way mod_jk site mentions 1.2.13 as its testing version. Is there a
1.2.14 really or did you write 14 by mistake?

Cheers,

Kerem

 -Original Message-
 From: Lionel Farbos [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 14, 2005 3:51 PM
 To: Tomcat Users List
 Cc: KEREM ERKAN
 Subject: Re: mod_jk performance
 
 On Wed, 14 Sep 2005 14:55:08 +0300
 KEREM ERKAN [EMAIL PROTECTED] wrote:
 
   Mod_jk  1.2.10 had some performance problems but I did not 
  thoroughly test why.
 
 Is is proved ? Where do you find this ?
 I tested mod_jk 1.2.14 (but not stressed it) and it seems to 
 be a good version...
 What sort of performance problems do you mention ?
 


RE: mod_jk performance

2005-09-14 Thread KEREM ERKAN

  Well, mod_jk  1.2.10 seems slower than 1.2.10 when stress 
 tested. The 
  tests completed in more time. I do not have the actual test 
 results, 
  because we have been using 1.2.10 for several months, maybe 
 I can send 
  them when I test 1.2.14.
  
 I'm interested in such tests (or a link if it exists).

You can try Microsoft's Web Stress Tool which is free but it is old. I am
also actually searching for a better stress tool.

http://www.microsoft.com/downloads/details.aspx?FamilyID=E2C0585A-062A-439E-
A67D-75A89AA36495displaylang=en

 
  By the way mod_jk site mentions 1.2.13 as its testing version. Is 
  there a
  1.2.14 really or did you write 14 by mistake?
  
 I wanted to say mod_jk 1.2.14 : it's not a mistake...
 but I don't understand what this meens ...?!?

It seems there is a confusion in mod_jk's own site :-) I will download and
compile 1.2.14 in a spare time and see how it performs.

Cheers,

Kerem


smime.p7s
Description: S/MIME cryptographic signature


RE: mod_jk performance

2005-09-14 Thread KEREM ERKAN
 

 -Original Message-
 From: Lionel Farbos [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 14, 2005 5:49 PM
 To: Tomcat Users List
 Cc: KEREM ERKAN
 Subject: Re: mod_jk performance
 
 On Wed, 14 Sep 2005 17:27:29 +0300
 KEREM ERKAN [EMAIL PROTECTED] wrote:
 
  
Well, mod_jk  1.2.10 seems slower than 1.2.10 when stress
   tested. The
tests completed in more time. I do not have the actual test
   results,
because we have been using 1.2.10 for several months, maybe
   I can send
them when I test 1.2.14.

   I'm interested in such tests (or a link if it exists).
  
  You can try Microsoft's Web Stress Tool which is free but 
 it is old. I 
  am also actually searching for a better stress tool.
  
  
 http://www.microsoft.com/downloads/details.aspx?FamilyID=E2C0585A-062A
  -439E-
  A67D-75A89AA36495displaylang=en
 
 I don't search a Stress Tool; I say I'm interest in the 
 result of the stress.

Well as I said, I do not have the results for now, but when I test 1.2.14, I
will surely share the results with the list.

Cheers,

Kerem


smime.p7s
Description: S/MIME cryptographic signature


RE: mod_jk performance

2005-09-15 Thread KEREM ERKAN
 -Original Message-
 From: Mark Thomas [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 14, 2005 8:53 PM
 To: Tomcat Users List
 Subject: Re: mod_jk performance
 
 KEREM ERKAN wrote:
  Tomcat is harder to configure and -sadly- it has a far worse 
  documentation than Apache (for now).
 
 I look forward to seeing your documentation patches in Bugzilla ;)
 
 Mark
 
I would really love to. As soon as I get more experience on Tomcat (I work
with Tomcat for approx. 6-7 months), I will try to contribute a little. ;)

Don't get me wrong, but Tomcat documentation is not very explanatory and
does not have many examples for a newbie to get his hands on Tomcat easily.

Cheers,

Kerem


RE: Remote Address Valve Lets Everything Through

2005-09-20 Thread KEREM ERKAN
Hi Mark,

Is it possible that you may have mistyped allow=xxx.xxx.xxx.xxx as
allow=xxx.xxx.xxx.xxx  in your configuration? If you did not accidentally
delete the () from the right hand side of allow when sending to the list,
that may be your problem.

 -Original Message-
 From: Mark Leone [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, September 20, 2005 6:58 AM
 To: Tomcat Users List
 Subject: Re: Remote Address Valve Lets Everything Through
 
 The asterisks in the valve below are an artifact of the way I 
 did my cut and paste. The actual valve appears as follows in 
 server.xml
 
 valve className=org.apache.catalina.valves.RemoteAddrValve 
 allow=xxx..xxx.xxx.xxx/ // actual IP address not shown
 
 -Mark
 


RE: Create Valve and Deploy How to Help Please ????

2005-09-21 Thread KEREM ERKAN
BARBARA,

FOR GOD'S SAKE, DO NOT REPLY ALL THESE MAILS AND SEND A BLANK E-MAIL TO

[EMAIL PROTECTED]

TO BE REMOVED FROM THIS REPLY LIST!

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 21, 2005 2:36 PM
 To: tomcat-user@jakarta.apache.org
 Subject: RE: Create Valve and Deploy How to Help Please 
 Importance: High
 
 Please remove me from this reply list.
 
 -Original Message-
 From: Bovy, Stephen J [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 20, 2005 11:06 PM
 To: Tomcat Users List
 Subject: RE: Create Valve and Deploy How to Help Please 
 
 
  
 I have created a new Valve in the authenticator package called
 ThreadSignOn
 
 I added a descritpion for it to the mbean description xml file.
 
 I re-built and verified that my new valve and the new 
 description is in
 catalina.jar
 
 But When I refference my new valve nothing happens it does not work 
 
 What else do I need to do ?
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


smime.p7s
Description: S/MIME cryptographic signature


RE: Default Charset in Content-Type Header

2005-09-22 Thread KEREM ERKAN
You may add the charset of your choice (probably Turkish) to your jsp by
adding

%@ page contentType=text/html; charset=iso-8859-9 %

To the beginning of your jsp page. If you do not add this, Tomcat will
always default to ISO-8859-1 or UTF-8 (I don't remember which one was
default).

Regards,

Kerem


 -Original Message-
 From: Alpay Ozturk [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, September 22, 2005 12:37 PM
 To: Tomcat Users List
 Subject: Default Charset in Content-Type Header
 
 Hi,
 
 I am using Tomcat 4.1.29 in a production environment and I 
 want   tomcat
 not to add default charset in Content-Type response header.
 Is it possible?
 
 Thanks in advance.
 
 Alpay 
 


smime.p7s
Description: S/MIME cryptographic signature


RE: starting Tomcat service

2005-09-23 Thread KEREM ERKAN
You may write a shell script which includes a java program to test oracle
connectivity and if it can connect, it can be used to start Tomcat. If it
fails, it may say Oracle down, I am not starting Tomcat.

Cheers,

Kerem

 -Original Message-
 From: Tuan Quan [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, September 22, 2005 10:48 PM
 To: tomcat-user@jakarta.apache.org
 Subject: starting Tomcat service
 
 In windows, one of my webapp needs to connect to a database 
 in order to work correctly.
 How can I check  for oracle database ready before starting 
 Tomcat service?
 Set 'DependOnService' parameter in registry to point to 
 Oracle db service, may work, but what if the database is on a 
 different PC?
  
 thanks
  
 
   
 -
 Yahoo! for Good
  Click here to donate to the Hurricane Katrina relief effort. 
 


smime.p7s
Description: S/MIME cryptographic signature


RE: How to start Tomcat using differnt JRE

2005-09-23 Thread KEREM ERKAN
Add this to the beginning of your catalina.sh script in /bin directory of
Tomcat.

export JAVA_HOME=/path/to/jdk1.5

That way it will start with the JDK of your choice.

Regards,

Kerem

 -Original Message-
 From: lanna august [mailto:[EMAIL PROTECTED] 
 Sent: Friday, September 23, 2005 8:16 AM
 To: tomcat-user@jakarta.apache.org
 Subject: How to start Tomcat using differnt JRE
 
 Hi sorry for sending this twice, but I am using new email 
 program and it kinda flipped out when I first sent it, was 
 not sure it went through the first time.
 
 Hello 
 
 I have searched far and wide but no luck so thought i try here.
 
 I have a Red Hat ES V4 Linux Server that has 3 different 
 versions of JDK and JRE on it.  They each are being used for 
 different projects.  One of the versions is 1.5 JDK and JRE.  
 I need to install now Tomcat 5.5.9 on the server and I must 
 have it use the
 1.5 JRE when it starts up.  Unfortunatly the systems global 
 JDK and JRE are set to the 1.3 Version of Java and this I 
 cannot change it must remain.
 
 I thought awhile ago I came across mention of how to start up 
 the Tomcat server and tell it what JRE to be using.  But I 
 don't remember exactly.
 
 Can anyone help?
 
 I tried making a Tomcat user and placing the Tomcat server in 
 this Tomcat users directory.  Then setting the JAVA_HOME in 
 this Tomcat users .bash_profile  to point to the 1.5 
 directory.  I then log into the Tomcat user and run the 
 command java -version.  I get back 1.3.
 
 I thought there was a place in one of the config files to 
 point it at what the JAVA_HOME or JRE_HOME was?
 
 or some kind of command I type at startup on the linux box?
 
 any help much appreciated.
 
 
 
 
   
 __
 Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


smime.p7s
Description: S/MIME cryptographic signature


RE: db-connectin is working fine, but is it pooling?

2005-09-23 Thread KEREM ERKAN
Write a test connection page and stress test it with a lot of virtual
clients. That way, you will have more than 1 connection opened to ypur pool.


 -Original Message-
 From: Trond Hersløv [mailto:[EMAIL PROTECTED] 
 Sent: Friday, September 23, 2005 3:24 AM
 To: Tomcat Users List
 Subject: RE: db-connectin is working fine, but is it pooling?
 
 Thanks, I'll do that, but still - how can I be sure that my 
 pool have more than just this one connection. Writing two 
 servlets with endless loops, avoiding checking the 
 connections back would give me the answer I guess.
 But why is there only one connection established to my DB server??
 
 Is there a way to configure the pool to pre generate eg. 10 
 connections?
 
 \trond
 
 
 -Original Message-
 From: Kyle [mailto:[EMAIL PROTECTED]
 Sent: 23. september 2005 02:14
 To: Tomcat Users List
 Subject: Re: db-connectin is working fine, but is it pooling?
 
 Print out your Connection Object .toString() to stdout or on 
 a page and you should see that it is a Pool(ed|able) 
 Connection object.
 
 K
 
 Trond Hersløv wrote:
 
 Everything works just fine, but I'm a little bit concerned 
 that maybe I am generating a singel connection to the DB and 
 not a pool of connections.
 As I run  netstat -a on the machine hosting the DB, I 
 expected to find 
 a lot of connections to port 3306, which my MySQL server 
 listens to, but there is only one single connection. Even 
 when I press F5 for a long time to refresh my IE window like 
 a 100 times or with more windows open at the same time there 
 is just this one connection to be found.
   
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 **
 This email message has been swept by
 MIMEsweeper for the presence of computer viruses.
 **
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


smime.p7s
Description: S/MIME cryptographic signature


RE: How to start Tomcat with JDK 1.4 compatibility pack on JDK 5. 0?

2005-09-23 Thread KEREM ERKAN
You could try what you suggested before and send your comments about it to
us ;-)

Or you could do this:

Write a shell script that changes the names of compatibility jars to
something with an extension different from *.jar

Then you could start Tomcat from the same script and rename the jar files
back to their original names.

That will absolutely work :-)

Cheers,

Kerem 

 -Original Message-
 From: Stagger Lee [mailto:[EMAIL PROTECTED] 
 Sent: Friday, September 23, 2005 1:28 PM
 To: Tomcat Users List
 Subject: Re: How to start Tomcat with JDK 1.4 compatibility 
 pack on JDK 5.0?
 
 Come on guys, don't tell me no one had to solve this yet. Anyone?
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


smime.p7s
Description: S/MIME cryptographic signature