Did I do this right?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by jfmoore on August 13, 2009 at 6:40pm

I'm a Drupal noob and have fumbled my way through a multi-site installation. All in all, it went pretty well with no major problems that I could not find a solution to - thanks in no small part to a lot of videos and other tutorials out there. Of course, I'm not sure that what I did was exactly correct, but it seems to work. I would appreciate people more knowledgeable than I reviewing the following and giving me their opinions. Also, there is a small problem mentioned at the end that I would like to be able to fix. First, though, allow me to apologize for any typos. I've looked at the following until I'm cross-eyed, and it looks like a correct rendition to me, but I wouldn't bet any amount I couldn't afford to lose.

So, here goes:

I'm using Drupal 6.13 in a multi-site installation

The main installation is public_html/drupal

The installation I'm asking about is at public_html/drupal/sites/my-original-domain.com.mysite1

It is using a customized version of the Marinelli theme located at public_html/drupal/sites/my-original-domain.com.mysite1/themes/marinelli

There is also an unchanged version of the theme at public_html/drupal/sites/all/themes/marinelli

I would like to run down my installation procedure and see if it is correct, because I've run into a little problem.

Here's what I did:

Did the main installation in public_html/drupal

Created a MySql db for the new site - mysite1

Created the folder sites/my-original-domain.com.mysite1

Copied settings.php into the folder and edited db info

Created sites/my-original-domain.com.mysite1/files folder

Created sites/my-original-domain.com.mysite1/themes folder and copied Marinelli theme into it

In Putty, created symlink: ln -s drupal mysite1

This creates, also, the public_html/mysite1 folder which is, I guess, a mirror of the Drupal directory

Surfed to my-original-domain.com/mysite1/install.php and installed Drupal

Now, I can access the site at my-original-domain.com/mysite1

Question 1: Does the above seem okay? If so, then please look at the following -

Then, I wanted to change the location of the site to mysite2. Don't ask why. I just did. It would be clear if I used the real names. Anyway, Mysite2 was already installed and had a db and was working. I didn't need it, though, so I thought it okay to recycle it.

Here's what I did:

Copied files folder and themes folder from sites/my-original-domain.com.mysite1 to sites/my-original-domain.com.mysite2

Settings.php, naturally, already contained the correct db info

A symlink had already been created, too

In PhpMyadmin:
I dropped all tables in the mysite2 db
Exported the mysite1 db
Imported the mysite1 db into the mysite2 db

Now, I can access the site at my-original-domain.com/mysite2

Question 2: Does the above seem okay. If so, then please look at the following -

Now, I want to register the domain, mysite2.com and point to the installation so that, when I surf to www.mysite2.com, it will go to the mysite2 installation and show 'mysite2.com' in the address bar instead of my-original-domain.com/mysite2.

So, I did the following:

Registered the domain mysite2.com with appropriate name servers

In my-original-domain.com/cpanel, I create an addon domain as follows:
domain - mysite2.com
directory - mysite2

Here's the problem: Sometimes, mysite2 uses the Marinelli theme in sites/all/themes/marinelli instead of sites/my-original-domain.com.mysite2/themes/marinelli. This didn't happen until I created the addon domain, but I'm thinking there may be an error somewhere before that which caused the problem to appear at this step.

So, until I find out what's causing the problem, I've redirected, in cPanel, the mysite2.com domain to my-original-domain.com/mysite2. Displays okay, but shows my-original-domain.com/mysite2 in the address bar instead of mysite2.com.

If there's anyone who actually made it this far without falling asleep :-) , I would say 'thank you' for your perseverance and that I would very much appreciate your input and suggestions anywhere you care to wade in. Thanks.

Categories: ,

Comments

In Putty, created symlink:

Posted by Garrett Albright on August 13, 2009 at 9:07pm

In Putty, created symlink: ln -s drupal mysite1

A cartoon sound effect would go well here, though I can't decide between "tin car crashing and falling apart" or "needle being dragged across record."

There are occasions where it makes sense to use symlinks when doing Drupal multisite foo, but they're very rare, and this isn't one of them. When you went to my-original-domain.com/mysite1, that alone would have brought forward the new non-default site for you to see, without any linking.

I would also suggest creating a child theme of Marinelli instead of cloning and modifying it. At the very least, your copy should have a different name to reduce confusion.

Delent symlink?

Posted by jfmoore on August 14, 2009 at 3:57pm

Thanks for the input, and glad you got a chuckle. Wish I could laugh with you, but I don't know enough to get the joke. Guess I'll just have to enjoy it vicariously.

I'm a little confused, though, since there are so many references to symlinks in a multi-site installation, particularly where sites are to be in subdirectories. I mean, I didn't come up with that on my own. Wish I could have, but I didn't know anything about symlinks, and It was the first time I had ever created one.

Anyway, I'm happy to know it's not necessary. Can I, then, delete the symlink?

Thanks again.

Yes, delete that mother.

Posted by Garrett Albright on August 14, 2009 at 4:39pm

Yes, delete that mother. (Make sure you're not deleting the original file, though; just the link.)

Who was telling you to use symlinks? Perhaps with older versions of Drupal it was necessary, but it shouldn't be in this case.

Who was telling you to use

Posted by jfmoore on August 14, 2009 at 6:02pm

Who was telling you to use symlinks? Perhaps with older versions of Drupal it was necessary, but it shouldn't be in this case.

Here are a couple of places talking about symlinks:
http://drupal.org/node/526516
http://drupal.org/node/311421

There are others.

Going to try it out w/o symlinks. Will report results.

Won't work w/o symlink

Posted by jfmoore on August 14, 2009 at 6:42pm

I removed the symlink, and it couldn't find the site. Replaced the link, and it works again. If this is, as you say, supposed to work, then what else might be wrong to keep it from working as it should?

Well, hmm. Maybe someone a

Posted by Garrett Albright on August 14, 2009 at 11:48pm

Well, hmm. Maybe someone a bit more familiar with how you're trying to set things up can help you further, but in my experience, I've never needed to use symlinks to set up a multi-site installation.

Have you considered trying using subdomains instead of subdirectories - so mysite1.example.com instead of example.com/mysite1?

Another question

Posted by jfmoore on August 16, 2009 at 2:56pm

Okay, let me be a little more specific, using better names.
My cPanel host account is at domain.com
The main Drupal directory is at domain.com/drupal

I have set up sites at -
domain.com/drupal/sites/domain.com.moe
domain.com/drupal/sites/domain.com.larry

Had to set up symlinks moe to drupal and larry to drupal. These are okay, because I only want to access them as subdirs, like domain.com/moe and domain.com/larry.

Now, though, I have registered curly.com, and I want to set it up so that I can access the site by www.curly.com and curly.com and have the address bar show those and not domain.com/curly.

I have also tried setting it up as domain.com/drupal/sites/curly.com and redirecting the domain to domain.com/drupal, but I get the main site - domain.com/drupal - and not curly.com, if you know what I mean. So I really don't know how to do this.

I would be grateful for any suggestions.

Multisite

Group organizers

Group notifications

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

AltStyle によって変換されたページ (->オリジナル) /