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
URL redirection using vhttp
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
Thunderstone Software
-
- Posts: 5
- Joined: Thu Oct 30, 2003 6:19 am
URL redirection using vhttp
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.
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
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>
<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>