tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pete <p...@claudia.dyn.dhs.org>
Subject Re: Can multiple URLs with a single IP address be mapped to discrete Applications in Tomcat 4.0?
Date Tue, 05 Feb 2002 09:13:49 GMT
Micael,

the SQUID solution lets you do it any way you like - you could map:

http://my.external.domain/MyFirstApp to http://192.168.0.1/MyFirstApp/

and:

http://my.external.domain/MySecondApp to http://192.168.0.1/MySecondApp/

and:

http://my.external.domain/MySecondApp/images to http://192.168.0.1:8080/


and http://my.external.domain/MyThirdApp to http://192.168.0.2:8080/MyApp/

(* You may have session/cookie/url problems with this example because of 
non-matching 'directory' names - MyThirdApp != MyApp)

Or anything else you like. Its completely arbitary.

The drawbacks are as I mentioned, with regard to cookies, sessions and 
relative URLs.

My situation is that i have 5 or so web servers internally, and only two 
or so domains, and only one external IP. All of my external domains are 
pointed at my single external IP, and SQUID handles the rest so 
http://my.external.domain/FirstApp/ is directed to an entirely different 
internal machine that http://my.external.domain/MySecondApp/ or 
http://my.external.domain/MyThirdApp/



Email me privately if you want more details on the setup

-Pete




Micael Padraig Og mac Grene wrote:

> Thanks, Pete.  I assume that you are saying that you map the request to 
> differing ports?  E.g. 192.168.x.x.:8080 for one and 192.168.x.x.:8081 
> for another?  If you are not saying that but are saying that it is 
> multiple IP addresses, i.e. the xs change, that is not my problem.  My 
> problem is with using a single IP.  I assume you know that, but am just 
> covering the bases.  I would much prefer an Apache or Tomcat solution 
> and assume there will be one.  If I get an answer, want me to forward it 
> to you?  (I will either get an answer or build one!)  Micael
> 
> At 08:15 PM 2/3/02 +1300, you wrote:
> 
>> What you are after is essentially a 'Layer-7 Switch'
>>
>> I do this with the SQUID proxy server and a perl script which rewrites 
>> HTTP requests using regular expressions to match URL fragments.
>>
>> e.g. all our domains are pointed at a single IP, and i map requests 
>> for external domain namesservers to internal servers e.g. 
>> http://www.mydomain.com/myapp/ gets mapped to 
>> http://192.168.x.x:8080/myapp/
>>
>>
>> There are a few hurdles to overcome with this approach, chiefly that 
>> cookies get set based on the server name and directory, which means 
>> that you need to match webapp names - i.e. you need to map 
>> http://externally.visible.domain/myapp to 
>> http://internally.visible.domain/myapp - trying to map e.v.d/myapp to 
>> i.v.d/someotherapp probably won't work properly with sessions etc.
>>
>> Also, you'll probably need to use absolute URLs in your JSPs etc. , 
>> since the client and the web server have different ideas about exactly 
>> what is being requested.
>>
>> I believe Apache has built-in URL-rewriting features, and Tomcat may 
>> do as well, however, I find SQUID works reliably for what I want to 
>> do, so I have not looked for another solution.
>>
>> One thing to be aware of with the SQUID approach is the fact that your 
>> proxy server is effectively opened to the net, and clients are free to 
>> request arbitary URLs from your proxy, letting them use your bandwidth 
>> to fetch their URLs. I see a surprisingly high level of abuse for a 
>> fairly obscure and little-used web server, with requests for 
>> banner-ads, machines with obvious viral infections and others trying 
>> to exploit my 'open' proxy server.
>>
>> However, a small perl script run daily by cron that parses the SQUID 
>> access log and bans IPs with IPTables that match abuse patterns takes 
>> care of that pretty quickly.
>>
>> Hope that helps
>>
>> -Pete
>>
>> Micael Padraig Og mac Grene wrote:
>>
>>> Clear question: No answers????
>>> The subject, supra, asks the question.  If you have a number of URLs 
>>> pointed to a single IP address, can you map the URLs somehow to 
>>> discrete web applications in Tomcat 4.0?
>>> I have read everything I know to read and cannot get the answer to 
>>> this.  I know I could do it with JBoss and Tomcat 3.2.4 and the 
>>> context manager.  But, I don't see that in Tomcat 4.0.  What's up?
>>> Sure is hard to get a response to this question.  Have no idea what.
>>> Please don't tell me the stuff that is simple and covered like how to 
>>> set up directories, etc.  I know how to handle aliases, how to handle 
>>> multiple IP addresses on the same machine, etc.  My question is 
>>> specific.  How can I get, e.g. www.aaaaa.com and www.bbbbb.com when 
>>> they are pointed to a given IP address, 209.43.251.66 (for example), 
>>> to map to webapps/aaaaa and webapps/bbbbb?  Or, is this not now 
>>> possible?
>>> Some people have suggested that, since I don't know the answer to 
>>> this, I need to essentially take the classes I teach for fun.  Lord.  
>>> If only they could answer the question instead of loading me with 
>>> pompous self-righteous drivel.  I do thank those who have tried.  I 
>>> don't know where to look at this point.  I may just write the classes 
>>> to do it.
>>> Micael
>>>
>>> -- To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>>> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
>>> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>>
>>
>>
>>
>> -- 
>> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
>> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
>> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>
>>
> 
> 
> 
> -- 
> To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
> Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message