I configured apache on 4 ports (with virtual hosts as some ports used HTTPS) and the aim is to redirect post requests to different servlets running in a TOMCAT instance on some other machine. The calls are made from a httpclient (java client) . When I run the client it throws the error 301 Error: Moved Permanently. Need hints/tips/help on how to solve the this problem.
It would be nice if someone can give me a example. My virtual host (with the re-direction) looks like something like this
<VirtualHost _default_:3334> RewriteEngine On RewriteRule ^/$ https://192.168.100.23:38443/Lang/Englangservices/Alapbhet_service <\VirtualHost>
I am now able to get mod proxy working with mod rewrite and now I dont get the 302 error, but as it always happens to a newbie there is this another problem.
HTTP POST requests are not working. When I issue the post request, the proxy fails as it goes on to look for index.htm.
My httpd.conf snippet
<VirtualHost *:3331> ServerName localhost:3331 ProxyPass / http://192.168.100.23:38443/Lang/Englangservices/Alapbhet_service ProxyPassReverse / http://192.168.100.23:38443/Lang/Englangservices/Alapbhet_service RewriteEngine on RewriteRule ^/$ http://localhost:3331/ </VirtualHost>
Achieved this using JK and mod rewrite. The problem was with two way SSL and I configured the ports to run in conjunction with 443 (SSL) port.
i.e.
Note: if one intends to rewrite URL’s in the virtual hosts then JK mount has to be reloaded for each virtual host.
My URL rewrites look like this
RewriteEngine on
RewriteCond %{SERVER_PORT} 4342
RewriteRule ^/$ /Lang/Englangservices/Alapbhet_service [L,PT]
Thanks everyone one for their inputs.