LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   apache rewrite port based on URL.. can it? (http://www.linuxquestions.org/questions/linux-server-73/apache-rewrite-port-based-on-url-can-it-725432/)

sir-lancealot 05-12-2009 09:01 AM

apache rewrite port based on URL.. can it?
 
Not really sure how to title it, but we have a webserver and one of the developers is using glassfish. It's listening on port 8080, apache on the default 80.

Right now I can goto;
http://www.domain.com:8080/folder/fo...ken?format=xml and get my response from glassfish.

He wants to have apache listen for 'folder' and send that to glassfish without the port, so of like the addhandler we use with php. Apache sees .php and sends it off. But there is no file extentions, and it's a diff port, so can you tell apache, if you see 'folder' send it to port 8080 and then get the response?

Thanks

bathory 05-13-2009 02:06 AM

If you want apache to forward any request for /folder to glassfish and passing also any arguements in the URI to thenew URI, you can use the following rewrite rule:
Code:

RewriteEngine on
RewriteRule ^folder/(.*) http://www.domain.com:8080/folder/$1

You might take a look at mod_jk that is used to allow apache run webapps through tomcat. Doing a little search it seems that it can be used also with glassfish. Read this for more details


All times are GMT -5. The time now is 03:46 PM.