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

2005-09-16 Thread Peter Flynn
On Wed, 2005-09-14 at 13:22, KEREM ERKAN wrote:
 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.

Yes, that's lot's already installed and has been running 
fine. 

///Peter



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat directory protection (was: Re: mod_jk performance

2005-09-16 Thread Peter Flynn
On Wed, 2005-09-14 at 13:29, Hassan Schroeder wrote:
 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 don't know if Kerem Erkan was talking about exploits, but I have 
looked for some facility in Tomcat equivalent to Apache .htaccess
files and failed to find any mention of them. Is it possible to do
this kind of IP-level or simple username/password restriction in
Tomcat?

///Peter



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk performance

2005-09-16 Thread Peter Flynn
On Wed, 2005-09-14 at 13:50, Andrew Miehs wrote:
 We did some comparisons between running Tomcat 5.0 standalone, or TC  
 5.0 and Apache 2.0
 
 If you are ONLY delivering JSPs, we found that we could only deal  
 with 50% of the requests when running combined Apache TC and mod_jk

OK, that's useful information. 

But I have 300,000+ static HTML files to server, and about
10 JSP files. I'm surely not switching my entire server to 
Tomcat...:-)

///Peter



-
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 httpd RPM?

2005-09-16 Thread Peter Flynn
On Wed, 2005-09-14 at 14:04, Michael Lai wrote:
 KEREM ERKAN wrote:
 
 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.
 
 
 Just to give you another option if you like.  I don't even use mod_jd.  
 I make use of Apache's reverse proxy feature.  In my httpd.conf, I add 
 the following lines in my virtual host:

[snip]

That's extremely useful, thanks.

But I don't want to serve a single whole directory Tomcat,
I need to server about a dozen isolated JSP files.

Can ProxyPass hand off *.jsp to Tomcat rather than a whole 
directory?

///Peter



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk performance

2005-09-16 Thread Peter Flynn
On Wed, 2005-09-14 at 18:52, Mark Thomas wrote:
 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 ;)

I will certainly document how to fix my problem once it's fixed, but 
anything I have ever sent to Bugzilla either gets ignored or argued 
about ad infinitum and nothing ever done, so any doc I write will go 
on my blog or my web site (from where anyone is free to take/copy it).

