multi-sites on virtual host

walterbyrd - September 10, 2006 - 17:34

Using drupal 4.7.3 on dollar-hosting.net - a fairly typical virtual host. I do not have ssh, or httpd.conf access, but, I may be able to get the site admin to help me out, if my request does not impact his other customers. database name are assigned a set prefix.

I have already created sub-domains, that was easy.

I have also copied the site/defaut/settings.php to:
sites/sub1.domain.com
sites/sub2.domain.com

I think I want to create seperate databases for each site, adding prefixes to tables, or database names, seems complicated to me. Besides, my host may not allow it.

This is how my public_html directory looks:

domain/
sub1.domain/
sub2.domain/

I keep my main site it's own seperate subdirectory, and users are automatically redirected to that subdirectory by the index.html file. So if you were to go to domain.com, you would be re-directed to domain.com/domain (like wikipedia.org/wiki). The line in my index.html file that does the re-directing looks like this:

So, what must I do next? Must I ask the site administrator to link domain/ to sub1.domain/ and sub2.domain/ ?? Must I edit sites/sub1.domain.com/settings.php and sites/sub2.domain.com/setting.php to point to different databases? Or is there something else?

using seperate DB's for each

VeryMisunderstood - September 10, 2006 - 18:39

using seperate DB's for each site minimizes upgrade headaches in the future.
once you setup your "other" DB's you would alter settings.php to point to the new DB's for each site.

using a prefix on your host's DB structure shouldnt be a problem, but if you use seperate DB's for each site then you won't need prefixes.

Thanks, but I still need to know:

walterbyrd - September 10, 2006 - 18:47

What do I need to link to what? Or what do I need to re-direct to what?

Set up seperate DB's, make

VeryMisunderstood - September 10, 2006 - 19:10

Set up seperate DB's, make note of each DB name.
follow the instructions for setting up a multi-site per the drupal installation instructions Step #3.
the only thing you would "HAVE TO DO" is make sure the settings.php for each site points to the proper DB's set up for each site.
the above sentence will make more sense, once you get the grasp of how the multisite installation works.
using the search tool, using keywords "multi-site setup" provides a wealth of information with regards to this methodology.

I've take the time to find this document for you which provides greater detail into setting up a multi-site drupal.
http://drupal.org/node/10266

if you have any more questions after reading through the above document, feel free to post back.

As you say at the end, you

eagereyes - September 10, 2006 - 19:16

As you say at the end, you have to link sub1.domain and sub2.domain to domain. If you have shell access, you can do that yourself:

rmdir sub1.domain (will only work if sub1.domain is empty)
ln -s domain sub1.domain

If you're unsure, it's perhaps better to have somebody do that for you.

Did that, got this when I tried access sub1.domain.com

walterbyrd - September 11, 2006 - 00:16

Forbidden
You don't have permission to access / on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.34 Server at sales.synet-consulting.com Port 80

------------------

I do not have shell access. But, I do have a facility for site redirection. It looks something like this (the part in brackets [] is what I added):

Add New Redirect
Local URL Path [/sub1] eg: /redirect
Destination URL [http://domain.com] eg: http://www.redirected.com

One more thing:

walterbyrd - September 11, 2006 - 00:21

My last post describes what happend when I did not delete the subdirectories. When I deleted the subdirectories, I got this:

Not Found
The requested URL / was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.34 Server at sales.synet-consulting.com Port 80

tried pointing subdomain to domain, and got a flood of errors

walterbyrd - September 11, 2006 - 01:05

I tried pointing the subdirectory to the domain, but just got that 403 error:

/subdir -> /domain.com = 403 error.

So I tried:

sub1.domain.com -> domain.com

That may have worked a little better, I got something, but it came with a flood of errors:

Warning: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation 'like' query: SELECT * FROM access WHERE status = 1 AND type = 'host' AND LOWER('67.162.157.73') LIKE LOWER(mask) in .. /includes/database.mysql.inc on line 120

Warning: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation 'like' query: SELECT * FROM access WHERE status = 0 AND type = 'host' AND LOWER('67.162.157.73') LIKE LOWER(mask) in ../includes/database.mysql.inc on line 120

Warning: Cannot modify header information - headers already sent by (output started at ../includes/database.mysql.inc:120) in ../includes/bootstrap.inc on line 550

Warning: Cannot modify header information - headers already sent by (output started at ../includes/database.mysql.inc:120) in ../includes/bootstrap.inc on line 551

Warning: Cannot modify header information - headers already sent by (output started at ../includes/database.mysql.inc:120) in ../includes/bootstrap.inc on line 552

Warning: Cannot modify header information - headers already sent by (output started at ../includes/database.mysql.inc:120) in ../includes/bootstrap.inc on line 553

Warning: Cannot modify header information - headers already sent by (output started at ../includes/database.mysql.inc:120) in ../includes/bootstrap.inc on line 554

Virtual Host set up

styro - September 10, 2006 - 21:53

Basically, you just need your admin to add some aliases added to your virtual host configuration so that all the URLs are server out of your Drupal directory.

eg:

<VirtualHost *>
    ServerName main.yourdomain.com
    ServerAlias sub1.yourdomain.com sub2.yourdomain.com www.somethingelsealtogether.org
    DocumentRoot /path/to/your/drupal/directory
    ...
</VirtualHost>

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

Virtual Host set up??

walterbyrd - September 11, 2006 - 00:18

I'm sorry styro, I did not quite understand your post. Also, what file are you referring to with the ?

Apache config

styro - September 11, 2006 - 01:05

Those changes will be made to the main Apache configuration files (eg httpd.conf or apache2.conf etc - the actual file(s) varies between different OS and distros etc), which you generally wouldn't get access to. You mentioned you had a friendly admin that is happy to make changes as long as they don't affect anyone else (which those changes wouldn't). Your admin would make the changes.

On most hosting set ups, each customer gets a virtual host. Virtual Hosting is how Apache runs multiple web sites on the one server. You're just asking your admin to give your virtual host a few extra names to respond to.

Once your virtual host has responded to one of these different names, it then tries to serve up the response by running Drupals index.php because all of these names are attached to your DocumentRoot and index.php is the DirectoryIndex for your DocumentRoot. Once Drupals index.php runs, it also looks at the requested URL and compares it to the directories in /sites to see which settings.php file to use in formulating the response.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

Didn't work

walterbyrd - October 3, 2006 - 21:39

I just got a slew of error messages. Same as when I linked /sub to www.domain.com.

Warning: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation 'like' query: SELECT * FROM access WHERE status = 1 AND type = 'host' AND LOWER('208.65.151.4') LIKE LOWER(mask) in ..../public_html/synet/includes/database.mysql.inc on line 120

Warning: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation 'like' query: SELECT * FROM access WHERE status = 0 AND type = 'host' AND LOWER('208.65.151.4') LIKE LOWER(mask) in ... /public_html/synet/includes/database.mysql.inc on line 120

Warning: Cannot modify header information - headers already sent by (output started at /.../public_html/synet/includes/database.mysql.inc:120) in /.../public_html/synet/includes/bootstrap.inc on line 550

Warning: Cannot modify header information - headers already sent by (output started at /.../public_html/synet/includes/database.mysql.inc:120) in /.../public_html/synet/includes/bootstrap.inc on line 551

Nothing to do with multisite any more

styro - October 3, 2006 - 22:29

That is a MySQL problem that happens when some of your database uses unicode collations and some of it uses ascii collations.

see: http://drupal.org/search/node/Illegal+mix+of+collations

You might want to start a new forum topic specifically relating to that problem to get better help.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

 
 

Drupal is a registered trademark of Dries Buytaert.