Recent posts

Create separated multi-site, multi-domain setup in Drupal

26 Jun, 2007 | Author: admin | Filed under:

I have a hosting provider hosting my Drupal blog and website. I have no access to any webserver configuration (e.g. Apache), so I have done a multi website setup, with one codebase, separate databases as follows.
My multi-setup is this...

• I have one functional Drupal 5.1 installation for my main domain (www.mydomain.com/drupal51)
• I have various separate Drupal websites using the sites directory, each with their own database
• The different Drupal websites run at their own subdomains, like blog.mydomain.com, laotze.mydomain.com
• I am using symbolic links, not through shell (doesn't recognize "ln"-command) but either through a) php script b) ftp/scp
• I have no access to Apache's httpd.conf

So, if you have ftp access and the ability to create subdomains with your ISP, perhaps this may work too...

1) I created the subdomains though my hosting provider's control panel

Then my directory setup looked like this..

/www/www.mydomain.com/drupal51 (my Drupal install)
/www/blog.mydomain.com/ (directory, contained only a landing page)
/www/laotze.mydomain.com/ (directory, contained only a landing page)

The /www directory is the root of what's accessible to me. When entering my domain in the browser, it will look into the /www/www.mydomain.com directory for anything it can serve.

2) I created the appropriate sites directories inside the Drupal sites directory. So I had this...

/www/www.mydomain.com/drupal51/sites/www.mydomain.com
/www/www.mydomain.com/drupal51/sites/blog.mydomain.com
/www/www.mydomain.com/drupal51/sites/laotze.mydomain.com

3) I created the mySQL databases through my hosting providers control panel, using different names and passwords for each database. It might be a good idea to create a user 'admin' for all of the databases. You then only have to remember the passwords, but obviously you can do what feels right. Also it might be helpful to pick a name for the database that corresponds with the subdomain/website. For example: blogdb for the blog.mydomain.com website, etc...

4) I copied settings.php from /www/www.mydomain.com/drupal51/sites/default into each of the sites directories, created in step 2 and made the proper changes to each settings.php file. For me, only the $db_url = 'mysql://usr:pass@localhost/dbname'; line needed to be changed. I assume here that you know how to change each settings.php file. It is documented on this site, so please refer to the handbooks to check if you don't know what I am talking about here.

5) I then deleted all the directories that were created by my hosting provider, when I created the subdomains using WinSCP. SCP is similar to FTP. Works the same. WinSCP is a very small but powerful SCP client that allows you to do the same as with FTP, but FTP will do just fine. Get the latest version here... http://winscp.net/eng/index.php

6) I created symbolic links to the drupal install. I know there are many threads on this, because I have read them all :-)
I tried the "ln -s" command in SSH shell, but it was not recognized. Either my hosting provider is running a very slim version of its OS, or the number of commands are restricted (most likely the latter).

a) I tried using the PHP for creating a symbolic link. I created an empty document in notepad, and pasted in the following...
<code>
<?php
symlink ('/home/username/www',
'/home/username/www/blog.mydomain.com');
?>
</code>

I uploaded this document as createlink.php to /www/www.mydomain.com/, where it's accessible to me from the web and typed in a browser: http://www.mydomain.com/createlink.php.
When I got a white page, I entered blog.mydomain.com and I reached the Drupal welcome page, containing the Drupal steps needed when you first go to your Drupal install.

I changed createlink.php for laotze.mydomain.nl and repeated the process.

I checked using WinSCP and noticed the symbolic links, much the same as shortcuts to folders on your Windows desktop. So now I had this...

/www/www.mydomain.com/drupal51 (my Drupal install)
/www/blog.mydomain.com/ (symbolic link)
/www/laotze.mydomain.com/ (symbolic link)

b) I noticed WinSCP supports creating symbolic links, under right-click, New (ALT+F6). This is probably much easier, even when you don't have access to "ln" from a SSH shell.

In depth details on how to create (and remove) symbolic links using PHP is described here...
http://www.ideasfornet.com/how_to_create_symbolic_links_without_shell_ac...
http://www.contractwebdevelopment.com/drupal-multisite-configurations-an...

I am pretty sure there are a dozen ways of setting up multi-domain Drupal environments, but hopefully this helps someone.

.

