1

Try as I might cannot stop all changes in one sub site copying to other. They have two separate databases and settings files and conf files but because of necessary symlink to share core code base , everything else is being shared right along with it.

How can I stop this sharing everything between subsites when drupal core is in first subsite and symlinked to second?

Why is it even happening when have two sep db set up and two sep settings.php?

I don't want changes to be made to subsite2 when I make changes to subsite1 and vice versa as is happening now.

mysite.com (static html) in /var/www/html

sub1.mysite.com (drupal install) pointing to mysite.com/sub1

/var/www/html/sub1/sites/sub2

sub2.mysite.com (symlink to sub1 in html folder) pointing to mysite.com/sub2(symlink vs)

No necessity to add sites.php or even change httpd or conf file with symlink.

My theory is you must have drupal core files in html folder not a subdir linked to subdomain below it. I will test tomorrow.

No I think I need to just know what to put as base url in conf file? Do I direct it to html/mysub.site.com or to html/sub1/sites/mysub.site.com ?

  • What is being shared? What symlink are you talking about? – d_inevitable Apr 12 '13 at 3:22
  • I have mysite.com as plain html – cea Apr 12 '13 at 5:00
  • 1
    Then mysite.com/sub1 is the one with drupal core symlinked to mysite.com/sub2 – cea Apr 12 '13 at 5:00
  • I wanted twin sites and then make small changes to each separately and have separate users and database. – cea Apr 12 '13 at 5:02
  • Starting to think this will only work with drupal in www folder and then sub sites all listed in same folder off that sites folder. Not as I have it in www/html/drupalsub symlink sub2 – cea Apr 12 '13 at 5:07
6

I run several multi-sites and nothing is being shared between them except core and the modules and themes below sites/all/. If more than this is shared (your question specifies "everything"), then you've not set up your multi-site right.

I've written a tutorial about setting up a multi-site here. I hope the instructions are clear enough to follow.

Setting up a multi-site where the primary site is in a sub-directory is not different from setting up any other multi-site, provided your DocumentRoot points to the right place.

From your latest comment, I finally understand that you're trying to do the same thing as the person at http://drupal.org/node/1882182.

In that case, you need to understand that this person is not using the subdirectory method. He is using the subdomain method. You can't mix these methods, you must use one or the other.

And if you're using the subdomain method, you must not use a symbolic link (as you indicate in your question that you're using). Instead, you must configure DNS and your vhost to point to the directory that is your DocumentRoot for Drupal (in your case, it sounds as this should be /var/www/html/sub1/. This will take care of the fact that your Drupal core is installed in a sub-directory with a plain HTML-site in the web-root. You must also create the following sub-directory in the Drupal sites directory: sub2.mysite.com. Copy the default.settings.php into sub2.mysite.com. Then make sub2.mysite.com your working directory and immediately copy default.settings.php to settings.php. Make sure that both are writeable by the web server user. The sub2.mysite.com subdirectory will hold your settings.phpfor sub2.mysite.com. Then go to your ISPs control panel and configure DNS for sub2.mysite.com to resolve to your main site's IP-adress. Finally create the following ServerAlias: ServerAlias sub2.mysite.com in your main site's vhost configuration file.

You should now be able to point your web-browser to http://sub2.mysite.com/ and be greeted with default Drupal installaton screen. You can then proceed and install the multi-site instance you've created. If you get anything else than the default Drupal installaton screen at this point, something has gone wrong and you need to find out what this is.

(All this assumes you're using Apache2 as your web-server. If you're using something else, you need to figure out the equivalent of DoccumentRoot and ServerAlias on your brand of web-server.)

  • Thanks for tutorial link, I think what makes my execution of this difficult is because I have no drupal core in www and so sharing drupal core in a sub directory. – cea Apr 12 '13 at 5:05
  • I am using BOTH subdirectory and subdomain together so how do I get that configured correctly? You speak of them separately. – cea Apr 12 '13 at 6:09
  • my plain html is in web root my multisite stems off subdirectory pointing to subdomain..exactly like this person is trying to do drupal.org/node/1882182 BY THE WAY, I want to take this opportunity to thank you Gisle because it was your book in progress that taught me and got me started on command line! – cea Apr 14 '13 at 2:26
  • I highly respect your learned opinion. – cea Apr 14 '13 at 2:27
  • Thank you for going to that trouble, I really appreciate it. – cea Apr 14 '13 at 13:35
1

Read Multisite

If you are running more than one Drupal site, you can simplify management and upgrading of your sites by using the multi-site feature. Multi-site allows you to share a single Drupal installation (including core code, contributed modules, and themes) among several sites.

Overview of the Process

  1. Create a new database for the site (if there is already an existing database you can also use this by defining a prefix in the installation procedure).

A new database shall not have your other sites content in it, unless you add them.

  • I do have other database but makes no difference because symlink to other is overriding it somehow. – cea Apr 12 '13 at 5:04
  • @CharlieBunt in that case this is not related with drupal db. Its server side issue. Why dont you specified it in the question ? – niksmac Apr 12 '13 at 5:13
  • What do you mean? This has everything to do with configuring multi sites and separate databases. – cea Apr 12 '13 at 5:43
  • somehow i have set up the folders incorrectly because of drupal core residing in subdirectory...this is what i suspect but still not sure. – cea Apr 12 '13 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.