Saturday, 21 November 2009

Drupal multisite

Hi Readers,

Let me show how I made a Drupal multisite on my localhost. Of course, I did it a bit different way (I'm sure). That's me. By the way, this is the NORMAL description about multisites: http://drupal.org/node/43816

1: Deploy a Drupal site
Download the newest Drupal and install it. I did it into a folder, under my web root folder: /PATHTOYOURWEBROOT/DRUPALMULTISITEDIR/

2: Add your first site name to /etc/hosts
sh# sudo echo "127.0.0.1 FIRSTMULTISITENAME" >> /etc/hosts


3: Also tell to Apache, where is your new domain points
Insert at the end of your httpd.conf this snippet:
<virtualhost>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "/PATHTOYOURWEBROOT/DRUPALMULTISITEDIR"
ServerName FIRSTMULTISITENAME
ServerAlias FIRSTMULTISITENAME
</virtualhost>


4: Rename sites/default to your first multisite's name
sh# cd sites
sh# mv default FIRSTMULTISITENAME


5: Restart apache
After restart check this out: http://FIRSTMULTISITENAME/

Of course, it's just one site. Adding a new site (SECONDMULTISITENAME):
  • Create subdirectory in sites (SECONDMULTISITENAME)
  • Copy a brand new settings.php into it, and create a files folder
  • Add the /etc/hosts entry (2)
  • Add apache directive (3)
I think, it's not that hard.

Evening,
Peter

No comments:

Post a Comment

Note: only a member of this blog may post a comment.