LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 05-12-2009, 10:01 AM   #1
sir-lancealot
Member
 
Registered: Aug 2007
Posts: 336

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;
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
 
Old 05-13-2009, 03:06 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,953

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
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

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


Reply


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 06:21 AM
Apache rewrite rule help - dynamic url to static page DukeLeto Linux - Software 3 11-12-2008 12:26 PM
Squid redirector/URL rewrite based on MIME type drmouse Linux - Server 0 02-25-2008 06:07 AM
apache url rewrite gallew Linux - Server 0 08-25-2006 04:54 AM
Use apache to rewrite to external server and keep same browser URL ijsman77 Linux - Software 1 04-09-2004 08:32 AM


All times are GMT -5. The time now is 07:21 AM.

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