///Peter


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to serve just JSP (was: Re: JSP on RHEL4 with Apache httpd RPM?

2005-09-14 Thread Peter Flynn
[Sorry for the repost but I still don't have an answer to this one]

On Fri, 2005-09-09 at 15:50, Steve Dodge wrote:

 1. VirtualHostis an apache http server directive.

Right, but it was put there by Tomcat's auto-config. What I was trying 
to find out was, by localhost did Tomcat mean my (Tomcat's) 
localhost -- the server on 8080 -- or Apache's localhost, which is 
the server on port 80, which responds to many Virtual Hosts already
in the httpd.conf file.

 2. With JkMount you're not actually mapping a physical directory, it's a 
 url pattern.  

Yes, but all the ones that Tomcat auto-config'd into mod_jk.conf are 
relative to the Tomcat webapps directory. How do I write a url pattern
that can be interpreted as relative to Apache's document root, so that
JSP files in there will be passed to Tomcat for serving?

 If you have a tomcat webapp that serves jsp's such as 
 http://localhost:8080/mywebapp, then you can map jsp requests to that 
 webapp using JkMount /mywebapp/*.jsp

Ah...this exposes the gap in my understanding.
Where do I get a tomcat webapp that serves jsp's? 
This is what I need. I thought one was built into Tomcat -- in fact I
thought JSP serving was the original purpose of Tomcat.

If Tomcat doesn't have any such webapp, where do I get one?
I certainly can't write one, as I'm not a Java programmer.

///Peter



-
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 httpd RPM?

2005-09-14 Thread Peter Flynn
On Wed, 2005-09-14 at 10:17, Michael Lai wrote:
 Peter Flynn wrote:
 If Tomcat doesn't have any such webapp, where do I get one?
 I certainly can't write one, as I'm not a Java programmer.
 
 
 I am limited in my knowledge of tomcat but from my understanding, tomcat 
 can be ran either as a standalone server or behind a webserver.  In your 
 case, it seems like you don't actually need a webserver in front so you 
 should be able to connect to tomcat using the url:

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.

///Peter


-
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 Peter Flynn
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.

 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. 

Aha! Yes, AJP connector looks like what I need. Unfortunaely the
documentation doesn't seem to show how to do this.

 If you can't get out of it, I can help you set it up off or
 on list.

That would be great, many thanks.

///Peter


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSP on RHEL4 with Apache httpd RPM?

2005-09-09 Thread Peter Flynn
On Fri, 2005-09-09 at 06:13, Nikola Milutinovic wrote:
 Peter Flynn wrote:
 
 I need to add JSP ability to a RHEL4 server running the
 current Apache httpd from the Red Hat RPM. Apparently the 
 httpd RPM available from Red Hat doesn't have the hooks
 needed to allow JSP files to be passed to Tomcat (or if it
 does, I can't find them).
 
 Has anyone managed to serve JSP with Tomcat on a RHEL4
 machine running their stock httpd? 
 
 I'd rather not have to resort to building Apache httpd from 
 scratch, as that would mean also moving away from RPMs for 
 MySQL and PHP, in order to maintain synchronisation between 
 them.
   
 You're looking for mod_jk RPM or mod_jk2 (which has been dropped from 
 development). 

Thanks very much. Unfortunately the Tomcat I am using is one I
installed from source, as I didn't know at the time that Red Hat
had gotten around to making an RPM...and their RPM doesn't appear
to support Cocoon (I tested it on a clone box and adding the war 
file to webapps just causes error messages about missing jar files
to go into the logs).

 If you see mod_webapp RPM, run for your life.

I'm getting good at that :-)

 As a workaround, you should be able to use mod_proxy to proxy requests 
 for TC to it.

Interesting idea, thanks.

///Peter


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSP on RHEL4 with Apache httpd RPM?

2005-09-09 Thread Peter Flynn
On Fri, 2005-09-09 at 06:13, Nikola Milutinovic wrote:
 Peter Flynn wrote:
 
 I need to add JSP ability to a RHEL4 server running the
 current Apache httpd from the Red Hat RPM. 
[...]
 Has anyone managed to serve JSP with Tomcat on a RHEL4
 machine running their stock httpd? 
 
 You're looking for mod_jk RPM or mod_jk2 (which has been dropped from 
 development). 

I found mod_jk-ap20-1.2.10-1jpp.i386.rpm at http://www.jpackage.org and
It installed without error on RHEL4 running stock httpd-2.0.52-9.ent.rpm

So far, so good. So I added the suggested element

Listener className=org.apache.jk.config.ApacheConfig 
  modJk=/usr/lib/httpd/modules/mod_jk.so /

to the Engine name=Catalina ... container in server.xml and 
restarted Tomcat. 

This created /usr/local/jakarta-tomcat-5.5.9/conf/auto/mod_jk.conf 
(NOT mod_jk.conf.auto as the Jakarta Tomcat Connector Apache HowTo 
documentation says). 

The mod_jk.conf was pretty skeletal, so I added:

   JkWorkersFile /usr/local/jakarta-tomcat-5.5.9/conf/workers.properties

and edited workers.properties to reflect the locations

   workers.tomcat_home=/usr/local/jakarta-tomcat-5.5.9
   workers.java_home=/usr/java/jdk1.5.0_03

and added this line to /etc/httpd/conf/httpd.conf

   Include /usr/local/jakarta-tomcat-5.5.9/conf/auto/mod_jk.conf

and finally restarted Apache. No error, but it doesn't do anything
meaningful with my JSP files: it just serves them through Apache. 

Looking in mod_jk.conf I see it mentions all the subdirectories in 
Tomcat's webapps directory, but nowhere does it reference any 
directories in my Apache document tree. 

I've obviously missed how to get it configured to serve JSP files 
from the Apache web server directories. I have no interest in serving 
any JSPs from the Tomcat directories, as all I use Tomcat:8080 for is 
serving Cocoon, which already works fine.

The JkMount directives in mod_jk.conf all refer to /directory being
in Tomcat's webapps directory. How do I reference directories which
are actually below /var/www/html so that they get handled by Tomcat?

In mod_jk.conf, what does this refer to:

   VirtualHost localhost
ServerName localhost

The Tomcat:8080 server or the Apache httpd:80 server? 

If it's Tomcat, then I can understand why JkMount /directory refers 
to Tomcat's webapps, but it seems very weird that the autoconf should 
configure mod_jk.conf to mount only Tomcat's directories, when the 
entire point of the operation is to enable serving of Apache's own
JSP files.

If it's Apache's httpd, which it is presumably intended for, as this
file gets Include'd from Apache's httpd.conf, then why does it still
refer to localhost instead of picking up the ServerName from the
httpd.conf?

Should I change both localhost's to my server's FQDN?

///Peter


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSP on RHEL4 with Apache httpd RPM?

2005-09-09 Thread Peter Flynn
On Fri, 2005-09-09 at 15:50, Steve Dodge wrote:

 1. VirtualHostis an apache http server directive.

Right, but it was put there by Tomcat's auto-config. What I was trying 
to find out was, by localhost did Tomcat mean my (Tomcat's) 
localhost -- the server on 8080 -- or Apache's localhost, which is 
the server on port 80, which responds to many Virtual Hosts already
in the httpd.conf file.

 2. With JkMount you're not actually mapping a physical directory, it's a 
 url pattern.  

Yes, but all the ones that Tomcat auto-config'd into mod_jk.conf are 
relative to the Tomcat webapps directory. How do I write a url pattern
that can be interpreted as relative to Apache's document root, so that
JSP files in there will be passed to Tomcat for serving?

 If you have a tomcat webapp that serves jsp's such as 
 http://localhost:8080/mywebapp, then you can map jsp requests to that 
 webapp using JkMount /mywebapp/*.jsp

Ah...this exposes the gap in my understanding.
Where do I get a tomcat webapp that serves jsp's? 
This is what I need. I thought one was built into Tomcat -- in fact I
thought JSP serving was the original purpose of Tomcat.

If Tomcat doesn't have any such webapp, where do I get one?
I certainly can't write one, as I'm not a Java programmer.

///Peter



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JSP on RHEL4 with Apache httpd RPM?

2005-09-08 Thread Peter Flynn
I need to add JSP ability to a RHEL4 server running the
current Apache httpd from the Red Hat RPM. Apparently the 
httpd RPM available from Red Hat doesn't have the hooks
needed to allow JSP files to be passed to Tomcat (or if it
does, I can't find them).

Has anyone managed to serve JSP with Tomcat on a RHEL4
machine running their stock httpd? 

I'd rather not have to resort to building Apache httpd from 
scratch, as that would mean also moving away from RPMs for 
MySQL and PHP, in order to maintain synchronisation between 
them.

///Peter



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Where to put java code

2003-07-08 Thread Peter Flynn
I'm running jakarta-tomcat-4.1.18 for the purpose of serving with
Cocoon, and that's working fine. But I also have a handful of users
who have small .jsp files, most of which are trivial (the files, not
the users :-)...with one exception, which calls on a custom search
bean. This was working fine under the old JServ, but I can't make it
work under jakarta-tomcat. The error messages in all the
localhost_log.-MM-DD.txt files say:

 2003-07-07 09:37:01 Error compiling file:
 /usr/local/tomcat/jakarta-tomcat-4.1.18/work/Standalone/localhost/_/info/eolas/2002/3_11/search_jsp.java
  [javac] Compiling 1 source file
 
 /usr/local/tomcat/jakarta-tomcat-4.1.18/work/Standalone/localhost/_/info/eolas/2002/3_11/search_jsp.java:48:
  package ie.b2bsoft.eolas does not exist
   ie.b2bsoft.eolas.SearchBean Search1 = null;
   ^

so I've obviously put it in the wrong place, but the
Class Loader HOW-TO at
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html
says:

 For classes and resources specific to a particular web application,
 place unpacked classes and resources under /WEB-INF/classe of your web
 application archive, or place JAR files containing those classes and
 resources under /WEB-INF/lib of your web application archive.

[presumably that should be classes in the second line], which is
exactly where I *have* put the unpacked stuff.

This server also runs regular Apache, and the JSP users all have
regular HTML sites under the Apache docroot, so I have softlinked
that docroot to ROOT in my jakarta-tomcat-4.1.18/webapps (yes, I
know it's a horrible thing to do). In that docroot is a WEB-INF 
directory containing the classes subdirectory containing the
unpacked classes thus:

/usr/local/tomcat/jakarta-tomcat-4.1.18/webapps/ROOT/WEB-INF/classes/ie/b2bsoft/eolas:

drwxrwxr-x2 root   root 4096 Oct 12  2001 .
drwxrwxr-x3 root   root 4096 Oct 12  2001 ..
-rw-rw-r--1 root   root 1976 Oct 12  2001 HParser.class
-rw-rw-r--1 root   root 1180 Oct 12  2001 HParser.java
-rw-rw-r--1 root   root 3218 Oct 12  2001 SearchBean.class
-rw-rw-r--1 root   root 2111 Oct 12  2001 SearchBean.java

The error message refers to a package (by which it presumably means
a jar file?) but the classes were supplied unpacked so I typed
jar cf eolas.jar . in the classes directory and moved the eolas.jar
file to the lib directory...still no change.

What have I done wrong? (apart from not being a Java person :-)

///Peter



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Serving files from the Apache docroot

2003-01-28 Thread Peter Flynn
John writes:

 There's no need to mirror content in two directories, nor is there
 any need to point Tomcat at Apache's content root.  You can just
 make Apache's doc root the same as Tomcat's Context root and the
 issue goes away.  Or, just put your JSP and servlets in Tomcat's doc
 root and leave it like that.  

That did occur to me but I didn't try it, assuming that if the JSP file
referred to other resources, it would break because they weren't in the
Tomcat doc root.

I'll try it and see.

 If you have Apache serving static content like images, those images
 don't have to be in your web application's root at all if you don't
 want them to be.

I should hope not :-)

///Peter

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Serving files from the Apache docroot

2003-01-28 Thread Peter Flynn
Henning wrote:

 I had and have the same problem - and didn't find a solution yet. A
 more or less good workaround I discussed with (or better was a
 suggestion by) Mike Bachrynowski (who is also member on the list)
 could be to completely mirror the apache docroot to the tomcat
 docroot. This in my eyes is 'a little' waste of disk space and an
 alternative I though about is, to set the tomcat docroot to the same
 local dir the apache's points to - but I haven't tested this, maybe
 causes bad bad problems.

Pretty much what I did: soft link the Apache docroot to webapps/ROOT.
Horrible, but it seems to work.

 As far as I understood the mayor cause for all this is, that jk2
 developers due to performance reasons don' t want to send back
 requests (for images, .js, .css ...) to the apache and - what you
 and Mike and I want to do becomes impossible. -- LIST: is this
 right (I'm not really sure whether I should believe it)?

This is very suboptimal :-) I can understand not wanting to fire a lot
of requests back to Apache, but the designers seem not to have
envisaged the need for some sites just to serve a handful of .jsp
files. Tomcat seems to be written exclusively for serving vast
fully-fledged Web Apps (corporate style), and the occasional JSP user
is left out in the cold.

Fortunately our new Web site design won't use JSP at all, so I can
eventually take Tomcat back to where I want it, serving Cocoon :-)

 What I'm asking myself: is there anybody on the list who is really
 highly experienced in jk2 configuration?

I'm not sure configs will help: it's a conceptual matter by the look
of it.

///Peter

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Serving files from the Apache docroot

2003-01-28 Thread Peter Flynn
Henning writes:

 that sounds interesting to me, I don't need tomcat as http on port
 8080, does anyone know how the idea can be realized?

I think this has been asked ad nauseam on the Cocoon list, and I think
I read that it wasn't advised because Tomcat was not designed to be
secure in the way Apache is. I find that hard to believe, given the
high quality of most of the work.

This should be a FAQ (if it already is, I haven't found it).

I don't know how Tomcat would or would not scale as a replacement for
Apache on a big site, but it would certainly be nice to have it run
on port 80 as a replacement for Apache.

///Peter

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Serving files from the Apache docroot

2003-01-27 Thread Peter Flynn
I just brought up Tomcat in order to serve a handful of .jsp files
which are in the Apache document root.

Right now of course, when Apache hands off the request to Tomcat
for /foo.jsp, Tomcat comes back with a 404 because it can't find
the file:

 HTTP Status 404 - /foo.jsp

 type Status report

 message /foo.jsp

 description The requested resource (/foo.jsp) is not available.
 Apache Tomcat/4.1.18

Where do I tell Tomcat to look for this file in (eg) /var/www/html?
Where is it currently looking?

///Peter


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]