0

I'm using apache httpd v2.2 server as a frontend proxy for our actual tomcat web server which hosts the Java web application.

I want to forward all urls received by apache webserver other than those having the prefix /product to tomcat.

I've tried the following set up in httpd.conf but it' doesn't seem to work

<VirtualHost *:6111> 
    ServerName localhost
    RewriteEngine on
    RewriteRule !^(/product($|/)) http://localhost:1234/$1
    Alias /product /opt/productdoc
</VirtualHost>

I tried to follow Redirect site with .htaccess but exclude one folder but was not successful

Basically all http://localhost:6111/product urls should serve from hard drive (using alias) Any other url should be forwarded to http://localhost:1234/<original-path>

Community
  • 1
  • 1
Dev Blanked
  • 8,555
  • 3
  • 26
  • 32

1 Answers1

0

You probably want to use something like mod_jk http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html.

There are a ton of examples and tutorials and it should be pretty simple to setup and install. Now that you know the name of the connection technology, you should probably be able to find more information.

Using modjk also allows you to secure your tomcat server and keep the public off of it.

RuntimeBlairror
  • 729
  • 9
  • 19