By ronniead on
Hi,
I'm setting up a multi-site installation, and I'm a little stuck...
I've installed drupal here: \home\username\public_html\drupal\ It works fine!
But I'm trying to create a symbolic link to the drupal installation to the root of this folder: \home\username\public_html\newaddonsite.com\ however, it keeps on creating the symbolic link of the folder "drupal" and essentially installs it here: \home\username\public_html\newaddonsite.com\drupal
I'm using this syntax for the symbolic link: "ln -s \home\username\public_html\newaddonsite.com\drupal ."
Does anyone have any suggestions?
Comments
man ln
This is a question about the usage of ln.
ln takes two arguments, source file and target file. In your command \home\username\public_html\newaddonsite.com\drupal is the source file and . is the target file. This will make a directory "drupal" in whatever directory you currently happen to be in that links to \home\username\public_html\newaddonsite.com\drupal
- Robert Douglass
-----
my Drupal book
In the following I assume
In the following I assume that you have configured the new domain name so that http://www.newaddonsite.com goes to the directory /home/username/public_html/newaddonsite.com
First, remove the directory of the new site and replace it with a symlink with the same name, pointing to drupal:
Then, to let Drupal recognize the new site, create a settings directory for it under drupal/sites:
Then go to http://www.newaddonsite.com with your browser. The installations script should start, where you can supply the database information for the new site.
Thanks
@ cog.rusty
Thanks for your clear instructions.
I followed them and had a Drupal 6 Multisite up in no time.
redirect loop
I am trying to add a second site to an existing 5.9 installation. My directory structure is the same as noted here, minus a /drupal level directory:
Drupal is installed here:
/home/username/public_html/
The first site, which works fine, is in:
/home/username/public_html/sites/site1.com
I want to add a second site, which I have placed in:
/home/username/public_html/sites/site2.com
My hosting provider, Bluehost, automatically creates:
/home/username/public_html/site2.com/
which I have deleted and replaced with a symlink named site2.com which points to:
/home/username/public_html/
When I browse to site2.com, the browser address bar changes to http://www.site2.com/install.php, but displays this message:
"The server is redirecting the request for this address in a way that will never complete."
All of the documentation indicates that Drupal will automatically pick up the new site. What to do when that fails?
Have you made any
Have you made any modifications to Drupal's .htaccess file to take care of something about the first site? (for example in RewriteBase or any rewrite containing the first domain name?)
For Drupal 6, also try with an empty settings.php file for the new site.
For Drupal 5, make sure that the settings.php file of the new site is a fresh one, from the installation package.
.htaccess has been tweaked.
I am using Drupal 5, and settings.php for the new site is fresh.
I had uncommented RewriteBase / to get clean URL's to work, but they work now without it, so I have recommented it out. It had no effect on my problem with the new site.
The following appears to have been added to the end of the .htaccess file. There aren't any comments with it, and I don't remember adding this, so it may be something added by our hosting provider. There is another domain name that redirects to site1.com.
# $Id: .htaccess,v 1.81.2.4 2008/01/22 09:01:39 drumm Exp $
RewriteCond %{HTTP_HOST} ^site1alternatename.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.site1alternatename.com$
RewriteRule ^(.*)$ http://site1.com [R=301,L]
When I comment these out and go to site1alternatename.com, the behavior is identical to what I get when I go to site2.com, so your suggestions seem to be leading me down the right path. Unfortunately for me, the documentation for .htaccess I have read so far has been well over my head. Are there any shortcuts to achieving an understanding what this section is doing/not doing so I can fix it?
Thanks for the suggestions!
Here is a line from site2's
Here is a line from site2's log:
123.45.67.89 - - [19/Aug/2008:22:52:56 -0600] "GET /install.php HTTP/1.1" 302 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072820 Firefox/3.0.1"
I'm guessing that the "-" should be a useful URL instead, and that I need a rewrite rule to put it there. While I don't understand it all just yet, the rewrite statement above seems to be something like "If the URL is this or that, send it there." So, what should "there" be for Drupal to see site2?
The question is (a) Why does
The question is
(a) Why does site2.com do a 302 redirect at all? It shouldn't need to. It should go straight to its specified directory (which is now a symlink leading back to Drupal, but that is not a redirect).
(b) Which apache directive or settings causes that redirect?
If I understand the
If I understand the framework correctly, something, probably in httpd.conf, is causing the 302 redirect. Since I don't have access to httpd.conf, if I can find out what causes the redirect, I can counter that with something in .htaccess. So, I should ask Bluehost support what they think causes the 302 redirect and/or how to direct both site1.com and site2.com to /home/username/public_html/, where Drupal resides. It seems counterintuitive to have two different sites point to the same directory. Do I have that right?
Generally it is possible to
Generally it is possible to have many domains point to the same directory (in which case you wouldn't need symlinks), but not all hosts offer this option in their cpanel. I don't know about bluehost.
Notice that when we have a multisite, Drupal chooses the right site based on the requested URL which the user typed in the browser. For this reason, an .htaccess rewrite cannot be used for making a sub-site go to Drupal's main directory, because then the URL will be changed to the one of the main site. Only a symlink or a domain pointer can take you to Drupal's main directory without changing the requested URL.
However Drupal does use redirects inside each site to make "clean urls" work. To make sure that the problem is not caused by something in Drupal's .htaccess, disable it temporarily (by renaming it) and try again. (Your sites which use clean URLs will break while you are doing this, but it is just a temporary test).
You could also:
- Check your cpanel where you set up site2.com, in case there are different options for how to set it up. (I don't really know what options bluehost offers.)
- Take a look at other threads related to drupal/bluehost problems, for example http://drupal.org/node/137225
Thank you
Thank you for suggesting I search for bluehost among other threads, which also led me to search on Drupal in the Bluehost forums. I hadn't thought of that, duh! Ultimately, the solution came from a seemingly unrelated task. In the course of updating our site from 5.9 to 5.10, I realized that my notes said to delete install.php along with the other text files as no longer needed when an install or upgrade was complete, something I picked up from one of the install guides, which I can no longer find. After I replaced the file, the installation of the second site went as it should.
solution
sorry it took me so long to reply. for some reason I'm not getting updates when people are responding to this thread.
I found a solution which works for me here: http://stephenondrupal.blogspot.com/2007/10/how-to-correctly-set-up-drup...
See Multisite via symlinks
It has other solutions as well.
Hope this helps!