Hello,
I have been running Drupal 5 for little over a year now. Original plan was to implement some sort of multisite installation,
with one database (with table prefixes for each "site"), all running the same code. After many hours of reading and testing,
I gave that idea up - we did not find a working solution for multisites when using ISP (like one.com). It did seem like creating
symlinks was the way to go, but that was not allowed by our ISP (possibly there are other settings at ISP that we don't have
controll over that restricts us further).

Now to the question:

Is Drupal 6 containing "something" that can make a multisite setup easier for sites running on ISP:s, or will the setup be the
same as in the Drupal 5 version?

Regards,
Mike

Comments

Mavros Gatos’s picture

What's your control panel?

Should subsites be on different domains?

mi-sjo’s picture

Not sure what you mean with control panel? Configuration options at my ISP?

I have one main site with sub-domains = one domain account.

- main site - www.example.com (w/ drupal code)
- subsite1 - subsite1.example.com (also with drupal code)
- subsite2 - subsite2.example.com (also with drupal code)

All site sharing the same db. It is no longer possible to maintain code for all sites.....

BTW: I would also be interesting in hearing about other ISP:s/webhotels that "allow" a Drupal multisite installation..

Mike

Mavros Gatos’s picture

Control panel, examples: CPanel, Direct Admin.

I haven't tried with subdomains, but I think for them you don't have to do anything with domain settings: just create subdomains.

So, write what steps have you done and where do you stop? I'll try to help you.

mi-sjo’s picture

ok, I guess this is where my knowledge is limited. Because of this I have not tested any config changes for my domain account.

On the support pages for one.com it shows some of the settings available - is this what you had in mind?

https://www.one.com/no/support/guide/advanced/dns

One.com explains on their pages that customers can create subdomains by:
1) add folder to web root
2) folder must contain index file

Access subdomain with http://www.example.com/subdomain or http://subdomain.example.com.

I don't know if this can be "integrated" with the way Drupal works.

As far as I recall, we ended up with no solution because of restrictions (follow symlinks, create symlinks) and no access to php.ini
(where "alias" sites could be added...). But, parking domains and other advanced DNS settings is not tested due to little knowledge...

Mike

Mavros Gatos’s picture

> On the support pages for one.com it shows some of the settings available - is this what you had in mind?
> https://www.one.com/no/support/guide/advanced/dns

I think it's what you need. The principle is to add Domain Pointer (as Alias).
It works like this when domains are subsites: subsite.com should be added as Alias to main site. But when I tried to add subdomain as alias, it didn't work.

I hope you'll get the result.

Mavros Gatos’s picture

Hi, did you solve your problem? I've just found out, that subdomains work the same way as domains: just add Domain Pointer as Alias.

mi-sjo’s picture

The hosting company does not recommend using web-aliases internally on the same domain - "odd things may appear"..as they say.
Anyways, I will give it a try on my test domain to see how it works. Will report back shortly.

Mike

mi-sjo’s picture

....good?

Have now configured web-aliases to "re-direct" sub1.example.com to www.example.com. Web-aliases "keeps" the URL in the browser so I guess this
is the right thing to use. The support people at one.com have confirmed that the settings are correct, based on the information I have given and how
Drupal is working. I got re-directed to www.example.com after pointing the browser to sub1.example.com, so that looks right.

---------------------------WEB-ALIAS Settings-----------------------------------------------------------
Domain Type Value
sub1.example.com Web alias example.com
---------------------------------------------------------------------------------------------------------

Then, back to the Drupal stuff:

I created a new folder in the sites directory:

sites/sub1.example.com

Uploaded a settings.php file to the sites/sub1.example.com with the following settings:

$db_url => not changed, using the same db as the main site
$db_prefix => set to an already existing prefixed table (different than main site)
$base_url => tested setting this to 'http://sub1.example.com'; and commenting it out alltogether

Now, both http://sub1.example.com and http://www.example.com gets me to the same place (www.example.com).

Looks to me that Drupal does not 'understand' where to go?

I'm I missing something?

BTW: Tried adding symlink through php, but one.com is running php in safe mode so that is not allowed...

cog.rusty’s picture

Don't set the $base_url while troubleshooting, to be able to see if the menu links have the right URL.

Do you mean that when you browse to http://sub1.example.com it doesn't load the database tables with your other prefix?

mi-sjo’s picture

now commented out in settings.php.

Yes, browsing http://sub1.example.com does not load the tables with the selected prefix...

cog.rusty’s picture

Sanity check: Open sites/sub1.example.com/settings.php again, and check if your $db_prefix has been actually saved. Often I forget that Drupal automatically write-protects settings.php and its containing directory.

The next thing I would try is to give the main site its own sites/example.com directory and move its settings.php file there. That way, I would know if the subdomain just fails and falls back to sites/default, or if, because of the way it was "aliased", it is somehow connected with the main domain and follows it around.

mi-sjo’s picture

The settings.php file(s) were correct.

