Forum OpenACS Q&A: Multiple Hostnames ONE OpenACS - HowTo

I'm running www.site1.com on OpenACS 3x on a box with ONE IP address
I want to add www.site2.com which goes to ALL the same places.

www.site1.com/whatever/whoever.adp
is the SAME as
www.site2.com/whatever/whoever.adp

The /{server}/nsa.tcl config file has the var
set hostname www.site1.com

The /{server}/parameters/nsa.tcl config file

# URL to tell users to go to
ns_param SystemURL http://www.site1.com:3000

I am using Jerry Asher's Virtual Hosting.... and that is the reason for the port 3000 and the nsamain aolserver instance that does the redirection from port 80 to 3000.

What is the best way to do this?
What do I need to change?

How will this affect cookie logins?

I assume I will now have FOUR URLs to contend with that all do the same things:

www.site1.com
site1.com
www.site2.com
site2.com

We mostly use forwarding of domain email and my plan is just to double up the forwards

bob@site1.com
bob@site2.com

We are using postfix... Any Email suggestions? I plan to have aolserver only use one outgoing mail address robot@site1.com.

Thank You

-Bob

Collapse
Posted by Andrei Popov on
This has been mentioned before, far as I remember... Check this thread: https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0005Op&topic_id=OpenACS&topic=
Collapse
Posted by MaineBob OConnor on

Ok, this was easier than I thought... I just put site2.com into the Main instance of AOLserver and the redirect to the port 3000 aolserver WORKS... type in www.site2.com and end up at www.site1.com. GREAT...
AND
I imagine I can edit /parameters/nsa.tcl and change site1.com to site2.com so the NEW url will show in the browser.

NOW THE BUT

IF I change this in the parameters file, will I RUIN 26,143 perfectly Delicious Cookies of my users and end up requiring EVERYONE to LogIN again.

Can someone confirm or deny this?

And is there a way to prevent a Recall of all of our fine cookies?

-Bob

Collapse
Posted by Andrei Popov on
yes, you will ruin 'em all
Collapse
Posted by David Walker on
With plain OpenACS 3.2.x, ForceHostP on (or true or 1 or whatever), just add www.site1.com, site1.com, www.site2.com, site2.com to your DNS all pointing to the same address.

A request for www.site2.com/whatever/whoever.adp will be redirected to www.site1.com/whatever/whoever.adp. This solves the cookie issue because your www.site1.com cookies will be used regardless of whether they type in or link to www.site1.com or www.site2.com.

The drawback is that their address bar will always show www.site1.com. For many sites this isn't a big deal.
Collapse
Posted by MaineBob OConnor on

Ok Andrei, I may have to ruin 'em all. And David, I now have it working with both domains with site1.com as the primary.

We do want to make site2.com as the new primary name and depreciate the site1.com name over time. I was hoping to avoid it but you guys confirmed that my cookies must crumble!

My latest thinking is to do something like a blast email to everyone with username email and password so everyone will have it and can get the new *improved* site2.com cookie.

Thanks.
-Bob

Collapse
Posted by David Walker on
If you're serious about conserving their cookies you could write a
page on site1.com that redirects to something like
site2.com/cookie_pass.tcl?cookie=${site1_cookie} and have that page
set the cookies from site1.com into site2.com