Multisite doesn't work on Hostmonster - Solved

Events happening in the community are now at Drupal community events on www.drupal.org.
ergunk's picture

Hi everyone,

I exactly followed intructions explained here: http://drupal.org/node/125539

Except, i used SSH symlink instead of multisite.php trick:

ln -s ./drupalsite ./subdomain1
This symlink only creates shortcuts for all files and folders of drupalsite(original drupal installation) in subdomain1(new multisite). When i navigate subdomain1 it takes me to drupalsite not to subdomain1's install page. If i navigate subdomain1/install.php, i get a 404 error. When i look at subdomain1 folder via FTP program i see the same files and folders as drupalsite folder.

Everyone that followed these intructions seems succeeded; so what's my problem? Is it about Hostmonster or am i missing something?

I also tried this:
ln -s ./drupalsite/sites/subdomain1 ./subdomain1
When i navigate to subdomain1 it shows directory listing.

I tried for add-on domains, subdomains and all possibilites i can figure. No success... :(

Comments

When i navigate subdomain1

frankcarey's picture

When i navigate subdomain1 it takes me to drupalsite not to subdomain1's install page...

This sounds like it is pulling from the default folder. Drupal uses the domain name to direct requests to the correct folder in you sites directory. if your site is www.myfirstsite.com and you 2nd site is www. mysecondsite.com, then you should have at least 1 extra folder in your sites directory, with it's own copy of settings.php (this should be a virgin copy if you want to run install.php)

If Drupal gets a request for www.myfirstsite.com , it first looks for www.myfirstsite.com folder, if it doesn't find that it looks for myfirstsite.com folder (all subdomains not having thier own folder point here) and if it doesn't find that, it looks for the default folder.

If Drupal is giving you the wrong site (wrong database), then you with have misnamed your site folder or your settings.php still has your old database inside it. You can test by editing the new settings.php and making the database changes manually, or putting a virgin copy of settings.php in there instead.

Hope this helps
Frank

When i said "I exactly

ergunk's picture

When i said "I exactly followed intructions explained here: http://drupal.org/node/125539", I thought it would be clean enough; but it seems it is not. So, to make sure, i should tell the steps that i followed:

1 - I installed Drupal on www. myfirstsite.com and it works fine.
2 - I created a seperate database for www. mysecondsite.com
3 - I created a folder named mysecondsite.com under myfirstsite.com/sites
4 - I put a settings.php that speacialized(database and base URL) for mysecondsite.com to myfirstsite.com/sites/mysecondsite.com folder. And i also created files and themes folders in same folder.
5 - I set up an add-on domain(i also tried subdomain version) for mysecondsite.com
6 - On SSH panel i used following commands:

  • cd public_html (change current directory to public_html)
  • rm -Rf ./mysecondsite.com (deletes the folder which c-panel created)
  • ln -s ./myfirstsite.com ./mysecondsite.com (creates the symlink)
  • ls -la (to see if symlink created properly; and it was)

7 - I navigated to mysecondsite.com and i experienced problems i stated in my prior message.

I also tried:

  • Naming folders without domain extensions(eg. mysecondsite)
  • Multisites for domains, subdomains, subfolders etc.
  • Using multisite.php instead of creating symlink via SSH
  • Symlink mysecondsite.com to sites/mysecondsite.com folder instead of myfirstsite.com folder
  • Not using symlinks
  • and lot of things that i don't remember.

...but still no success.

Anyway, thank you Frank; for your interest and effort. :)

Since you seem to have full access

HansBKK's picture

Since you seem to have full access, why are you following that guide? I believe it's an edge case post, which I would only follow if I was restricted to CPanel's facilities.

Try just following the regular instructions for editing the settings.php and running install.php, it's really quite straightforward and I've never had an issue following them.

Also, maybe work on a localhost setup in parallel so you can isolate anything that might be specific to your hosting situation.

Finally, your paths as you write them seem strange to me, you might want to specify them including drupal/ on down so it's more clear, for others to confirm you've got them right.

PS sarcasm doesn't encourage people to help you

"Since you seem to have full

ergunk's picture

"Since you seem to have full access, why are you following that guide? I believe it's an edge case post, which I would only follow if I was restricted to CPanel's facilities."

I don't have full access beyond Cpanel. If you mean SSH access, I'm not familiar with Unix enviroment. Can i do something more than symlinks via SSH? Can i modify httpd.conf file?

