Forum OpenACS Q&A: Response to Multiple domains on same server/ip

Collapse
Posted by Ivan Histand on
Thanks all for your responses. I've done quite a bit of research and experimentation the past few days, and these are my findings:

- nsvhr/nssock works. However, I don't like it, because it doesn't proxy, it redirects. For example, if I run a master server on port 80 and slave on 81, a request for http://foo.com/ immediately gets redirected to http://foo.com:81/ This is ugly and really not doing anything more than I could do with a META REFRESH= tag in an index.html page.

- nsvhr/nsunix is buggy. Sometimes it works, sometimes it doesn't...core dumps, etc. Dead end unless someone smarter than I fixes it.

- SQUID seems like it would be an ideal solution, but the documentation and examples for implementing it as a reverse proxy are slim and I gave up trying to get it to work.

- I didn't try any of the tcl-based solutions, as I decided I would prefer a proxy solution giving each domain it's own OACS instance.

- AOLserver4 supposedly has built-in virtual servers. I downloaded the beta, compiled it, installed it, no mention of virtual servers at all that I could find. Dead end.

- Apache works, as advertised. I simply set up an httpd listening on port 80, and used the NameVirtualHost directive as per the examples here: http://httpd.apache.org/docs/vhosts/examples.html This was a last resort for me because It seemed dumb to have to set up two brands of http servers to do what seemed like a simple task, but I guess that's life.

So my final configuration is:

- All domains have DNS entries pointing to the same IP

- Apache listens on port 80 and proxies via VirtualHost

- Each domain has it's own nsd/oacs instance, listening on localhost:81, localhost:82 etc.

This is probably not very scalable, but for me it's going to be a max of maybe half-dozen low traffic domains, and I'm fairly certain it will scale that far at least. On the plus side it is extremely flexible, if a site starts getting lots of traffic it would be trivial to pass all or some of it off to other machines.

For anyone interested here's a psuedo section from my httpd.conf file, everything else in that file is pretty much standard:

Ivan