Hi Adrian,
I am trying out this module some more, along w/ singlesignon. In my scenario, I have one database, and three URLs:
mainurl.com (master)
sub1.mainurl.com
sub2.mainurl.com
Is it possible to use multidomain and have one database, one code base, and just show content on these three different URLs? I guess I am not totally clear on which setups will work and which do not.
I saw this explanation http://drupal.org/node/49605 which explains to setup ServerAlias for the virtual host of the master. Does anyone have more specific installation instructions and options? What I have done so far -
Setup a multisite setup -
sites/mainurl.com/settings.php
sites/sub1.mainurl.com/settings.php
sites/sub2.mainurl.com/settings.php
I've setup the $db_url the same for all three of the sites (same database) and not using any de prefixes - just entirely sharing the database. How much of the SSO setup needs to be followed? It seems that SSO is not working, but I am wondering if something with my multidomain setup is not right.
Ian
Comments
Comment #1
adrian commentedMultisite and multi-domain are two (subtly) different creatures.
Multisite requires you to set up multiple databases / configs.
Multidomain only requires one database / config.
The way the matching of the sites directory works, sites/mainurl.com will match *.mainurl.com.
All that is necessary is that your virtual host has a server alias for each of the subdomains you want accessible via it:
IE
If this answers your question, could you please change the status to fixed ?
Comment #2
Ian Ward commentedHi Adrian,
Thank you for the tips. It seems to be working now, I still need to text it further, but SSO is now working and it seems to rewrite links correctly now. What I was doing wrong, in case it helps others -
* I setup a subdomain in the DNS zone for the slave domains - I guess I should not have, and so I removed it.
* I have the site configured like a multisite, and had the sites directory like: "sites/www.domain.com/", but i did not have a symbolic link default -> www.domain.com/. I set up the symbolic link for default, so the requests will find the settings file in /sites/www.domain.com/
* I setup the ServerAlias as you suggested above, Adrian.
Now, what I am wondering now, is how this would work if you were using an entirely different domain? I imagine you'd then need some type of DNS records. For now, with one master domain, and subdomains within that master domain, this is working.
I will try to adapt these instructions for the readme in case they're useful to others.
Thanks!
Ian
Comment #3
Ian Ward commentedsorry, forgot, setting to closed.
Comment #4
adrian commentedFor the DNS thing, you can also use a wildcard dns entry.
ie:
In the future I plan to make a userdomains module, which extends this module, which will allow automatic aliasing of all user blogs to a subdomain. This will _require_ a wildcard dns entry.
Comment #5
edeleon commentedHello i did the same to get my site working, you said that we only need one config. i got 2 sub domains 1 for english and 1 for spanish site, and i want to know if i can get a different frontpage for each sub domain?
and another question. I want to use the blog node types only for the english sub domain, so i checked the "Use this domain for the following types of posts" option, and configure "Use this domain for specific pages" using "Match only the listed pages" with blog/* value. I was expecting that if i used blog on the spanish site drupal redirects me to the english sub domain, but nothing happens and all the entries on the blog appears on the spanish site, how can i separate content from one site to another???
Comment #6
druvision commentedUsing the Cpanel WHM, I clicked 'Edit DNS Zone', selected my domain, and added a wildcard record, '*' with CNAME pointing to my primary domain name.
Works great - you can see it in my home site - http://www.levavie.com
Comment #7
summit commentedHi Adrian,
That Userdomains module plan you are describing looks exactly what I am waiting for.
I hope you succeed in this!
Greetings,
Martijn