Forum OpenACS Q&A: Virtual Hosting - OpenACS 3.2.5
- it doesn't know what to do with settings parsed during the server startup (It just takes those settings from the primary/default /web/<servername>/parameters/<servername>. tcl)
- with the right coding it is possible to read settings and connect to database pools for other virtual servers
Does OpenACS 4 do virtual hosting?
I would like to see the ability to host multiple OpenACS's in a single hostname (for use with SSL) and to do that the code must be in OpenACS
Right now I'm intercepting calls to ns_url2file, ns_db gethandle, and ns_info pageroot and a few other functions. This approach probably wouldn't work with java or C modules since I'm intercepting at the tcl layer.
If no one else is interested I'll just keep it to myself then.
Virtual hosting means multiple domains, so you might be out of luck unless it is possible to load multiple nsssl modules each listening on a different ip. (Has anyone ever tried this?)
However, one ssl module can be used if you don't mind the browser popup warning of a domain name mismatch for one or more of the domains.
My VAT module has instructions for hosting more than one domain from one OpenACS install. Just keep in mind that aD never did anything to help with this situation. You can get a current copy of the VAT at: http://zmbh.com/discussion/vat/. Feel free to bug me over any install problems. As an example of two servers sharing one OpenACS: http://saleonall.com/ and http://stellardata.com/
https://secure.vorteon.com/client1/ecommerce/ refers to the ecommerce module of client1
https://secure.vorteon.com/client2/ecommerce/ refers to the ecommerce module of client2
http://www.client1.com/bboard/ refers to the bboard module of client1
and http://www.client2.com/bboard/ referst to the bboard module of client2
all within a single instance of aolserver 3 series.
I forgot to mention that a single set of TCL procedures will apply to all the sites included.
I already have this working for the domain names but not yet for the domain name + subdirectory idea.
The VAT module includes a templating system. Templates are grouped into modules. Currently the module name is the first directory under pageroot. So in http://example.com/ecom/ 'ecom' would be the module name. If you had a script that showed the cart contents, that template would be named 'cart', for instance. if you set this up correctly, then visiting /ecom/cart would run the cart script and template. But the cart ending can be used anywhere under /ecom/, so you could encode the client number into the url just as well: /ecom/client1/cart. I have a simple proc that pulls the variables out of the url, that I have posted to this forum in the past. With this method, you can have one set of scripts and templates for many clients.
Sorry to confuse everyone. In the future, when I use the phrase "virtual hosting" it shall mean a piece of software that uses the Host header to help distinguish what content to serve the request.
For me, if I am managing a set of sites, I find it simpler to have the same functions on all of them. The functions you mentioned could easily be customized to pull their values from the virtual server's parameters/<servername>.tcl, the database, some site templates, or just to use a bunch of if statements. In fact, they probably should do that anyway since they are really part of the front end face to the public and not really a backend function like the rest of the functions.
For me it beats updating a bunch of sites with the exact same information and risking overwriting a function that I customized without thinking about it in addition to being great for a bunch of small sites that I would still like to have all the OpenACS features without the overhead of a separate environment for each of them.
I believe you can achieve what you're thinking of in OpenACS 4 by using the "subsites" feature. If I understand things correctly you can create as many subsites as you like and mount them under suitable urls beneith your domain, each having their own instance of the config params, master template etc...
I tried to follow the "skin" demo in the docs that demonstrates this, but it crashed at some point. Try it out soon when OpenACS 4 has come further along...(OpenACS 4 is already looking *very* interesting though)
i.e. http://www.vorteon.com/grax/ and http://www.grax.com/ serve the same info?