24 people have left comments

  • Beats By Dr Dre
    Dr Dre Headphones
    Dr Dre Beats
    Beats By Dr Dre Diddy
    Beats By Dr Dre Just Beats
    Beats By Dr Dre Pro
    Beats By Dr Dre Solo
    Beats By Dr Dre Studio
    Beats By Dr Dre Tour
    HeartBeats By Lady Gaga
    Monster Butterfly
    Monster iBeats
    Monster Miles Davis
    Monster PowerBeats
    Monster Turbine Pro
    New Arrival
    Monster Butterfly
    Monster Miles Davis

    Monster Beats By Dr Dre Studio Diamond Pink
    Beats by Dr Dre Studio Kobe Bryant Headphones
    Monster Beats by Dr Dre Studio Limited Edition
    Monster Beats By Dre Studio Graffiti Headphones
    Monster Beats By Dre Studio Justin Bieber
    Beats By Dre Studio Lamborghini
    Beats By Dre Black Pro
    Monster Beats By Dre Pro Black
    Monster Beats By Dre Pro In Ear Headphones ControlTalk
    Monster Beats By Dre In Ear Headphones ControlTalk Red
    Beats Dr Dre Solo HD Red Diamond
    Monster Beats Solo HD On-Ear High Definition Headphones Black
    Monster Beats By Dre In Ear Headphones ControlTalk Red
    White Monster Beats Solo HD On-Ear High Definition Headphones
    All Red Beats By Dre Studio HD High Definition On Ear Headphone
    Gold Beats By Dre Studio HD High Definition On Ear Headphones With ControlTalk Sale Online
    Monster Beats By Dr Dre Studio Headphones Diamond Blue
    Black Beats By Dre Studio HD High Definition On Ear Headphones With ControlTalk Online
    Monster Beats By Dr Dre.Studio Black yellow Pittsburgh Steelers
    Monster Beats By Dr Dre Studio NBA Yankees White
    Orange Monster Beats By Dre Studio HD High Definition On Ear Headphones
    Pink Monster Beats By Dre Studio HD High Definition On Ear Headphones
    Black Monster Beats by Dr Dre Tour In-Ear Nice Shape Headphone
    Black Monster PowerBeats Lebron James In Ear Sport Headphone
    Heart Beats By Lady Gaga High Performance In-Ear Headphones
    Beats By Dre Gradient Version of Transformers High Performance On-ear Headphones
    Monster Beats By Dre Studio New Limited Edition Colors

    xielin (not verified) wrote on 30 Dec 2011 — 06:12
  • Moncler Doudoune (not verified) wrote on 27 Dec 2011 — 07:12
  • drebeatsy (not verified) wrote on 23 Dec 2011 — 07:12
  • While most people could tell you the highest mountain in the world is Mount Everest and the longest river in the world is the Nile, not many people know much about the biggest lakes around the world.

    find cell number (not verified) wrote on 21 Dec 2011 — 11:12
  • Most people do not understand comptia exams that in order to a+ Exams actually advance in their career a+ certification, notably if they are working with CompTIA Security+ certification computer systems is by doing Network+ certification programs which is not going to only MCTS Windows 7 Configuration increase their knowledge but also their expertise.

    qiao456 (not verified) wrote on 20 Dec 2011 — 07:12
  • F1 2011 hottest elelctroni cigarettes in good prices

    Anonymous (not verified) wrote on 29 Nov 2011 — 06:11
  • supply E cigarette with good price

    http://www.health007.net

    Anonymous (not verified) wrote on 25 Nov 2011 — 09:11
  • Globe Valve (not verified) wrote on 22 Nov 2011 — 05:11
  • Thanx for the effort, keep up the good work Great work, I am going to start a small Blog Engine course work using your site I hope you enjoy blogging with the popular BlogEngine.net.Thethoughts you express are really awesome. Hope you will right some more posts.

    Moncler Vest (not verified) wrote on 22 Nov 2011 — 03:11
  • I was glad I happen to stop by on your blog. My research is almost done, thanks for sharing this. college basketball fans | baby's first christmas

    baby's first christmas (not verified) wrote on 13 Nov 2011 — 06:11
  • Smoking can really be a bad habit. You die early if you go into it. However, some can't really stop it. I wonder how can it be fine with a person?

    Gillette Shavers (not verified) wrote on 16 Oct 2011 — 20:10
  • Excellent post. I was checking continuously this blog and I’m impressed! Very useful info particularly the last part :) I care for such information a lot. razors for men | dog grooming

    razors for men (not verified) wrote on 16 Oct 2011 — 14:10
  • Fantastic website. Many thanks for making the effort to post it. I have book marked your site and will make sure to return often.North Face Outlet Locations

    The North Face (not verified) wrote on 05 Oct 2011 — 02:10
  • http://www.beijingsunpu.com.cn/bbs/boke.asp?freefighter.showtopic.33148.html
    http://www.beijingsunpu.com.cn/bbs/boke.asp?freefighter.showtopic.33149.html
    http://www.beijingsunpu.com.cn/bbs/boke.asp?freefighter.showtopic.33150.html
    http://www.beijingsunpu.com.cn/bbs/boke.asp?freefighter.showtopic.33151.html
    http://www.beijingsunpu.com.cn/bbs/boke.asp?freefighter.showtopic.33152.html
    http://www.beijingsunpu.com.cn/bbs/boke.asp?freefighter.showtopic.33153.html
    http://www.beijingsunpu.com.cn/bbs/boke.asp?freefighter.showtopic.33154.html
    http://www.beijingsunpu.com.cn/bbs/boke.asp?freefighter.showtopic.33155.html
    http://www.beijingsunpu.com.cn/bbs/boke.asp?freefighter.showtopic.33156.html
    http://www.bdwed.net/bbs/boke.asp?freefighter.showtopic.20628.html
    http://www.bdwed.net/bbs/boke.asp?freefighter.showtopic.20629.html
    http://www.bdwed.net/bbs/boke.asp?freefighter.showtopic.20630.html
    http://www.bdwed.net/bbs/boke.asp?freefighter.showtopic.20631.html
    http://www.bdwed.net/bbs/boke.asp?freefighter.showtopic.20632.html
    http://www.bdwed.net/bbs/boke.asp?freefighter.showtopic.20633.html
    http://www.bdwed.net/bbs/boke.asp?freefighter.showtopic.20634.html
    http://www.bdwed.net/bbs/boke.asp?freefighter.showtopic.20635.html
    http://www.bdwed.net/bbs/boke.asp?freefighter.showtopic.20636.html
    http://www.cfqs.org/bbs/boke.asp?freefighter.showtopic.17323.html
    http://www.cfqs.org/bbs/boke.asp?freefighter.showtopic.17324.html
    http://www.cfqs.org/bbs/boke.asp?freefighter.showtopic.17325.html
    http://www.cfqs.org/bbs/boke.asp?freefighter.showtopic.17326.html
    http://www.cfqs.org/bbs/boke.asp?freefighter.showtopic.17327.html
    http://www.cfqs.org/bbs/boke.asp?freefighter.showtopic.17328.html
    http://www.cfqs.org/bbs/boke.asp?freefighter.showtopic.17329.html
    http://www.cfqs.org/bbs/boke.asp?freefighter.showtopic.17330.html
    http://www.cfqs.org/bbs/boke.asp?freefighter.showtopic.17331.html
    http://www.chinabo.org/bbs/boke.asp?freefighter.showtopic.25.html
    http://www.chinabo.org/bbs/boke.asp?freefighter.showtopic.26.html
    http://www.chinabo.org/bbs/boke.asp?freefighter.showtopic.27.html
    http://www.chinabo.org/bbs/boke.asp?freefighter.showtopic.28.html
    http://www.chinabo.org/bbs/boke.asp?freefighter.showtopic.29.html
    http://www.chinabo.org/bbs/boke.asp?freefighter.showtopic.30.html
    http://www.chinabo.org/bbs/boke.asp?freefighter.showtopic.31.html
    http://www.chinabo.org/bbs/boke.asp?freefighter.showtopic.32.html
    http://www.chinabo.org/bbs/boke.asp?freefighter.showtopic.33.html

    Freefighter (not verified) wrote on 04 Oct 2011 — 09:10
  • factory site: http://waterslide.en.hisupplier.com/product-category-104987-Bouncy-Castl...
    welcome to refer inflatable products ,thanks for your interested in our inflate toy and we assure all in factory price.

    william123 (not verified) wrote on 22 Sep 2011 — 01:09
  • Also it might be helpful to pick a name for the database,It might be a good idea.Shaving Sets

    juarez (not verified) wrote on 01 Sep 2011 — 00:09
  • I enjoy reading the report, too. It′s easy to understand that a journey like this is the biggest event in ones life

    flytouch 2 (not verified) wrote on 30 Aug 2011 — 10:08
  • I enjoy reading the report, too. It′s easy to understand that a journey like this is the biggest event in ones life

    flytouch 2 (not verified) wrote on 30 Aug 2011 — 10:08
  • Can I make a suggestion? I think youve got something good here. But what if you added a couple links to a page that backs up what youre saying? Or maybe you could give us something to look at, something that would connect what youre saying to something tangible? Just a suggestion.

    Plumber Clerkenwell (not verified) wrote on 27 Aug 2011 — 13:08
  • I was looking for this particular information for a very long time. Thank you and best of luck. energy healer

    energy healer (not verified) wrote on 26 Aug 2011 — 08:08
  • But getting the best most layer asks for tolerating many environmental results like ultraviolet and infrared, moncler manteau temperatures extremities like rain, manteau de moncler hail as well as the actual harm brought about as a moncler doudoune carry out result of those factors. for that reason the roofing coatings are pas cher moncler specifically produced keeping in wrist watch all these components to make certain that maximal Vestes moncler safety is shipped toward the roofing from these roofing weakening causes.

    Vestes moncler (not verified) wrote on 25 Aug 2011 — 02:08
  • I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Quinceanera Dresses

    Quinceanera Dresses (not verified) wrote on 23 Aug 2011 — 08:08
  • Post new comment

    The content of this field is kept private and will not be shown publicly.
    • Web page addresses and e-mail addresses turn into links automatically.
    • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
    • Lines and paragraphs break automatically.

    More information about formatting options