"Try just following the regular instructions for editing the settings.php and running install.php, it's really quite straightforward and I've never had an issue following them.

Also, maybe work on a localhost setup in parallel so you can isolate anything that might be specific to your hosting situation."

I don't have any problem with regular Drupal installation and installing multisite on localhost. I have a shared hosting account on Hostmonster, not VPS. So i can't modify httpd.conf or other server related files(as far as i know).

"Finally, your paths as you write them seem strange to me, you might want to specify them including drupal/ on down so it's more clear, for others to confirm you've got them right."

I wanted to use Frank's example to have a better communication.

myfirstsite.com = Original Drupal installation
mysecondsite.com = New multisite under myfirstsite.com/sites/

"PS sarcasm doesn't encourage people to help you"

This is the most important point of this reply. I am not sure what you mean. If you are talking about this:

"When i said 'I exactly followed intructions explained here: http://drupal.org/node/125539', I thought it would be clean enough; but it seems it is not."

Yes, there might be less sarcasm and much waggery in that. But most important point was: Nobody has to look at an external source. It was my responsibility to make my situation clear enough. I shouldn't have been lazy and told it step by step. So i continued with "I should...".

If you mean this:
"Anyway, thank you Frank; for your interest and effort. :)"

There was no any sarcasm. I mean it sincerely. I appreciated his interest and effort.

