Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

reverse proxy via mod_proxy returns HTTP 500 error

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


ron.vandenbranden at kantl

Mar 24, 2012, 2:37 PM

Post #1 of 5 (3053 views)
Permalink
reverse proxy via mod_proxy returns HTTP 500 error

Hi,

I'm trying to configure reverse proxy rules in vhost.conf. I have
Apache-2.2.8 on Ubuntu-8.04 (monitored by Plesk-10.4.4).

What I'm trying to achieve is defining a reverse proxy rule that defers
all traffic to -say- <http://mydomain/tomcat/> to the Tomcat server
running on port 8080. I have mod_rewrite and mod_proxy loaded in Apache.
As far as I understand mod_proxy docs, entering following rules in a
vhost.conf file should work:

| <Proxy *>
Order deny,allow
Allow from all
</Proxy>
|
| ProxyRequests off
RewriteRule ^/tomcat/(.*)$ http://mydomain:8080/$1 [P]
|

(Note: I tested with a RewriteRule directive to get at least some
logging.) Yet, I am getting a HTTP 500: internal server error when
requesting above URL.

I have made mod_rewrite log extensively, and find following entries in
the logs:

81.241.230.23 - - [19/Mar/2012:16:42:59 +0100] [mydomain/sid#b06ab8][rid#1024af8/initial] (2) init rewrite engine with requested uri /tomcat/testApp/
81.241.230.23 - - [19/Mar/2012:16:42:59 +0100] [mydomain/sid#b06ab8][rid#1024af8/initial] (3) applying pattern '^/tomcat/(.*)$' to uri '/tomcat/testApp/'
81.241.230.23 - - [19/Mar/2012:16:42:59 +0100] [mydomain/sid#b06ab8][rid#1024af8/initial] (2) rewrite '/tomcat/testApp/' -> 'http://mydomain:8080/testApp/'
81.241.230.23 - - [19/Mar/2012:16:42:59 +0100] [mydomain/sid#b06ab8][rid#1024af8/initial] (2) forcing proxy-throughput with http://mydomain:8080/testApp/
81.241.230.23 - - [19/Mar/2012:16:42:59 +0100] [mydomain/sid#b06ab8][rid#1024af8/initial] (1) go-ahead with proxy request proxy:http://mydomain:8080/testApp/ [OK]

This suggests that the rewrite and proxy part are processed ok; still
the proxied request produces a 500 error. Addressing the testApp
directly via <http://mydomain:8080/testApp> does work, and the same
setup does work on my local computer.

Does anyone have an idea what might be wrong, or how I at least can get
more useful information than 'internal server error' (apart from above
rewrite logs, I can't find any trace of this request in other logs).

Any pointers much appreciated!

Ron


serge.fonville at gmail

Mar 24, 2012, 3:41 PM

Post #2 of 5 (2953 views)
Permalink
Re: reverse proxy via mod_proxy returns HTTP 500 error [In reply to]

Hi,

> What I'm trying to achieve is defining a reverse proxy rule that defers all traffic to -say- <http://mydomain/tomcat/> to the Tomcat server running on port 8080.

Does http://tomcat.apache.org/tomcat-7.0-doc/proxy-howto.html apply?

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Google!!
They need to add GAL support on Android (star to agree)
http://code.google.com/p/android/issues/detail?id=4602



2012/3/24 ron.vandenbranden [at] hom <ron.vandenbranden [at] kantl>:
> Hi,
>
> I'm trying to configure reverse proxy rules in vhost.conf. I have
> Apache-2.2.8 on Ubuntu-8.04 (monitored by Plesk-10.4.4).
>
> What I'm trying to achieve is defining a reverse proxy rule that defers all
> traffic to -say- <http://mydomain/tomcat/> to the Tomcat server running on
> port 8080. I have mod_rewrite and mod_proxy loaded in Apache. As far as I
> understand mod_proxy docs, entering following rules in a vhost.conf file
> should work:
>
> <Proxy *>
> Order deny,allow
> Allow from all
> </Proxy>
>
> ProxyRequests off
> RewriteRule ^/tomcat/(.*)$ http://mydomain:8080/$1 [P]
>
> (Note: I tested with a RewriteRule directive to get at least some logging.)
> Yet, I am getting a HTTP 500: internal server error when requesting above
> URL.
>
> I have made mod_rewrite log extensively, and find following entries in the
> logs:
>
> 81.241.230.23 - - [19/Mar/2012:16:42:59 +0100]
> [mydomain/sid#b06ab8][rid#1024af8/initial] (2) init rewrite engine with
> requested uri /tomcat/testApp/
> 81.241.230.23 - - [19/Mar/2012:16:42:59 +0100]
> [mydomain/sid#b06ab8][rid#1024af8/initial] (3) applying pattern
> '^/tomcat/(.*)$' to uri '/tomcat/testApp/'
> 81.241.230.23 - - [19/Mar/2012:16:42:59 +0100]
> [mydomain/sid#b06ab8][rid#1024af8/initial] (2) rewrite '/tomcat/testApp/' ->
> 'http://mydomain:8080/testApp/'
> 81.241.230.23 - - [19/Mar/2012:16:42:59 +0100]
> [mydomain/sid#b06ab8][rid#1024af8/initial] (2) forcing proxy-throughput with
> http://mydomain:8080/testApp/
> 81.241.230.23 - - [19/Mar/2012:16:42:59 +0100]
> [mydomain/sid#b06ab8][rid#1024af8/initial] (1) go-ahead with proxy request
> proxy:http://mydomain:8080/testApp/ [OK]
>
> This suggests that the rewrite and proxy part are processed ok; still the
> proxied request produces a 500 error. Addressing the testApp directly via
> <http://mydomain:8080/testApp> does work, and the same setup does work on my
> local computer.
>
> Does anyone have an idea what might be wrong, or how I at least can get more
> useful information than 'internal server error' (apart from above rewrite
> logs, I can't find any trace of this request in other logs).
>
> Any pointers much appreciated!
>
> Ron

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


ron.vandenbranden at kantl

Mar 25, 2012, 12:15 PM

Post #3 of 5 (2921 views)
Permalink
Re: reverse proxy via mod_proxy returns HTTP 500 error [In reply to]

Hi,

On 24/03/2012 23:41, Serge Fonville wrote:
> Does http://tomcat.apache.org/tomcat-7.0-doc/proxy-howto.html apply?
>

Thanks for your suggestion, but specifying proxy settings in a Tomcat
<connector> does not seem to affect the error. I have two reasons for
believing the error lies elsewhere:
1. the same apache vhost.conf settings do work when tested on my
local computer (without any specific proxy configuration in Tomcat)
2. a different (non-Tomcat related) proxy rule also produces a HTTP
500 error (when requesting <http://mydomain/google/>):

RewriteRule /google/ http://www.google.be/ [P]

I have also tried with regular mod_proxy rules (without mod_rewrite) but
resorted to a proxied RewriteRule in order to get at least some info logged.

Kind regards,

Ron

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


serge.fonville at gmail

Mar 25, 2012, 3:48 PM

Post #4 of 5 (2931 views)
Permalink
Re: reverse proxy via mod_proxy returns HTTP 500 error [In reply to]

One line containing:

RewriteRule uri/(.*) http://host/$1 [P]

Works for me

Kind regards/met vriendelijke groet,

Serge Fonville

http://www.sergefonville.nl

Convince Google!!
They need to add GAL support on Android (star to agree)
http://code.google.com/p/android/issues/detail?id=4602



2012/3/25 ron.vandenbranden [at] hom <ron.vandenbranden [at] kantl>:
> Hi,
>
> On 24/03/2012 23:41, Serge Fonville wrote:
>>
>> Does http://tomcat.apache.org/tomcat-7.0-doc/proxy-howto.html apply?
>>
>
> Thanks for your suggestion, but specifying proxy settings in a Tomcat
> <connector> does not seem to affect the error. I have two reasons for
> believing the error lies elsewhere:
>    1. the same apache vhost.conf settings do work when tested on my local
> computer (without any specific proxy configuration in Tomcat)
>    2. a different (non-Tomcat related) proxy rule also produces a HTTP 500
> error (when requesting <http://mydomain/google/>):
>
>    RewriteRule /google/ http://www.google.be/ [P]
>
> I have also tried with regular mod_proxy rules (without mod_rewrite) but
> resorted to a proxied RewriteRule in order to get at least some info logged.
>
> Kind regards,
>
> Ron
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


ron.vandenbranden at kantl

Mar 26, 2012, 1:07 AM

Post #5 of 5 (2921 views)
Permalink
Re: reverse proxy via mod_proxy returns HTTP 500 error [In reply to]

Hi,

Thanks for your help.

The problem was on my side (of course): I apparently had forgotten to
enable mod_proxy_http, next to mod_proxy on my production server.
Enabling mod_proxy_http solved the issue.

Kind regards,

Ron

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.