URL redirection using vhttp

Post Reply
kelvin.tee
Posts: 5
Joined: Thu Oct 30, 2003 6:19 am

URL redirection using vhttp

Post 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?
User avatar
John
Site Admin
Posts: 2605
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

URL redirection using vhttp

Post 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?
John Turnbull
Thunderstone Software
kelvin.tee
Posts: 5
Joined: Thu Oct 30, 2003 6:19 am

URL redirection using vhttp

Post 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.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

URL redirection using vhttp

Post 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>
Post Reply