Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 05-12-2009, 09:01 AM   #1
Registered: Aug 2007
Posts: 341

Rep: Reputation: 31
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; 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?

Old 05-13-2009, 02:06 AM   #2
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,474

Rep: Reputation: 1480Reputation: 1480Reputation: 1480Reputation: 1480Reputation: 1480Reputation: 1480Reputation: 1480Reputation: 1480Reputation: 1480Reputation: 1480
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:
RewriteEngine on
RewriteRule ^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

Last edited by bathory; 05-13-2009 at 02:23 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
apache url rewrite about Canonical URLs addbbe Linux - Server 9 02-12-2009 05:21 AM
Apache rewrite rule help - dynamic url to static page DukeLeto Linux - Software 3 11-12-2008 11:26 AM
Squid redirector/URL rewrite based on MIME type drmouse Linux - Server 0 02-25-2008 05:07 AM
apache url rewrite gallew Linux - Server 0 08-25-2006 03:54 AM
Use apache to rewrite to external server and keep same browser URL ijsman77 Linux - Software 1 04-09-2004 07:32 AM

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration