Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-11-2011, 01:51 AM   #1
LQ Newbie
Registered: Aug 2011
Posts: 2

Rep: Reputation: Disabled
Help How to configure apache to redirect request to another port ?

Hello everyone.

*Am trying to configure on machine “” apache on port 8586.
*Two applications run on same machine on different ports Jenkins on 8081 and Hudson on 8080.

*Request coming to 8586 port should redirect to either 8080 or 8081 on one condition.
*The request from client machine coming to MyServernet:8586 looks something like this “<JOBNAME>/build?token=TOKEN”.

If <JOBNAME> is “naveen” apache should redirect to 8081.
If <JOBNAME> is not “naveenn” apache should redirect to 8080.

I want the request to go like this

Client Machine <---> Apaache Port <--->(Jenkins/Hudson)

<---> = Send and recieve.

Here is the httpd.conf which I configured.

PHP Code:
### ********** Test Configuration Start *************** ###

Listen 8586

ProxyPassReverse /job/naveen/*

<ProxyMatch "^*">
Allow from All
Order Allow,Deny

ProxyPass /job/[!naveen]/*
ProxyPassReverse /job/[!naveen]/*

<ProxyMatch "^[!naveen]/*">
Allow from All
Order Allow,Deny

### *********** Configuration End ************** ### 

Any inputs/hints/pointers/suggestions are most welcome. I have to configure this.

Its not working, the error log says the
[Wed Aug 10 17:31:32 2011] [error] [client <Ip Address>] File does not exist: /fast/apps/apache/Modified_Apache/htdocs/crumbIssuer

This path "/fast/apps/apache/Modified_Apache/" is the path configured in "" where am running the apache.

So whats wrong in here. Can anyone help me out please.
Old 08-11-2011, 10:48 AM   #2
LQ Newbie
Registered: Sep 2008
Posts: 6

Rep: Reputation: 2
what about:

RewriteRule ^/(job/naveen/.*)$$1 [R,QSA,L]
RewriteRule ^/(job/.*)$$1 [R,QSA,L]


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
Redirect a tomcat application URL and port using apache. sudheshpn Linux - Software 5 06-17-2011 03:51 PM
How to rewrite/redirect directory to port number in apache? jiecenzhao Linux - Server 4 06-04-2011 05:24 PM
[SOLVED] Apache: IP- and port-based virtual server with Redirect catkin Linux - Server 2 04-11-2011 11:42 PM
apache: http redirect for any request going to* psychobyte Linux - Software 1 04-11-2005 05:57 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:19 AM.

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