Drupal Multisite on Media Temple Dedicated-Virtual 3.5 (dv Base)

Events happening in the community are now at Drupal community events on www.drupal.org.
makimaki's picture

Hi,

I recently purchased a server from media temple (dv) and am planning on going the multisite route with Drupal for two sites I currently own (let's just name them abc.com & xyz.com). Now, I've read some articles on how to do this and on a theoretical level, I kind of understand but most of the articles seem to focus on shared hosting like dreamhost, MT grid server, etc. Not sure if it makes a difference that I have my own server. Either way, there are some key pieces I am missing that's holding me back from understandng and implementing a drupal multisite. From what I've read, it should be easier with my own server

Anyway, here are some articles I looked over:
1) http://community.contractwebdevelopment.com/drupal-multisite-configurati...
2) http://drupal.org/node/53705

Let me show you what I've done so far

Since I just got this server, through Plesk, I created an account for each domain with physical setup selected, so they each have FTP credentials to login and upload files. As I understand it, I need to select one primary domain which will hold the single drupal installation and all the directories for each domain

So, through FTP on abc.com, I created the setup of /sites directory.

/drupal/sites/abc.com
/drupal/sites/xyz.com

"The key behind Drupal multisite installations is that your host must enable you to point your additional sites to your primary Drupal installation's document root. This can be done via domain parking, symlinks and virtual hosts."

Since I already did it, abc.com/ will be the primary document root. However, from here I am unsure how to go about the pointing. This might not be the best question but I'll ask it anyway: What is the best way to point my additional sites given my circumstances.

DOMAIN PARKING
I am not sure I fully understand domain parking. I looked around and found this:
http://kb.mediatemple.net/questions/457/Plesk+8+(dv)+3.x+-+Creating+a+domain+pointer

Is that how I do it through Media Temple's Plesk? If so, is everything 'fine' once I do that and I can just continue with configuring my sites?

SYMLINK
Most of the articles I've read seem to suggest this route but this seems only for shared hosting and for subdomains. Of course, I don't think I fully understand this pointer-like command. If I go this route, I need shell access to my additional site, xyz.com, and under xyz.com's httpdocs directory (root folder) issue the ln command to point to the root folder but for abc.com?

VIRTUAL HOSTS
I had some brief experience with this back when I was doing some web design, so it's not a total mystery. This seems fairly straight forward. Just change httpd.conf . Where would I find this? I don't think I have root access on the server at the moment (default for mediate temple I believe) but I saw an option to enable it on MT Account center. Do I need this to find and edit httpd.conf?

I also found this related article on root access
http://kb.mediatemple.net/questions/792/(dv)+An+introduction+to+the+root+user

Anyway, I am a lil' techy, though it might not show from here, and if I need to learn more on virtual hosts, I am not daunted by it. I say bring it on :) But I kind of need that guidance right now for the best way to go about this ... although, I am beginning to think either of these options are open to me since I have my own server now.

Anyway, I am hoping someone using Media Temple DV can help out or anybody that knows actually. Maybe even suggest an alternate route.

Thanks guys. Hopefully, this wil help others wih MT DV since I couldn't find another discussion with MT DV specifically.

Comments

Learn virtual hosts

boris mann's picture

No symlinks required. If you learn some virtual hosts and mainly ignore Plesk, this will be easier.

  1. Single Drupal root install -- e.g. /path/to/my/drupal. This will be your docroot.
  2. Under docroot, you now have docroot/sites - it currently contains 'default' and 'all'
  3. You can put one of the sites in 'default' if you like (e.g. abc.com)
  4. Adding the second site is as easy as creating a new folder called xyz.com and copying the default.settings.php into it, renaming it settings.php and running install

This assumes you a) have docroot for both domains set correctly on the server (httpd.conf) and b) you have the DNS set correctly to point abc.com at the server (i.e. use the IP of the server and set up an A record)

Here is a fragment from your VirtualHost declaration:

ServerName abc.com <-- equals "main" domain
ServerAlias xyz.com <-- any other domains pointing to the same multisite install

You can add additional servers on the ServerAlias either separated by spaces - e.g. ServerAlias xyz.com 123.com etc. - or on separate lines:

ServerName abc.com
ServerAlias xyz.com
ServerAlias 123.com

OK, OK, here's a full virtual host:

<VirtualHost *:80>
    ServerAdmin admin@abc.com
    DocumentRoot /home/abc
    ServerName abc.com
    ServerAlias xyz.com 123.com
   <Directory "/home/abc">
       AllowOverride All
   </Directory>
</VirtualHost>

Yes, the folder structure I

makimaki's picture

Yes, the folder structure I understood. I would need to login as the root user to edit httpd.conf on my server, right? And under what directory would I find this file?

I believe I can figure out this httpd.conf issue eventually. I kind of understood your explanation. However, would you know of a good tutorial to quickly get me up to speed

More importantly, I am lost on your second point:

"b) you have the DNS set correctly to point abc.com at the server (i.e. use the IP of the server and set up an A record)"

An A record? I hope you can expand on this. This will probably pose a bigger challenge for me. Not to strong on dns and such issues.

On a side note, I really don't wish for 'small' things to hold me any longer. I've been sitting on getting my site up for over a year now. I give up when I face problems. It's one of my worst habits and I find aggressively and quickly attacking helps overcome this.

Either way, thanks for the help Boris Mann! This is my first time really reaching out to the drupal community

No prob

boris mann's picture

Tutorials:
You know what, I thought some simple Googling would lead to some good tutorials ... but I guess most people cut and paste snippets like the example I gave you. This one for Windows might be a bit helpful.

The default location for httpd.conf is /etc/httpd/conf/httpd.conf. You'll need to sudo or be root to edit the file. Also by default, if you put a file similar to what I pasted in the /etc/httpd/conf.d folder, you won't need to edit the main file. It's best to name the file after your domain -- e.g. abc-com.conf.

DNS:
You've probably registered and pointed domain names at the server through the MediaTemple control panel. In that case, it should be set up correctly already. Learning about registrars and DNS is another step - dive into it if you run into trouble.

In Plesk use domain alias

bigjim's picture

On MT, dv 3.5, I was able to get it set up by adding a domain alias to abc.com in Plesk, add the xyz.com alias, and hand editing the $db_url variable in the sites/xyz.com folder's settings.php file. From there go to install.php and you will be taken through the normal process.

I agree

musry7's picture

Thanks you Boris Mann for the education (heaven knows I need it) but in Plesk on (mt)(dv) 3.5 I took jalama's advice and went to the primary domain and created an alias. It works like a charm and I am tickled that I can also alter its MX and other records.

I have just moved over from Rackspace Cloud Sites and I am very happy with Media Temple.

One tiny thing to note is that each database must have its own unique user in the $db_url variable.

I just got this working,

kpbowler's picture

I just got this working, domain alias is the way to go!

Thanks.

Need help with DV multisite

vrajak@gmail.com's picture

Hi, I've read all the comments here, and have tried using the Domain alias through my Dv 3.5, but I can't get it to work. I just get a page not found display when entering my additional secondary site (The multisite) All is working fine for my primary domain, so no issue there.

I have:

Added a domain alias to my primary domain.

Created and imported the database for my 2nd site

Hand edited the $db_url variable in the sites/example.com settings.php file, also with a unique user.

Gone to example.com/install.php but I just get a "Sorry, we can't find..." page. I would at least expect to get a drupal or Media Temple error page, but I get neither. Can anyone please help or point out what I'm doing wrong?

Thanks!

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: