Skip to main content

Set Multisite in drupal


For Linux 9.10

Please Follow the steps :
1) Extract the drupal in public html folder or any other folder.(say exampleDrupal).
2) Add below lines to exampleDrupal/sites/sites.php
    $sites['site1.test'] = 'site1.test';
    $sites['site2.test'] = 'site2.test';
3)  Create two folders in exampleDrupal/sites/ folder.
      as site1.test & site2.test.
     OR
     Using terminal run following commands :
     i)  cd example.com/sites
     ii) mkdir site1.test/ site2.test/
4) Copy the default.settings.php file from  exampleDrupal/sites/default to site1.test &  site2.test folder.
    OR      Using terminal run following commands :
      i) cp default/default.settings.php site1.test/settings.php
      ii) cp default/default.settings.php site2.test/settings.php
5) Give 777 permission to both the folders as sudo chmod -R 777  site1.test & site2.test on terminal.
6) Create Two databases for two sites as site1_db & site2_db.
     OR      Using terminal run following commands :
    i)  sudo mysql -u root -p
    ii) create database site1_db;
    iii)create database site2_db;
7)  Run the following command on terminal .
These command to set up the site url on localhost .
 sudo gedit /etc/hosts
Add these lines:
127.0.0.1 site1.test
127.0.0.1 site2.test
8) Next on terminal :
    sudo gedit /etc/apache2/httpd.conf


9) Add the following lines :
 " VirtualHost *:80 "
     DocumentRoot /Path to drupal folder/ 
     ServerName site1.test 
" Directory /Path to drupal folder
     Allow from all Options +Includes +Indexes +FollowSymLinks 
     AllowOverride all 
  " /Directory
 " /VirtualHost "
" VirtualHost *:80 "
   DocumentRoot /Path to drupal folder/ 
  ServerName site2.test 
" Directory  /Path to drupal folder
   Allow from all Options +Includes +Indexes +FollowSymLinks 
   AllowOverride all 
" /Directory
" /VirtualHost "

Note : Please Replace "  " ( double cords ) with <>( html greater than & less than tag ) .
10) Restart apache.
     sudo /etc/ini.d/apache2 restart

Now visit your new site as : http://site1.test & http://site2.test 


For Multisite in Ubuntu 10.04 and greater Please click this link.

Comments

Popular posts from this blog