Do I need symlinks for my multisite or static links? What are they for? Does having a virtual host matter?

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

I have been doing research into multi sites, because I have 3 sites that are separate that I need to bring together in a multi site install. I read some articles on drupal.org that talked about doing symlinks or static linking. The problem is they said how to do it though the command line but not why. So why would I need to do symlinking or static linking when setting up the site.

Also, our hosting is a virtual private server with apache and I was confused about part of this article (http://drupal.org/node/138889) that talks about configuring apache 2. Why do I have to do this? Is it only for VPS hosting?

Thanks,

Becky

Comments

Symlinks for multisite on same domain

btopro's picture

Typically you'll want to use symlinks on your server if you have a multisite running multiple sites off the same domain name. We do this in our setup all the time:

http://elearning.psu.edu/elearning/ is a different site from http://elearning.psu.edu/drupalineducation/ but they are both running off of the same Drupal 6 stack of multisites. And yes you'll need to do this through command line.

If you're doing different domains pointing to the same box you could setup the multisite without needing to do any symlinking.

Ok great. So, setting up a

beckyjohnson's picture

Ok great. So, setting up a multi site incorporating 2 different domains = no symlinking.
Do I still need to configure apache, as the article above talks about? (see the section Configure Apache2 for Sites).

Becky

Don't know for sure but

btopro's picture

Don't know for sure but someone will have to point the domain to the machine and vis-versa so that sounds likely to me. Not a server admin though.

Ok. I do need symlinks based

beckyjohnson's picture

Ok. I do need symlinks based on reading this:

Document root
One area of frequent confusion is that in a Drupal multisite installation the webserver document root is the same for all sites. For example with the following three sites: example.com, sub.example.com and example.com/site3 there will be a single Drupal directory and all sites will be calling the same index.php file.

Some webhosts automatically create a new directory (i.e. example.com) when creating a new domain or subdomain. In this case it is necessary to make it into a symbolic link to the main Drupal directory, or better yet when creating the domain or subdomain, set it to use the same document root as the site where you have Drupal installed.

From http://drupal.org/getting-started/6/install/multi-site

However.....How do I make a symlink? I can't find instructions on any of the multi site pages that make sense to me.
Becky

ahh....our host uses

beckyjohnson's picture

ahh....our host uses plesk...and apparently plesk won't let you make symlinks....hnmmm..

Becky, what do you anticipate

Garrett Albright's picture

Becky, what do you anticipate the paths to your sites to look like?

If they're both going to be distinct domain names (example.com and example.org) or subdomains (foo.example.com and bar.example.com), you don't need to use symbolic links at all. Only if you have a case like btopro mentioned above (example.com/foo and example.com/bar) do using symlinks really become an option to solving the problem.

If your sites will use distinct domains or subdomains, all you really have to do is make sure that each domain/subdomain is using the same directory as its web root, and that that directory has Drupal in it.

As mentioned above, if you do need to make symbolic links, it's most likely something you'll have to do using a shell (SSH) connection to access the server directly. It's not something you can typically do over FTP or with web-based file managers.

Hi, we are using separate

beckyjohnson's picture

Hi, we are using separate domains. After reading your post I went back and read this: http://drupal.org/getting-started/6/install/multi-site and realized you were right! How do I make sure that each domain is using the same directory as it's web root? Are the instructions on the above link correct in that I have to edit my entries?
Also, if I modify my entries, do I have to start adding all my sites to that? I ask because we are running one non-drupal site and I don't want to mess that up. I don't want the wrath of our engineers on top of me.

Thanks for everyones help. It seems like there are lots of different ways to go about multisites....

Becky

How do I make sure that each

Garrett Albright's picture

How do I make sure that each domain is using the same directory as it's web root?

Well, it depends on how you're "adding" the domains to the site. You said above that your server has Plesk; are you using this to manage domains as well? Unfortunately, I'm not familiar with Plesk, but at some point during the process of adding a new domain to the server, it should ask you what the web root directory is. You just want to make sure that that directory that it's asking for is the one that has Drupal in it, and that it's the same for all domains. Perhaps someone more familiar with Plesk can give you more specific information.

If there's some way to set a default web root directory for domain names not specifically assigned with Plesk, that would be another good way to go about it. That's basically how I do it on my own servers, though I don't use Plesk or an analogue - I do it directly via the web server's configuration files. But I can understand if that's a bit over your head at this point.

Multisite

Group organizers

Group notifications

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