I am not a native English speaker(as you can notice); sorry for my poor English. :(

Thank you.

some answers and more questions

HansBKK's picture

I've never seen the need for symlinks, why would you need them?

I don't know about your hosting environment, but if you have SSH you certainly should be able to cd, cp, mv etc within your own filesystem right?

re your filesystem - so myfirstsite.com is the name of your main account's root folder and contains drupal's install.php, index.php etc?

that should mean that under sites you have another myfirstsite.com at the same level of mysecondsite.com, each of which contain a settings.php and files and tmp folders right (maybe themes and modules too if you have site-specific of those). Personally I leave default at a "virgin" uninstalled state so I can quickly copy it to a new site folder to set up a scratch site.

and the $db_url settings in those settings.php point correctly to existing DBs

If this isn't your current setup, then please post corrections, or try these out and see if it fixes your problem

re hosts.conf again I don't know about your hosting environment, but however they do it there, all the server/domain names should point to the same folder, your root drupal folder where index.php is.

Drupal will then handle serving up the right site based on the incoming URL matching your folder name under sites.

re sarcasm I meant the "clear enough", sorry if I misinterpreted.

Drupal MULTISITE on shared hosting: One codebase, seperate DB

ergunk's picture

"I've never seen the need for symlinks, why would you need them?"

To create symbolic links between new multisite and original Drupal installation. You have to link them; so Drupal can detect and control new multisite. On a shared hosting, mostly you don't have access permision for server level files(and even for SSH on some hosts).

"I don't know about your hosting environment, but if you have SSH you certainly should be able to cd, cp, mv etc within your own filesystem right?"

I can use that basic operation commands but they doesn't help and they have anyting about multisite settings. I already am able to create, delete, move files and folders via FTP UI.

"re your filesystem - so myfirstsite.com is the name of your main account's root folder and contains drupal's install.php, index.php etc?"

Yes.

"that should mean that under sites you have another myfirstsite.com at the same level of mysecondsite.com, each of which contain a settings.php and files and tmp folders ... up a scratch site."

My folder structure:

public_html (main web folder of my hosting account)

public_html/drupalsite (main Drupal installation)

public_html/drupalsite/sites/default (folder for main Drupal ins.): It has a speacialized($db_url and $base_URL) settings.php.

public_html/drupalsite/sites/newmultisite (folder for new multisite): It has a speacialized($db_url and $base_URL) settings.php.

Folder structure, necesarry files and settings are correct.

"re hosts.conf again I don't know about your hosting environment, but however they do it there, all the server/domain names should point to the same folder, your root drupal folder where index.php is."

THAT IS WHAT MY PROBLEM IS ALL ABOUT. To achieve this: "all the server/domain names should point to the same folder, your root drupal folder where index.php is" you have to use symlinks if you dont have access permission for httpd.conf.

Thank you Hans.


My subject is Drupal MULTISITE installation on shared hosting: One codebase, seperate databases. The steps i stated above(my second message) are necesarry to achieve working Drupal multisites on shared hosting enviroment(If you have VPS account you can pass the step #6 and use httpd.conf method). And i checked these steps by comparing other tutorials i found on Google. But these steps couldn't lead me to success(Please read my first message for issues i experienced).

The problem might be about Hostmonster. If there is somebody who installed Drupal multisite successfully on a shared hosting(preferably on Hostmonster); please tell the steps you followed.

OK

HansBKK's picture

Seems like working in this type of hosted environment is very different, and my *nix knowledge obviously isn't up to snuff yet. And it might not be relevant, but I'm still puzzled about your folder names. The directory you're calling "newmultisite" - I hope that's just a placeholder name, not its real literal name.

It should be the name of the actual domain and not anything else.

So for what it's worth, here's what I recommend:

Forget Drupal to start with, put a single hello world index.html file in your /drupalsite/ root and get your host account set up so that all the domains you want to run on Drupal serve up that hello world: www.example1.com example1.com www.example2.com example2.com etc etc.

Then do an upload of a virgin Drupal filesystem so that index.php and install.php are in the same place as the index.html. Copy the sites/default to

public_html/drupalsite/sites/example1.com

public_html/drupalsite/sites/example2.com

third etc

These should contain the settings.php pointing to the correct DBs/prefixes whatever. I'm not sure what you're trying to say by "specialized" (note spelling), these are just normal settings.php files.

And of course empty files and tmp (except for htaccess) etc.

public_html/drupalsite/sites/default should IMO be left at virgin unconfigured settings.php, but I guess if you don't want to do it that way that's fine, you just have to make sure you then DON'T have an example1.com folder if that's the domain hosted from default.

Then delete/rename the index.html and go to the domains and run the virgin installation routines.

Only after all of that is complete and working should you then restore up your themes, modules and database contents.

It might also be helpful to others trying to understand your problem if you post the actual lines from your settings.php files.

I am telling it again :)

ergunk's picture

1 - I installed Drupal on public_html/example.com and it works fine.

  • example.com is just a placeholder that i made up for this reply. not a literal-real name. I don't get why did you think that i would by a domain name like "newmultisite.com" or "myfirstsite.com".
  • example.com is the main, virgin, clean Drupal installation.
  • There is no problem with this Drupal installation

2 - I created a seperate database for example1.com
- example1.com is just another madeup-dummy name not real...
- example1.com is my first multisite

3 - under example.com/sites folder, I copied "default" folder and named it as example1.com

4 - I changed the settings.php that is under example.com/sites/example1.com folder as follows:

$db_url = 'mysqli://example1_username:example1_password@localhost/example1_db';

$base_url = 'http://www.example1.com';

And i also created files and themes folders in same folder.

5 - I set up an add-on domain(i also tried subdomain version) for example1.com

6 - On SSH panel i used following commands:

* cd public_html (change current directory to public_html)
* rm -Rf ./example1.com (deletes the folder which c-panel created)
* ln -s ./example.com ./example1.com (creates the symlink)
* ls -la (to see if symlink created properly; and it was)

7 - I navigated to example1.com and i experienced problems i stated below:

PROBLEMS:

  • When i navigate example1.com i see example.com's content not example1.com's installation page.

  • If i navigate example1.com/install.php, i get a 404 error.

  • When i look at example1.com folder via FTP program i see the same files and folders of example.com folder. Because symlink creates shortcuts for all files and folders of example.com in the example1.com folder. When i put a new file to example1.com folder i also see the same file in example.com folder. If i delete a file from one of these folders, it will be deleted from other folder too.

PS: Thank you very much Hans. I tried my best to make it clear. And i think it is clear as much as possible. I read hundreds of page, i tried more than hundred times with different methods; and i gave up. This must be about Hostmonster. Because everyone was successful with basic instructions; but they did not work on Hostmonster. If there is anybody succeed in installing Drupal multisite on Hostmonster shared hosting account(not VPS or other hosting firm); please give me this big SECRET! :)

I also use Hostmonster

j0hn-smith's picture

I also use Hostmonster and so far have found them to be excellent when I've needed support via Live Chat. I don't have a multisite setup with them yet but plan to do so in the next few months so I'd be interested to follow this thread.

I suspect that the problem is with Hostmonster, specifically the way the add addon domains but that's just a guess - Hostmonster's setup is probably pretty much the same as any other host with CPanel.

