Page 1 of 1

URL redirection using vhttp

Posted: Tue Nov 04, 2003 10:28 pm
by kelvin.tee
I am operating under Linux environment and currently using vhttp as the webserver. Lately, I have install a Tomcat application running on the same server. My question is since vhhtp uses port 80, and Tomcat (default port 8080), how can I redirect any request meant for the application to Tomcat? I know Apache can do that. The last thing to do would be to abandon vhttp and to use the Apache bundled with Linux. Should I make the switch or is there any workaround?

URL redirection using vhttp

Posted: Wed Nov 05, 2003 11:08 am
by John
Depending on exactly what you mean the simplest method may be to have an entry script that spots URLs intended for Tomcat, and does a submit to the Tomcat server, and returns the result to the user, or did you just want to redirect the browser to port 8080?

URL redirection using vhttp

Posted: Wed Nov 05, 2003 8:57 pm
by kelvin.tee
Typically, any request would be served by the webserver. However, with an application server (such as Tomcat) running on the same machine, any incoming request to the Tomcat (port-8080) would have to go thru the webserver (port-80) since there can be only one instance of port-80. Supposing, the administrator would only allow port 80 for incoming request, therefore, access to Tomcat would not be possible. That is where URL direction come into place. By configuring setting in web server, together with redirector-connector, the request to Tomcat application is made possible thru port-80. Do you have anything similar to 'integration of Apache with Tomcat'?

Assuming the Tomcat application is call MYAPP, invoking the application directly from Tomcat would be:

http://www.mysite.com:8080/MYAPP/index.jsp

Thru redirection, the request would be:

http://www.mysite.com/MYAPP/index.jsp

I do not know whether the above is too confusing or too trivia but I desperately in need for solution.

URL redirection using vhttp

Posted: Thu Nov 06, 2003 11:06 am
by mark
An entry script like this (untested) should do the trick:

<script language=vortex>
<a name=main>
<rex ">>=/MYAPP" $REQUEST_PATH>
<if $ret ne "">
<if $HTTP_HOST eq ""><$HTTP_HOST="www.mysite.com"></if>
<sum "%s" "http://" $HTTP_HOST ":8080" $REQUEST_PATH>
<fetch $ret>
<fmt "%s" $ret>
<exit 1>
</if>
</a>
</script>

URL redirection using vhttp

Posted: Thu Nov 06, 2003 11:11 am
by mark