Forum OpenACS Q&A: One IP, Many Domains

Collapse
Posted by Andrew Smith on
Hi,
      In apache there is a facility to serve multiple sites on 1 IP  using virtual host

      I have 2 openacs development sites running using aolserver
on port 9191 and 9192 .

      I have to specify these ports to view the sites.

      Can I configure apache or aolserver such that a request coming for www.test1.com  is served by 9191 and www.test2.com by 9192

Regards.

Collapse
2: Re: One IP, Many Domains (response to 1)
Posted by Jarkko Laine on
Yes, you can. Jerry Asher has written a Howto for this. I think it's only reachable with the wayback machine: http://web.archive.org/web/20010831042526/http://www.theashergroup.com/tag/articles/nsvhr/virtual-hosting-howto
Collapse
3: Re: One IP, Many Domains (response to 1)
Posted by Don Baccus on
AOLserver used to have this capability.  Then the AOL team ripped it out during the 3.0 rewrite, I believe, because they don't need it.  Thus Jerry's work to put it back in.

The good news is that the feature's been put back into AOLserver 4.0, which is currently in beta.  The beta has a couple of bugs that break OpenACS but the current CVS tip looks good.  In fact our own Jeff Davis is going to be testing it in the next week or so to verify that 4.6 works with it.

You can then expect an AOLserver 4.0 final release in a few weeks, maybe the end of this month.

Collapse
4: Re: One IP, Many Domains (response to 1)
Posted by Jon Griffin on
But, the immediate answer is yes, Apache can do it, but I would recommend squid, unless you already use apache.

google for "reverse proxy squid" and it is fairly easy to setup. You will lose the logs this way though as AOLserver doesn't recognize the X-Forwarded For header (squid keeps the original request anyway).

Collapse
5: Re: One IP, Many Domains (response to 4)
Posted by Bart Teeuwisse on
I'm using nsvhr/nsunix without any problems. Dossy adapted Jerry's work for AOLserver 3.5 and is available for download from the aolserver CVS. The tags are nsvhr and nsunix.

I've also tried Pound (http://www.apsis.ch/pound/) but that proved to be incompatible with a series of ns_writes as used in ACS bootstrap. Pound closes the pipe immediately after the HTTP headers are returned and subsequent never make it too the client.

The nsvhr/nsunix combination is fairly light weight and you don't lose any logs.

/Bart

Collapse
6: Re: One IP, Many Domains (response to 1)
Posted by Jon Griffin on
Bart,
I am glad to here the patches were ported to 3.5, I will try them out.
Collapse
7: Re: One IP, Many Domains (response to 1)
Posted by Dave Hwang on
I just set up a configuration using squid, using its "HTTP accelerator mode". Basically, you need to download and set up the following:
  1. Squid
  2. Rob Mayoff's dqd_log module to log the X-Forwarded-For address as the requestor's IP
  3. squirm to write the forwarding (and filtering rules)
Basically, set up your servers with IP on the loopback interface (e.g. 127.0.0.10, 127.0.0.11, etc.) You can set up squid to accept SSL connections on the public IP and forward them to the non-SSL servers. You also get the Squid's ability to cache pages, which hopefully will reduce the number of hits to your db-backed web-server if you get slashdotted, and lastly, squirm allows you to speficy filtering rules that apply accross all your forwarded sites (e.g. to drop Code Red/Nimda probes).
Collapse
8: Re: One IP, Many Domains (response to 1)
Posted by Jon Griffin on
The dqd log module doesnt work with 3.5 does it?
Collapse
9: Re: One IP, Many Domains (response to 1)
Posted by Dave Hwang on
Don't know. I've only been using it with aolserver3.3+ad13
Collapse
10: Re: One IP, Many Domains (response to 1)
Posted by Tomasz Kosiak on
I've compiled dqd_log under AOLsever 3.5. You have to tweak dqd_log Makefile to make it compatible with new AOLserver build process introduced in 3.5.

I belive you only have to define CP and maybe RM like this

# needed by dqd_* modules
CP=/bin/cp -fp
export CP

Or use as template a Makfile from a core AOLserver module.

On the main topic:

Using nsvhr separates you virtual server into separate processed. With AOLserver 4.0 you can have totaly separete AOLserver 3.x-like servers (almost the same) but in one AOLserver 4.0 process. I have AOLserver 3.x exention (which could be ported to AOLserver 4.0) that allows you to have in one virtual server many sub-virtual server that have separate:
- filters
- urlspace
- traces
It suits my need to have one TCL code base, but to serve sites with different url layout.
I'm in the process of cleaning it up so I could release it to the public.