Re: mixed html and jsp site using ProxyPass

2008-12-05 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

David,

David Goodenough wrote:
   ProxyPass ajp://127.0.0.1:8009/jsp
Can't you do something like this:

ProxyPass (/*.jsp) ajp://127.0.0.1:8009/jsp$1

??

This is one of the reasons that I like using mod_jk: there's actual
documentation for how to use it. The best I can find for mod_proxy_ajp
is http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

With mod_jk, the setup or URLs is obvious:

JkMount *.jsp tomcat

Of course, you have to define the tomcat worker, which is less
straightfoward, but you can get away with this:

JkWorkerProperty worker.list=tomcat
JkWorkerProperty worker.tomcat.port=8009

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkk5VIIACgkQ9CaO5/Lv0PBONgCghICuIwsZD4gF7sKY+i/KxcEj
SBAAn2zvD64SFBn58LYA8nAn9/OdkaXy
=QnxS
-END PGP SIGNATURE-

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



RE: mixed html and jsp site using ProxyPass

2008-12-03 Thread Peter Crowther
 From: David Goodenough [mailto:[EMAIL PROTECTED]
 I have a site which is a mixture of html (and a bunch of images and
 flash and other such stuff which came in from the web designer) and
 a couple of JSPs.  I have implemented this with Apache 2.2 and Tomcat
 5.5, using ProxyPass statements with ajp in the Location tag.

Is there any reason for such a complex setup?  Tomcat will quite happily serve 
the static content itself.  You could:

1) Put all the content in the same directory for Tomcat to serve, keep Apache 
httpd, but all your content goes through Tomcat-httpd-user;

2) Put all the content in the same directory for Tomcat to serve, remove Apache 
httpd, serve the content directly through a http Connector in Tomcat.

- Peter

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



Re: mixed html and jsp site using ProxyPass

2008-12-03 Thread Chris Wareham

David Goodenough wrote:
I have a site which is a mixture of html (and a bunch of images and 
flash and other such stuff which came in from the web designer) and

a couple of JSPs.  I have implemented this with Apache 2.2 and Tomcat
5.5, using ProxyPass statements with ajp in the Location tag.

My location block looks like:

Location / # it is the root application
  ProxyPass ajp://127.0.0.1:8009/jsp
  ProxyPassReverse http://...domain...
  SetOutputFilter proxy-html
  ProxyHTMLURLMap http://127.0.0.1:8180 http://...domain...
  ProxyHTMLURLMAP / http://...domain...
  /Location

So the base stuff is at the root, and the jsp stuff is all under the
jsp path element, so index.jsp is at jsp/index.jsp when referenced
in a URL.

There are some bits of the the Apache managed stuff (css files etc) that
I need to reference in the JSP, so those are referenced as /style.css rather
than style.css in the jsp pages.

It would however be easier if I have the jsp code at the same level (from
a URL path point of view) as the html etc files.  

Is there a way to divert just the .jsp files? I tried Location /*.jsp but 
that did not seem to work - maybe I got something else wrong.


I have tried looking around with Google, but obviously I asked the wrong
question as I did not find a useful answer.  Any help gratefullly received.

David



As another poster suggested, if the static content (CSS, images, Flash,
etc) rarely changes, then make it part of your web application. You
could then dispense with Apache HTTPD and AJP entirely, and have Tomcat
handle the requests directly. On a Unix system, you can still run Tomcat
as an unprivileged user by having it listen on ports 8080 and 8443 for
example, and using firewall rules to forward incoming requests from
ports 80 and 443 respectively.

Chris
--

Chris Wareham
Senior Software Engineer
Visit London Ltd
6th floor,
2 More London Riverside, London SE1 2RR

Tel:  +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753


www.visitlondon.com





  
  
'Visit London Limited' is registered in England under No.761149;

Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.


Visit London is the official visitor organisation for London. Visit London is 
partly funded by Partnership, the Mayor's London Development Agency and London 
Councils.
The information contained in this e-mail is confidential and intended for the 
named recipient(s) only.  If you have received it in error, please notify the 
sender immediately and then delete the message.  If you are not the intended 
recipient, you must not use, disclose, copy or distribute this email. The views 
expressed in this e-mail are those of the individual and not of Visit London. 
We reserve the right to read and monitor any email or attachment entering or 
leaving our systems without prior notice.

 Please don't print this e-mail unless you really need to.

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



Re: mixed html and jsp site using ProxyPass

2008-12-03 Thread David Goodenough
The reason was that Tomcat did not serve the Flash correctly, never did
manage to get to the bottom of why but the browser did not complain - it
just left big blank spaces.  With this setup at least that bit works.

David

On Wednesday 03 December 2008, Peter Crowther wrote:
  From: David Goodenough [mailto:[EMAIL PROTECTED]
  I have a site which is a mixture of html (and a bunch of images and
  flash and other such stuff which came in from the web designer) and
  a couple of JSPs.  I have implemented this with Apache 2.2 and Tomcat
  5.5, using ProxyPass statements with ajp in the Location tag.

 Is there any reason for such a complex setup?  Tomcat will quite happily
 serve the static content itself.  You could:

 1) Put all the content in the same directory for Tomcat to serve, keep
 Apache httpd, but all your content goes through Tomcat-httpd-user;

 2) Put all the content in the same directory for Tomcat to serve, remove
 Apache httpd, serve the content directly through a http Connector in
 Tomcat.

 - Peter

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



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



Re: mixed html and jsp site using ProxyPass

2008-12-03 Thread Chris Wareham

David Goodenough wrote:

The reason was that Tomcat did not serve the Flash correctly, never did
manage to get to the bottom of why but the browser did not complain - it
just left big blank spaces.  With this setup at least that bit works.

David



My gut response is that the MIME type is wrong, so the browser doesn't
know that the file is a Flash movie. How were you serving the Flash
files when you tried it from Tomcat? You will probably need a servlet
which sets the MIME type correctly, (trying to do it from a JSP will
work, but will also fill your logs with warnings as a JSP is not
supposed to serve binary files).

Chris


On Wednesday 03 December 2008, Peter Crowther wrote:

From: David Goodenough [mailto:[EMAIL PROTECTED]
I have a site which is a mixture of html (and a bunch of images and
flash and other such stuff which came in from the web designer) and
a couple of JSPs.  I have implemented this with Apache 2.2 and Tomcat
5.5, using ProxyPass statements with ajp in the Location tag.

Is there any reason for such a complex setup?  Tomcat will quite happily
serve the static content itself.  You could:

1) Put all the content in the same directory for Tomcat to serve, keep
Apache httpd, but all your content goes through Tomcat-httpd-user;

2) Put all the content in the same directory for Tomcat to serve, remove
Apache httpd, serve the content directly through a http Connector in
Tomcat.

- Peter

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




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




--

Chris Wareham
Senior Software Engineer
Visit London Ltd
6th floor,
2 More London Riverside, London SE1 2RR

Tel:  +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753


www.visitlondon.com





  
  
'Visit London Limited' is registered in England under No.761149;

Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.


Visit London is the official visitor organisation for London. Visit London is 
partly funded by Partnership, the Mayor's London Development Agency and London 
Councils.
The information contained in this e-mail is confidential and intended for the 
named recipient(s) only.  If you have received it in error, please notify the 
sender immediately and then delete the message.  If you are not the intended 
recipient, you must not use, disclose, copy or distribute this email. The views 
expressed in this e-mail are those of the individual and not of Visit London. 
We reserve the right to read and monitor any email or attachment entering or 
leaving our systems without prior notice.

 Please don't print this e-mail unless you really need to.

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



Re: mixed html and jsp site using ProxyPass

2008-12-03 Thread André Warnier

David Goodenough wrote:
[...]


Is there a way to divert just the .jsp files? I tried Location /*.jsp but 
that did not seem to work - maybe I got something else wrong.


You may have more luck on the Apache users list ([EMAIL PROTECTED]) 
for this.
But, assuming all your other content is to be served by Apache, and only 
the *.jsp urls to be forwarded to Tomcat, you could try this :

LocationMatch \.jsp$
  ... same as before ...
/LocationMatch


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



Re: mixed html and jsp site using ProxyPass

2008-12-03 Thread André Warnier

Chris Wareham wrote:

David Goodenough wrote:

The reason was that Tomcat did not serve the Flash correctly, never did
manage to get to the bottom of why but the browser did not complain - it
just left big blank spaces.  With this setup at least that bit works.

David



My gut response is that the MIME type is wrong, so the browser doesn't
know that the file is a Flash movie. How were you serving the Flash
files when you tried it from Tomcat? You will probably need a servlet
which sets the MIME type correctly, (trying to do it from a JSP will
work, but will also fill your logs with warnings as a JSP is not
supposed to serve binary files).

How about just adding the appropriate mime-mapping section to 
(tomcat_dir)/conf/web.xml ?



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



Re: mixed html and jsp site using ProxyPass

2008-12-03 Thread Chris Wareham

André Warnier wrote:

Chris Wareham wrote:

David Goodenough wrote:

The reason was that Tomcat did not serve the Flash correctly, never did
manage to get to the bottom of why but the browser did not complain - it
just left big blank spaces.  With this setup at least that bit works.

David



My gut response is that the MIME type is wrong, so the browser doesn't
know that the file is a Flash movie. How were you serving the Flash
files when you tried it from Tomcat? You will probably need a servlet
which sets the MIME type correctly, (trying to do it from a JSP will
work, but will also fill your logs with warnings as a JSP is not
supposed to serve binary files).

How about just adding the appropriate mime-mapping section to 
(tomcat_dir)/conf/web.xml ?




I was pretty sure there was a reason why my gut response missed the
obvious. I'll get some more coffee!

Chris
--

Chris Wareham
Senior Software Engineer
Visit London Ltd
6th floor,
2 More London Riverside, London SE1 2RR

Tel:  +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753


www.visitlondon.com





  
  
'Visit London Limited' is registered in England under No.761149;

Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.


Visit London is the official visitor organisation for London. Visit London is 
partly funded by Partnership, the Mayor's London Development Agency and London 
Councils.
The information contained in this e-mail is confidential and intended for the 
named recipient(s) only.  If you have received it in error, please notify the 
sender immediately and then delete the message.  If you are not the intended 
recipient, you must not use, disclose, copy or distribute this email. The views 
expressed in this e-mail are those of the individual and not of Visit London. 
We reserve the right to read and monitor any email or attachment entering or 
leaving our systems without prior notice.

 Please don't print this e-mail unless you really need to.

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