LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 10-08-2010, 05:03 AM   #1
goldwing
LQ Newbie
 
Registered: Jan 2007
Location: Vilvoorde - Belgium
Distribution: Ubuntu
Posts: 13

Rep: Reputation: 0
Cool reverse proxy & tomcat


Hi,

We use a reverse proxy to forward a lot of websites via 1 central place.
so http://blahblahblah/smt should forward to an internal server.
I already managed to forward a lot of website correctly, except for this one:

when I type: http://blablahblah/smt/webtier-7-11 it doesn't work correctly, but http://blablahblah/webtier-7-11 does !
How can I make the first url to work ?

ProxyPass /smt http://192.168.10.38:8080
ProxyPassReverse /smt http://192.168.10.38:8080
ProxyPassMatch ^/((smt|webtier-7.11)(/.*)?)?$ http://192.168.10.38:8080/$1

ProxyPass /webtier-7.11 http://192.168.10.38:8080
ProxyPassReverse /webtier-7.11 http://192.168.10.38:8080

ProxyPassReverseCookieDomain 192.168.10.38 172.16.20.143


& proxy_ajp.conf:

ProxyPass /smt/ ajp://192.168.10.38:8009/
 
Old 10-08-2010, 06:53 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Hi,

I guess you can use mod_rewrite to rewrite internally /smt/webtier-7-11 to /webtier-7-11
Code:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/smt/webtier-7-11
RewriteRule ^smt/webtier-7-11 /webtier-7-11

ProxyPass /smt http://192.168.10.38:8080
ProxyPassReverse /smt http://192.168.10.38:8080
ProxyPassMatch ^/((smt|webtier-7.11)(/.*)?)?$ http://192.168.10.38:8080/$1

ProxyPass /webtier-7.11 http://192.168.10.38:8080
ProxyPassReverse /webtier-7.11 http://192.168.10.38:8080

ProxyPassReverseCookieDomain 192.168.10.38 172.16.20.143
 
Old 10-08-2010, 07:48 AM   #3
goldwing
LQ Newbie
 
Registered: Jan 2007
Location: Vilvoorde - Belgium
Distribution: Ubuntu
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks, just tried that, but now the application is not loading decently (cleared all cache, etc. first)
Think it has to do with tomcat, but can't find the clue.
 
Old 10-08-2010, 08:22 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
What you mean by "not loading decently"?
Are you using the default:
Code:
ProxyPreserveHost On
ProxyRequests Off
Also I don't think you need the "ProxyPassMatch" and "ProxyPassReverseCookieDomain" any more
 
Old 10-08-2010, 10:45 AM   #5
goldwing
LQ Newbie
 
Registered: Jan 2007
Location: Vilvoorde - Belgium
Distribution: Ubuntu
Posts: 13

Original Poster
Rep: Reputation: 0
We used the 'JkMount' options to handle our tomcat requests.

How do I do these redicrections now with the 'Rewrite':

/smt --> /webtier-7.11/index.do
/smt-ess --> /webtier-7.11/ess.do
/smt-calendar --> /calendar
 
Old 10-08-2010, 04:15 PM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
You can use:
Code:
RewriteEngine on

RewriteRule ^smt$ /webtier-7.11/index.do
RewriteRule ^smt-ess$ /webtier-7.11/ess.do
RewriteRule ^smt-calendar$ /calendar
Regards
 
  


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
awstats & reverse proxy sci3ntist Linux - Server 1 10-13-2009 07:53 AM
Apache Reverse Proxy & Cache - Error Handling alexp_789 Linux - Server 1 01-21-2009 02:00 AM
Squid as Reverse Proxy and LAN proxy? zivota Linux - Security 2 02-26-2007 06:00 PM
reverse proxy? bwall Linux - Newbie 1 11-22-2005 08:42 PM
still trying to reverse proxy wildbob Linux - Networking 6 10-28-2003 10:12 AM


All times are GMT -5. The time now is 08:13 PM.

Main Menu
Advertisement
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