Have you tried adding example1.com as an addon domain with the same root folder folder as example.com (you probably can't do this if example.com is the default domain for your account)?

I did not mean that

ergunk's picture

I did not mean that Hostmonster is a bad choice. And i don't have enough knowledge and experience to compare Hostmonster with equivalents(I'm familiar with Windows servers and hosting). What i said was all about Drupal multisite installation.

"Have you tried adding example1.com as an addon domain with the same root folder folder as example.com (you probably can't do this if example.com is the default domain for your account)?"

Addon domains are subdomains of default domain as you know. So you can't have addon domains with same level of default domain. But i also tried to install Drupal on an addon domain and create a new multisite for another addon domain(i also tried subdomains for default domain). So they were on the same level; but this didn't help. :(

But i think it is not about level. It is about symlinks(maybe symlinks on Hostmonster). Symlink just creates shadow or ghost copies. You just have a copy of first site. It is not even a copy, shortcut. Only name is different. So when you navigate to example1.com actually you navigate example.com. Just the name is different on bowser's address bar. In my experience it happened so.

If you could try and tell us your experience i would appreciate it.

Thank you...

You didn't come across as

j0hn-smith's picture

You didn't come across as saying 'hostmonster is a bad choice', I just wanted to point out that they offer excellent support via live chat (or at least have for me in the past) :)

I could be totally wrong here and have never setup any drupal multisites but, I understand why you want to use symbolic links which is logical but I think that drupal serves requests for all sites from the same index.php file, thus both (or all domains) need to point to the same folder (same index.php file). If you have your multisites setup locally you could test this. Maybe some manual DNS entries are required?

I could be very wide of the mark though, if I am I hope I don't waste too much of your time.

I tried parking domains,

ergunk's picture

I tried parking domains, redirecting domains and subdomains, changing working folder to original Drupal folder etc too... :( That's why i had to try symlinks.

I have multisite setup on my local computer and 5 multisites; there is no problem(Wamp on Win XP). I also wrote a tutorial about setting up multisites on localhost on a Turkish CMS forum. And people could set up multisites by following these instructions. And this is not brain surgery. It is quite easy and simple. So my problem is not about setting up multisites; it is about doing that on Hostmonster(shared hosting). Something must be wrong with Drupal multisites/symlinks on Hostmonster.

"I hope I don't waste too much of your time." Not at all. Thank you for sharing your thoughts. But it would be great if you could try this yourself and share the results you get.

My trial period will end soon and if i can't manage to setup Drupal multisites, i will give up Hostmonster. Because Drupal and multisites were my main reasons to sign up. :(

I solved it! :)

ergunk's picture

I deleted everything. Then i followed intructions i gave on my prior entry (subject: I am telling it again )

But with some differences.

  • In step #5, i also changed example1.com's working directory as example.com
  • I did not use symlinks(already did not like it :). Forget about step #6.
  • It works :)

It also works with subdomains.

  • I created a subdomain manually: sub-example.mainaccount.com
  • I installed Drupal on sub-example folder
  • I created another subdomain manually: sub-example1.mainaccount.com
  • I set sub-example1's working directory as sub-example.mainaccount.com
  • Under sub-example/sites folder, I copied "default" folder and named it as sub-example1.mainaccount.com
  • I modified settings.php for sub-example1
  • I navigated sub-example1.mainaccount.com/install.php

It works too!

Thanks everyone who shared their thoughts.

Other prefix

jeffreyvddb's picture

I'm trying to add a subdomain, but I'm getting errors when I follow the steps in this article: http://drupal.org/node/125539. I believe it has something to do with my settings.php, where i said that my subdomain needs to have an other prefix than my normal installation. Also, I can't seperate the data using two databases, because I don't have permissions to add another one. Does someone have a solution for this problem?

hostmonster updating Multi site

Bill Lea's picture

Has anyone successfully installed Drupal 6.x in a multi-site configuration on Hostmonster? It looks basically feasible but I'm curious about updating a multi site configuration automatically. Why? Well I have been trying to update my existing sites from 6.20 to 6.22 to fix a security issue. Hostmonster tech staff says that 6.22 in INCOMPATIBLE with their servers. SO I can't do the update. So if you cant tell when a version of Drupal will be compatible with a hosting service or not I assume it is inadvisable to just update outside of their QC system. They say there is a way to load an existing sysem into their script update system but I'm not sure it works. I hate the thought of trying this with a live site. Any one have any recent experiance with HOSTMONSTER updating in multi-site environment?

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week