in last 10 minutes
Virtual Hosting in 10 Minutes or Less
It doesn't require recompiling Aolserver, or anything really that complicated, and lets you share an IP address among multiple servers. You don't even need another instance of Aolserver. Just the main server needs to have OpenACS on it.
The only downside is that you get the port numbers in the address.
Try it with http://rubick.com or http://www.rubick.com
You should be redirected to http://rubick.com:8002
Here's how it works:
- you have a main server that does the redirects (this has to have OpenACS on it). Let's call this abc.com
- go to /admin/
- set up a package mounted at any old directory. Let's say /redirect
- go to Host-Node Map on the admin page
- set up def.com to go to the /redirect directory
- unmount the application in the redirect directory
- create a /redirect directory under /www/redirect
- inside this directory, put an index.vuh file.
Copy this inside it:
Substitute your port in for 8002.ad_page_contract { redirect @author Jade Rubick @creation-date 2003-04-24 Helpful .vuh example at http://www.arsdigita.com/bboard/q-and-a-fetch-msg?msg_id=000JTn } { } set path [ad_return_url] set page_loc "http://rubick.com:8002$path" set page "<html><title>Redirecting to Rubick</title><body>Moving to Rubick.com site<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"1;URL=$page_loc\"></html>" ns_write $page
One issue I had was getting www.rubick.com to work as well as rubick.com. The reason is you can't have two sites going to the same directory. To get around this, you'll have to create a redirect and redirect2 directory.
I wanted to use ad_returnredirect, but there is a bug in IE that prevents me from using it. Unfortunately, this means I have to slow down all users..
Other solutions
- Squid and tinydns method by Brad Duell. This method looks harder than what I've described above, but it may be a much better solution. I don't think it works with https.
- Aolserver Wiki Page dealing with virtual hosting