Re: Redirect after post Issue
I got it working. Basically the ProxyPassReverse directive should use HTTP not AJP. This article helped: http://lenya.apache.org/docs/2_0_x/tutorials/mod_proxy_ajp.html Jeremy On Fri, Mar 21, 2008 at 10:35 AM, James Carman [EMAIL PROTECTED] wrote: On 3/21/08, Jeremy Levy [EMAIL PROTECTED] wrote: Sebastiaan, Thanks very much, that helps a lot. It now works. Now that it's working I want to switch it to use ajp instead of http. I understand from your explanation how ProxyPreserveHost was breaking it. However, when I switch to use ajp, I'm seeing the same behavior. I'm having trouble understanding what tomcat is returning in terms of what I should define as my ProxyPassReverse. Is there an easier way to debug this? Here is how my virtualhost looks now: Have you tried asking the tomcat folks? They're much more adept at this stuff than us, I would imagine. They may have seen this sort of stuff before. Can you reproduce the issue with a simple JSP-based example? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect after post Issue
Looking at your mod_proxy config again I noticed that you are using ProxyPreserveHost on. I think this is causing the problems, you should remove this directive. What I think is happening is this: 1) Wicket says: redirect to /web/ 2) Tocmat makes the url absolute by prepending the virtual host. Since you have ProxyPreserveHost on, tomcat sees the virtual host as localhost and NOT localhost:8080, and returns http://localhost/web/xxx as the new lcoation. 3) Apache mod_proxy does NOT reverse proxy the url, because it does not have the :8080 on it and does not match your rule. If you remove the ProxyPreserveHost on, tomcat will return http://localhost:8080/web/x as the redirect location and Apache will reverse proxy it. The only downside of this is that your wicket app will not know the REAL virtual host, and so automatically generated absolute URL's (for example in emails) will be wrong. Regards, Sebastiaan Sebastiaan van Erk wrote: Hi, Jeremy Levy wrote: I have been having trouble with this for a couple of months, it seems that redirects in Wicket 1.3.x seem to be writing out the URL incorrectly in our set up. We are running JBoss 4.2 with embedded Tomcat 5.5 using Apache/2.2.4 with mod_proxy. The Tomcat URL for the application is http://localhost:8080/web/ The Apache URL for the application is http://localhost For the most part the site works well when accessed via Apache (and perfectly directly via Tomcat), except on links/urls that involve (from what I can tell) a redirect from Wicket. These redirect the users browser to /web/ which shouldn't happen from infront of the proxy. From what I can tell your mod_proxy config looks correct, you could check the log to see what it's doing. But Wicket redirecting you to /web/ is perfectly fine, as far as Wicket is concerned, that's where the site is at! It seems that mod_proxy is not properly reverse proxying the redirect... Regards, Sebastiaan Examples of this are: 1. Form submits (they go through, but the next page is requested with the /web in the url) 2. Redirects from Application.getHomePage() 3. Any use of RestartResponseAtInterceptPageException 4. setResponsePage(MyPage.class) inside of an Link.onClick(BookmarkablePageLink works fine to the same page) Further evidence that this is a bug is that if I set my application to IRequestCycleSettings.ONE_PASS_RENDER everything works perfectly but with both IRequestCycleSettings.REDIRECT_TO_BUFFER and IRequestCycleSettings.REDIRECT_TO_RENDER it fails. Our mod_proxy / virtualhost configuration: VirtualHost * ServerAdmin [EMAIL PROTECTED] ServerAlias localhost ServerSignature On DocumentRoot /var/www ProxyRequests Off Proxy * Order deny,allow Allow from all /Proxy RewriteEngine on RewriteLog /var/log/apache2/rewrite.log RewriteLogLevel 2 ProxyPass / http://localhost:8080/web/ ProxyPassReverse / http://localhost:8080/web/ ProxyPassReverseCookiePath /web / ProxyPreserveHost On ErrorLog /var/log/apache2/error.log LogLevel warn /VirtualHost I'm not 100% sure that the mod_proxy configuration is correct, but I've read all the articles on this list about it as well as the wiki page and have run out of ideas to mess with. Any help is appreciated. Jeremy smime.p7s Description: S/MIME Cryptographic Signature
Re: Redirect after post Issue
Sebastiaan, Thanks very much, that helps a lot. It now works. Now that it's working I want to switch it to use ajp instead of http. I understand from your explanation how ProxyPreserveHost was breaking it. However, when I switch to use ajp, I'm seeing the same behavior. I'm having trouble understanding what tomcat is returning in terms of what I should define as my ProxyPassReverse. Is there an easier way to debug this? Here is how my virtualhost looks now: VirtualHost *:80 ServerName tiger ServerAdmin [EMAIL PROTECTED] DocumentRoot /opt/www/ ProxyRequests Off Proxy * Order deny,allow Allow from all /Proxy ProxyPass / ajp://pabst:8009/web/ ProxyPassReverse / ajp://pabst:8009/web/ ProxyPassReverseCookiePath /web / /VirtualHost I've tried a couple of variations of the ProxyPassReverse ProxyPassReverse / ajp://pabst:8009/web/ ProxyPassReverse / ajp://pabst/web/ ProxyPassReverse / http://pabst:8080/web/ ProxyPassReverse / http://pabst/web/ All have the same effect. Should this work? Jeremy On Fri, Mar 21, 2008 at 3:17 AM, Sebastiaan van Erk [EMAIL PROTECTED] wrote: Looking at your mod_proxy config again I noticed that you are using ProxyPreserveHost on. I think this is causing the problems, you should remove this directive. What I think is happening is this: 1) Wicket says: redirect to /web/ 2) Tocmat makes the url absolute by prepending the virtual host. Since you have ProxyPreserveHost on, tomcat sees the virtual host as localhost and NOT localhost:8080, and returns http://localhost/web/xxx as the new lcoation. 3) Apache mod_proxy does NOT reverse proxy the url, because it does not have the :8080 on it and does not match your rule. If you remove the ProxyPreserveHost on, tomcat will return http://localhost:8080/web/x as the redirect location and Apache will reverse proxy it. The only downside of this is that your wicket app will not know the REAL virtual host, and so automatically generated absolute URL's (for example in emails) will be wrong. Regards, Sebastiaan Sebastiaan van Erk wrote: Hi, Jeremy Levy wrote: I have been having trouble with this for a couple of months, it seems that redirects in Wicket 1.3.x seem to be writing out the URL incorrectly in our set up. We are running JBoss 4.2 with embedded Tomcat 5.5 using Apache/2.2.4 with mod_proxy. The Tomcat URL for the application is http://localhost:8080/web/ The Apache URL for the application is http://localhost For the most part the site works well when accessed via Apache (and perfectly directly via Tomcat), except on links/urls that involve (from what I can tell) a redirect from Wicket. These redirect the users browser to /web/ which shouldn't happen from infront of the proxy. From what I can tell your mod_proxy config looks correct, you could check the log to see what it's doing. But Wicket redirecting you to /web/ is perfectly fine, as far as Wicket is concerned, that's where the site is at! It seems that mod_proxy is not properly reverse proxying the redirect... Regards, Sebastiaan Examples of this are: 1. Form submits (they go through, but the next page is requested with the /web in the url) 2. Redirects from Application.getHomePage() 3. Any use of RestartResponseAtInterceptPageException 4. setResponsePage(MyPage.class) inside of an Link.onClick(BookmarkablePageLink works fine to the same page) Further evidence that this is a bug is that if I set my application to IRequestCycleSettings.ONE_PASS_RENDER everything works perfectly but with both IRequestCycleSettings.REDIRECT_TO_BUFFER and IRequestCycleSettings.REDIRECT_TO_RENDER it fails. Our mod_proxy / virtualhost configuration: VirtualHost * ServerAdmin [EMAIL PROTECTED] ServerAlias localhost ServerSignature On DocumentRoot /var/www ProxyRequests Off Proxy * Order deny,allow Allow from all /Proxy RewriteEngine on RewriteLog /var/log/apache2/rewrite.log RewriteLogLevel 2 ProxyPass / http://localhost:8080/web/ ProxyPassReverse / http://localhost:8080/web/ ProxyPassReverseCookiePath /web / ProxyPreserveHost On ErrorLog /var/log/apache2/error.log LogLevel warn /VirtualHost I'm not 100% sure that the mod_proxy configuration is correct, but I've read all the articles on this list about it as well as the wiki page and have run out of ideas to mess with. Any help is appreciated. Jeremy
Re: Redirect after post Issue
On 3/21/08, Jeremy Levy [EMAIL PROTECTED] wrote: Sebastiaan, Thanks very much, that helps a lot. It now works. Now that it's working I want to switch it to use ajp instead of http. I understand from your explanation how ProxyPreserveHost was breaking it. However, when I switch to use ajp, I'm seeing the same behavior. I'm having trouble understanding what tomcat is returning in terms of what I should define as my ProxyPassReverse. Is there an easier way to debug this? Here is how my virtualhost looks now: Have you tried asking the tomcat folks? They're much more adept at this stuff than us, I would imagine. They may have seen this sort of stuff before. Can you reproduce the issue with a simple JSP-based example? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect after post Issue
Slight correction: With IRequestCycleSettings.ONE_PASS_RENDER most form submits seem to work except in the case of continueToOriginalDestination... Everything else still fails. J On Thu, Mar 20, 2008 at 6:09 PM, Jeremy Levy [EMAIL PROTECTED] wrote: I have been having trouble with this for a couple of months, it seems that redirects in Wicket 1.3.x seem to be writing out the URL incorrectly in our set up. We are running JBoss 4.2 with embedded Tomcat 5.5 using Apache/2.2.4 with mod_proxy. The Tomcat URL for the application is http://localhost:8080/web/ The Apache URL for the application is http://localhost For the most part the site works well when accessed via Apache (and perfectly directly via Tomcat), except on links/urls that involve (from what I can tell) a redirect from Wicket. These redirect the users browser to /web/ which shouldn't happen from infront of the proxy. Examples of this are: 1. Form submits (they go through, but the next page is requested with the /web in the url) 2. Redirects from Application.getHomePage() 3. Any use of RestartResponseAtInterceptPageException 4. setResponsePage(MyPage.class) inside of an Link.onClick(BookmarkablePageLink works fine to the same page) Further evidence that this is a bug is that if I set my application to IRequestCycleSettings.ONE_PASS_RENDER everything works perfectly but with both IRequestCycleSettings.REDIRECT_TO_BUFFER and IRequestCycleSettings.REDIRECT_TO_RENDER it fails. Our mod_proxy / virtualhost configuration: VirtualHost * ServerAdmin [EMAIL PROTECTED] ServerAlias localhost ServerSignature On DocumentRoot /var/www ProxyRequests Off Proxy * Order deny,allow Allow from all /Proxy RewriteEngine on RewriteLog /var/log/apache2/rewrite.log RewriteLogLevel 2 ProxyPass / http://localhost:8080/web/ ProxyPassReverse / http://localhost:8080/web/ ProxyPassReverseCookiePath /web / ProxyPreserveHost On ErrorLog /var/log/apache2/error.log LogLevel warn /VirtualHost I'm not 100% sure that the mod_proxy configuration is correct, but I've read all the articles on this list about it as well as the wiki page and have run out of ideas to mess with. Any help is appreciated. Jeremy
Re: Redirect after post Issue
http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypassreverse This directive lets Apache adjust the URL in the Location, Content-Location and URI headers on HTTP redirect responses ProxyPassReverse is the culprit here, not anything to do with Wicket. Jeremy Levy-3 wrote: I have been having trouble with this for a couple of months, it seems that redirects in Wicket 1.3.x seem to be writing out the URL incorrectly in our set up. We are running JBoss 4.2 with embedded Tomcat 5.5 using Apache/2.2.4 with mod_proxy. The Tomcat URL for the application is http://localhost:8080/web/ The Apache URL for the application is http://localhost For the most part the site works well when accessed via Apache (and perfectly directly via Tomcat), except on links/urls that involve (from what I can tell) a redirect from Wicket. These redirect the users browser to /web/ which shouldn't happen from infront of the proxy. Examples of this are: 1. Form submits (they go through, but the next page is requested with the /web in the url) 2. Redirects from Application.getHomePage() 3. Any use of RestartResponseAtInterceptPageException 4. setResponsePage(MyPage.class) inside of an Link.onClick(BookmarkablePageLink works fine to the same page) Further evidence that this is a bug is that if I set my application to IRequestCycleSettings.ONE_PASS_RENDER everything works perfectly but with both IRequestCycleSettings.REDIRECT_TO_BUFFER and IRequestCycleSettings.REDIRECT_TO_RENDER it fails. Our mod_proxy / virtualhost configuration: VirtualHost * ServerAdmin [EMAIL PROTECTED] ServerAlias localhost ServerSignature On DocumentRoot /var/www ProxyRequests Off Proxy * Order deny,allow Allow from all /Proxy RewriteEngine on RewriteLog /var/log/apache2/rewrite.log RewriteLogLevel 2 ProxyPass / http://localhost:8080/web/ ProxyPassReverse / http://localhost:8080/web/ ProxyPassReverseCookiePath /web / ProxyPreserveHost On ErrorLog /var/log/apache2/error.log LogLevel warn /VirtualHost I'm not 100% sure that the mod_proxy configuration is correct, but I've read all the articles on this list about it as well as the wiki page and have run out of ideas to mess with. Any help is appreciated. Jeremy -- View this message in context: http://www.nabble.com/%22Redirect-after-post%22-Issue-tp16189821p16191777.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect after post Issue
...and after reading your post a little closer, I flipped the directive parameters in my head. I don't think there's anything wrong with your ProxyPass directives. Sorry about that... -- View this message in context: http://www.nabble.com/%22Redirect-after-post%22-Issue-tp16189821p16191916.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Redirect after post Issue
No problem, I know other people are doing this, I can't seem to see where the issue is... Which is why I think something is wrong either in Tomcat or Wicket. J On Thu, Mar 20, 2008 at 8:36 PM, brian.diekelman [EMAIL PROTECTED] wrote: ...and after reading your post a little closer, I flipped the directive parameters in my head. I don't think there's anything wrong with your ProxyPass directives. Sorry about that... -- View this message in context: http://www.nabble.com/%22Redirect-after-post%22-Issue-tp16189821p16191916.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]