Thursday, February 23, 2012

Drupal Multisite

Hoyee... finally sis salina and i did it :)

Here is the step:
1. Install Drupal 7 the normal way
2. Create DNS name eg: MainSite.example.com Site1.example.com Site2.example.com
3. Configure the web server so that the second site's domain points to the same directory.
Different web hosting providers has a different procedure for this (usually adding an add-on domain and changing its root directory to your Drupal installation root directory), If, however, you are working on your local server, supposing it is Apache, just add the second site's domain to ServerAlias directive. (or if you need separate logs, you can make a new virtual host with the same DocumentRoot)
Here is an example of Apache configuration..


4.Make a new directory with name equal to the second site's domain (Site1.example.com) under Drupal's sites directory.
Suppose you have uploaded Drupal files in a folder named "drupal" so there is "drupal/includes/","drupal/misc/","drupal/modules",..etc. now your new directory should be "drupal/sites/my-second-domain.com". (the folder name is "my-second-domain.com")

5.Copy default.settings.php to the new directory renaming it to settings.php and make a new directory called files there then change permissions so that both are changeable by everyone.
Following what we previously supposed, you will copy the default.settings.php file (found in drupal/sites/default/) to /drupal/sites/my-second-domain.com/ and rename it to settings.php then change its permissions to 666 (make it changeable by everyone) and then make a new directory under /drupal/sites/my-second-domain.com/ and name it "files" then change permissions of it to 777.
In Linux (if you are working on your own local server or have SSH access to your host) this can be done as follows :

6.Navigate to the second site's domain and install Drupal normally.
Just like the first step above.


Problem that we are facing where the pcre 8.30 are not compatible to drupal7.
It will give warning



With help by Sifu Zaman.. we finally success downgrade to pcre8.21 but the problem is this pcre are dependence to other package such apache22. So, we decide to maintain the pcre 8.30 since it is only giving warning not error :)


You can add how many sites you want.. and you can do the same thing as above steps.

make sure the file name for setting.php is "SETTINGS.PHP" with 's' .. that is my problem when i did the third sites where in the beginning it is not working.

3 comments:

  1. Can u post the downgrade process of the pcre? tq

    ReplyDelete
    Replies
    1. Emm.. tak sempat nak blaja.. step terlampau byk.. sifu zaman buat cepat sangat.. final step jerk.. dia kasi.. OK file dah boleh guna.. backup yang lama.. install yang baru :P

      Delete
  2. This comment has been removed by the author.

    ReplyDelete