Drupal Multi Site install

robj

Verified User
Joined
Aug 4, 2007
Messages
53
I've been working at this for about 2 weeks now. I found a handful of old, old posts, but none of them explain the Virtualhosts portion or the redirects.

Can someone who's accomplished a drupal multi site setup please elaborate on the Virtualhost / .htaccess steps. I've read, and scoured, read and searched, but I still can't get this working.

Help please. Thanks.

rob
 
Correct me if I'm wrong... but if I restart the httpd through the admin interface, any changes I made to the httpd.conf file throught 'Custom HTTPD Configurations' should take affect, yes?

I ended up having to go directly to my account httpd.conf through the root ftp, and modify the files that way.

I needed to change the DocumentRoot, but it didn't seem to take through the admin interface.

rob
 
If you're going to change the Document root you'll have to do it through the shell, and then chattr it so DirectAdmin won't be able to change it.

Jeff
 
I have a solution

I have a solution!

here's how to do that with Direct Admin:

- create a subdomain in Direct Admin example: sub.example.com
- you have a subfolder in public_html, delete that folder with the contents
- chmod only the public_html folder to 777 to create the symlink
- create a symlink between public_html and the name of the sub = sub
upload ln.php to the public_html folder and go to http://www.example.com/ln.php
- make a new database in Direct Admin
- copy the /sites/default folder to /sites/sub.example.com
- edit settings.php and correct the database settings
- go to http://sub.example.com, you get errors with table not found, that's good!
- go to http://sub.example.com/install.php and run the install
- That's it!
- to delete a link upload unlink.php to public_html folder
- chmod only the public_html folder to 777
- run http://www.example.com/unlink.php and that's it.

Here's the php code to create the symlink:

<?php
$target = '/home/username/domains/example.com/public_html/';
$link = '/home/username/domains/example.com/public_html/sub';
symlink($target, $link);

echo readlink($link);
?>

Here's the code to unlink the symlink:

<?php
//set the name of the link
$link = "dev";

//remove the symbolic link we created before
unlink("/home/username/domains/example.com/public_html/{$link}");
?>
 
Configure multisites in Drupal

I do not know if I misunderstood something in this thread but in Directadmin there is a way quite simple to configure multisites in Drupal:

In User level Directadmin Panel add the second, third, etc. site in Advanced features - - > domain pointers - - > Add New Domain Pointer (leave "Create as an Alias" checked) - -> Add

Regards.
 
That part is simple and straightforward. How do you tell each Drupal site which database to use?

Jeff
 
That part is simple and straightforward. How do you tell each Drupal site which database to use?

Jeff

In DirectAdmin "MySQL Management" create Database

In Drupal, each site have its own settings.php:

$db_url = 'mysql://username:password@localhost/databasename';
 
I guess I'm lost because I presumed if they're all using aliases Drupal doesn't know which database to use. What am I missing?

Thanks.

Jeff
 
I am trying to get a Drupal multisite running, but fail sofar. As I am a DirectAdmin newbie you help is greatly appreciated.
My Drupal site is uploaded to a public_html directory. It is accessible at: http://69.94.32.233/~theorichel/

I have two domain names that are correctly pointed at my VPS, but all they produce is a message that "Apache is functioning normally" . How do I get these domains to point to the public_html directory (where Drupal picks up).
The domain names are present in Admin-level dns administration.
It is suggested in this thread to use pointers, but when I try to add one I get the message: 'You cannot use that domain as a pointer. It already exists on the server'.
Should I remove these domain names from the dns administration page? Should I edit httpd.conf? Or what?
 
If both domains are in the same users panel you can change the httpd.conf document root for the domain that you want to share the drupal database.

e.g

|?DOCROOT=/home/edg152/public_html|

Jon
 
Thank you, but when I added a domain to a user and wanted to add to the httpdconf file I got the message: 'The request you've made cannot be executed because it does not exist in your authority level'. So now I am trying to do the same trick with a completely new user
 
And that doesnt work either. When I paste:
|?DOCROOT=/domains/grkmain.com/public_html|

I get: You cannot execute that command

Details

The request you've made cannot be executed because it does not exist in your authority level
 
Well apparently my browser got confused with me switching as admin and user all the time. Starting in a fresh browser the command gotr executed. Alas it I get a page not found error, so I am still fiddling.
 
Something is wrong with the path?

In the user panel I have added a second domain. In the domains directory I can see them together. I want one domain to redirect to the other and I wanted to use Custom HTTPD Configurations for that. In Files the path to the main domain is:
http://69.94.32.233:2222/CMD_FILE_MANAGER/domains/grkmain.com/public_html

So I have added the following line tothe httpd.conf (of the domain to be redirected:

|?DOCROOT=/domains/grkmain.com/public_html|

I have restarted httpd, but I keep getting not found messages

Apparently the path is wrong, but what is the right path then?
 
The right path is: |?DOCROOT=/home/<username>/domains/grkmain.com/public_html|

Domains are available now
 
Back
Top