I have now (and this is checked numerous times now...):

sites/default
-> default.settings.php (original file, not edited)
sites/example.com
-> settings.php (db_prefix = 'main_';)
sites/sub1.example.com
-> settings.php (db_prefix = 'sub1_';

Accessing www.example.com or sub1.example.com still brings med to the 'main' site (www.example.com).

So, does this mean that the web-alias settings isn't working as expected?

Mike

cog.rusty’s picture

It would seem so...

To be 100% sure whether or not the subsite is reading the sites/sub1.example.com/settings.php file, add a $conf['site_name'] = 'This is the sub-site'; line at the end, to try to give it a title directly from this file and not from the database.

If
- the title of the subsite does not change
- there is no spelling error between the subdomain name and the name of the directory
then the alias doesn't work, the request URL received by Drupal is not sub1.example.com, and Drupal never checks that directory.

mi-sjo’s picture

did not make any difference, so I guess it seems like the re-direct does not work. I will check with one.com in the morning to see if they
can help me out. Will double check all spellings also.

Thank you very much so far!

Mike

mi-sjo’s picture

one.com could not provide me with any further help..
Wonder if settings in .htaccess could play a part?
For instance, to get my main site to work I had to comment out:
#Options -Indexes
and
#Options +FollowSymLinks

If this doesn't affect the way Drupal behaves it might give a clue on what (security) settings that are in place at one.com
(i.e. php.ini, http.conf...)?

Mike

cog.rusty’s picture

Try this:
- Go to your sub1.example.com site
- Make sure that the "php filter" module is enabled in admin/build/modules
- Create a test page using "php code" input format.

Enter this:

print $_SERVER['HTTP_HOST'] . <br />;
print conf_path();

Preview this node.

Compare the two lines that it prints, and also compare with the URLs that you see in the browser's address bar and in the menu links. Do they all contain the subdomain "sub1."?

mi-sjo’s picture

Think you are on to something here...

Result:

example.comsites/example.com

So, the "sub1" name was not existing. Changed directory name in ~/sites from:

sub1.example.com to just example.com

Then it seems like the database tables (specified in ~/sites/example.com/settings.php) is loaded.

Must run home now, but will test this more in a while.

Mike

mi-sjo’s picture

Guess I got exited to quick.. but it was a good way to check what is going on.
The 'sub1' is not in the query result so drupal is only reading the settings.php in the default
directory....

print $_SERVER['HTTP_HOST'] . '<br />';
print conf_path();

URL= http://www.example.com
-----------------------------------
www.example.com
sites/default

URL = http://sub1.example.com
-----------------------------------
example.com
sites/default

Not sure why the 'sub1' is filtered (?) away.

cog.rusty’s picture

Are you still seeing "sub1." in the address bar and in the menu links? Even without having set $base_url? (because $base_url forces the menu links to whatever you tell it, and can mislead)

I remember once that I was using a dynamic domain service, the site was somehow "framed" in the URL which they gave me, and browsing deeper inside the site wouldn't change the URL path. This one has a similar smell.

mi-sjo’s picture

sub1 is part of the address, but not in the menu links (they only say 'example.com').

But most importantly, I have the same situation as you talking about with "framed" URL.

Choosing, for instance, "Create content" link, the url in the address bar stays the same (sub1.example.com),
but nothing after this (missing the ~/?q=node/add).

Do you recall if that was a problem that could be solved?

Mike

cog.rusty’s picture

No, that was a fundamental flaw of the way they were doing it. It was neither DNS aliasing of the domain with a CNAME record, nor an Apache virtual host.

Check for different options in your subdomain setup panel.

What was the problem with symlinks and safe mode? Is your public_html directory owned by apache and not by your own account? If that is the problem, then maybe you could upload or create the script through Drupal in some way, so that the owner of the script is the same as the owner of the directory.

mi-sjo’s picture

thanks a lot for your help. I will look around for a possible solution. Will update this thread with the stuff I find.

Mike

mi-sjo’s picture

Managed to create symlinks finally. Uploaded script file through Drupal and moved it around a bit.
I now have some symlinks in my web root, but will this do any good if I still have to live with the
fact that 'follow symlinks' option isn't allowed?

Setting in my .htaccess file:

# Follow symbolic links in this directory.
#Options +FollowSymLinks

Mike

cog.rusty’s picture

Maybe it will. I don't know if FollowSyminks is off, or if they just don't let you use an Options directive to change its setting. If you created a regular subdomain, deleted its directory, and replaced it with a symlink you will know soon.

mi-sjo’s picture

one.com confirmed that when using web-alias'es the "new" window is running through iframe,
which does not work so good... I have over the weekend tested another ISP which takes pride
in beeing open source friendly. They are using CPanel - so now I know what you are talking about:-)

How easy it can be! Followed the howto:s on drupal.org (multisite+cpanel) - setup works in minutes!

Will test this further now, configuring different themes, modules etc.

Chears for now.

Mike