Hi All

I’d like to setup multisite configuration with the shared sign-on.

I have no preference of single versus multiple databases as long as users can sign-on only once to visit all three sites. Sites will be also linked together. I have c-panel on my account.

Desired setup using Drupal 5x (because of the Drigg requirements) would be:

maindomain.com
subdomain1.com
subdomain2.com (with the Drigg module working)
+ later added subdomain3.com ( non-Drupal script bridged to Drupal’s sign-on)

I have no knowledge of the Unix or PHP scripting and I am very new to Drupal. I’m looking for the simplest and the most functional solution to set up the sites as described above. I’d be glad to find step by step instructions.

I’d be grateful for pointing me in the right direction and for any advice coming from your experience in setting up multi-site configuration. Thank you.

gskyjr

Ps: Is there anything I should pay special attention to or take in consideration when setting up the above configuration?

Comments

pbarnett’s picture

We've used Domain Access (http://drupal.org/project/domain) to achieve this on http://mongolia.charityrallies.org/

Multiple sites. Single login. Neat.

Pete.

gskyjr’s picture

Thank you Pete

I’ll definitely check out the “Domain Access module”.

Have you ever had any problems with setting up or using this module?
Is there anything I’d need to pay special attention to when setting it up or using it?
Did you use it in conjunction with the “Shared Sign-On module” or alone?

Thank you,
gskyjr

pbarnett’s picture

Hi.

We used it alone, as it doesn't need Shared Sign-On. If you log into one domain, you're logged into them all.

I'd advise careful reading of the documentation, though!

The module was useful to us because it allows content to be selectively shared between sites if required.

Pete.

gskyjr’s picture

Hi Pete

What about the search engines, can they access all your sites?

The text file for of the “Multisite login” module http://drupal.org/project/multisite_login has warning that some of the multisite sign-on solutions might “block search engines from accessing your website”.

So, I’d like to make sure that there is no such problem present when using the Domain Access

Thank you,
gskyjr

pbarnett’s picture

We've had no such problem, and the site content for all domains is only indexed once which helps keep the server load down.

Pete.

WorldFallz’s picture

maindomain.com
subdomain1.com
subdomain2.com (with the Drigg module working)
+ later added subdomain3.com ( non-Drupal script bridged to Drupal’s sign-on)

I'm trying to understand your desired setup...do you mean subdomain2.maindomain.com or maindomain2.com? (subdomain2.com is not possible).

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

gskyjr’s picture

Thank you for everybody’s responses.

WorldFallz wrote:

‘maindomain.com
subdomain1.com
subdomain2.com (with the Drigg module working)
+ later added subdomain3.com ( non-Drupal script bridged to Drupal’s sign-on)’

I'm trying to understand your desired setup...do you mean subdomain2.maindomain.com or maindomain2.com? (subdomain2.com is not possible).

To clarify the setup:
Through configuring .htaccess files on my hosting account I can point my other domains (hosted on the domain server) to the subfolders of the main account (maindomain.com) so they would act as subdomains and had clean subdomain.com urls displayed to the search engines and the site’s visitors. So, in reality they will be subdomain.maindomain.com but they will display as subdomain.com

I do not know how this would work with the Drupal’s multi-site setup. Do you have any suggestions in this matter?

Thank you for any of your input on this topic and any further suggestions on the multisite configuration.

gskyjr

WorldFallz’s picture

ah ok, now i get it. sounds like an interesting approach, but i've no clue how it might actually affect drupal. I would think as long as you have the directories properly named in the /sites/all folder it should be fine.

however, one question that does pop into mind with this setup though-- say you have a subdomain of "subdomain1" and you've set it up to be rewritten with apache to "subdomain1.com" instead of "subdomain1.maindomain.com, as you suggest. what happens if there is an official subdomain1.com type site on the internet already? if the user enters "http://subdomain1.com" into their address bar, they will never make it to your site, right (unless you also have them make a dns entry in their local hosts file)?

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

gskyjr’s picture

WorldFallz - Thank you for brainstorming on the topic. It makes me see different angles of the set up and hopefully come up with the working and dependable framework for the sites I’d like to create

I do own the subdomain1.com and subdomain2.com domain names, so this type of problem shouldn’t occur. They are on the different than my host’s domain server.

Thank you,
gskyjr

WorldFallz’s picture

ah ok, that makes sense. I don't think drupal is going to care one way or the other-- just remember, you need all the names to point to the main root drupal directory (either with symbolic links or apache host directives, or any other method that you're familiar with).

for the single sign on part, i'd probably try to go with openid, but if not maybe http://drupal.org/project/multisite_login

===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime."
-- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz

gpk’s picture

>non-Drupal script bridged to Drupal’s sign-on

One way of doing that is to take the first 2 lines from Drupal's index.php to initialise the Drupal session from within your own script. Actually if you don't want access to the whole Drupal API from your script it would be sufficient to drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);.

You should also consider implementing your script as a Drupal module.

gpk
----
www.alexoria.co.uk

gskyjr’s picture

Hi gpk

You wrote:

One way of doing that is to take the first 2 lines from Drupal's index.php to initialise the Drupal session from within your own script. Actually if you don't want access to the whole Drupal API from your script it would be sufficient to drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);.

Could you please elaborate a bit on both:
on the “initialising the Drupal” and the use of the
sessiondrupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);?

How would I go about doing either?
I’m planning to use the commercial script for the subdomain3.com
It has its own login but it can be bridged to other applications.

I do not know PHP, so I thought of looking for a skilled help to bridge both applications. Maybe your solution is simpler, more practical and I could do it myself?

Thank you,
gskyjr

gpk’s picture

If the commercial script is located in the same folder as Drupal's index.php (http://api.drupal.org/api/file/index.php/5/source), then if you include the first 2 lines of actual code from index.php in the commercial script, you can access all Drupal functionality http://api.drupal.org/api/5.

Moreover you can do

global $user // Makes the current user's $user object available to the current script

and if the user has already logged in then $user->uid will be greater than 0, $user->roles gives their roles etc. etc.

The only possible issue might be if there is a conflict between Drupal's global variables and the script's. http://api.drupal.org/api/globals/6 should be a fairly complete list, for 6.x; 5.x will have most of these but there may be a few differences. You might be able to work round this by bootstrapping Drupal right at the start of the commercial script and then renaming any conflicting variables e.g. $drupal_user = $user; unset($user);

gpk
----
www.alexoria.co.uk

gskyjr’s picture

Hi gpk

Thank you for the explanation. I'll study more the content behind your links.

Re:

If the commercial script is located in the same folder as Drupal's index.php (http://api.drupal.org/api/file/index.php/5/source), then if you include the first 2 lines of actual code from index.php in the commercial script, you can access all Drupal functionality http://api.drupal.org/api/5.

One immediate question comes up for me:
The Drupal’s files (Drupal's index.php) and the commercial script would need to be placed in the different folders on my server (because of the folders structure there).

Would this method still work with the changed path pointing to the Drupal's index.php ?

Thank you,
gskyjr

gpk’s picture

OK in that case you just need to manually define the variable $base_path in settings.php. This is normally determined automatically during the Drupal bootstrap, but if you are also bootstrapping Drupal from your commercial script in another directory then you end up with a different $base_path which leads to a different session name and you then can't share the session cookie between Drupal and the other script. If you manually set $base_path then the session cookie will be correctly shared between the different scripts :)

gpk
----
www.alexoria.co.uk