LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help How to configure apache to redirect request to another port ? (https://www.linuxquestions.org/questions/linux-newbie-8/help-how-to-configure-apache-to-redirect-request-to-another-port-896678/)

NaveenM 08-11-2011 01:51 AM

Help How to configure apache to redirect request to another port ?
 
Hello everyone.

*Am trying to configure on machine “MyServer.net” 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 “MyServer.net/job/<JOBNAME>/build?token=TOKEN”.

Condition
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

ProxyPass 
/job/naveen/* http://Myserver.net:8081/
ProxyPassReverse /job/naveen/* http://fastdevl0017.svr.emea.jpmchase.net:8081/

<ProxyMatch "^http://Myserver.net:8586/job/naveen/*">
Allow from All
Order Allow,Deny
</ProxyMatch>

ProxyPass /job/[!naveen]/* http://Myserver.net:8080/
ProxyPassReverse /job/[!naveen]/* http://fastdevl0017.svr.emea.jpmchase.net:8080/

<ProxyMatch "^http://Myserver.net:8586/job/[!naveen]/*">
Allow from All
Order Allow,Deny
</ProxyMatch>

### *********** 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 "MyServer.net" where am running the apache.

So whats wrong in here. Can anyone help me out please.

bvm2607 08-11-2011 10:48 AM

what about:

RewriteRule ^/(job/naveen/.*)$ http://fastdevl0017.svr.emea.jpmchase.net:8081/$1 [R,QSA,L]
RewriteRule ^/(job/.*)$ http://fastdevl0017.svr.emea.jpmchase.net:8080/$1 [R,QSA,L]


All times are GMT -5. The time now is 02:54 AM.