Hi,
I am hoping you can help me. I work for a university and have recently been assigned to a project working with on-line community portals built using Drupal. I am trying to set up a sandbox system that I can play with, so that I don't mess up the actual sites. The problem I am having is setting up multisites using the same code base. I can get a single site set up and running just fine, however every time I try and set up multisites everything stopes working. I have followed all the instructions I can find on-line including these from the Drupal site:
http://drupal.org/getting-started/6/install/multi-site
http://drupal.org/node/290768
http://drupal.org/node/138889
I have also done extensive on-line Google searches. I have not been able to find any method that works. I think it has something to do with how Apache2.2, Ubuntu 9, and Drupal 6 interact with each other. However, I am not completely certain. I have included my system set up below and I know all the components are working, because I can get a single site working.
Dell Inspiron 6000
Ubuntu 9.10 Desktop
Apache2.2
mysql-server-5.0
mysql-client-5.0
php5
php5-gd
php5-mysql
phpmyadmin
Drupal 6.14
If any one can suggest what the problem might be or point be to a site that might help me, my students and I would greatly appreciate it.
Thanks
Comments
First thing to check is are
First thing to check is are both urls pointing to the same drupal install before you try to begin using multisite. That's usually the hardest part of the setup. But I can verify it works fine in Ubuntu 9
Could you give us further
Could you give us further detail about what you're experiencing beyond "it doesn't work?" Are you seeing any errors in your browser? Just a white page, maybe? Have you checked your PHP and web server error logs?
The Boise Drupal Guy!
Error Messages
Sorry it has taken me a while to get back to you. I had deleted the files and reinstalled them when i cold not get multi sites working. I also feel like an idiot since I did not even thing of the apache error logs. Following the instructions on this page: http://drupal.org/node/290768 these are the errors I have in the apache error log
[Fri Nov 20 22:21:03 2009] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /usr/share/drupal6/sites/DExample.com/
[Fri Nov 20 22:24:49 2009] [error] [client 127.0.0.1] File does not exist: /var/www/DExample.com
I get different error message in the browser window depending on what address I use.
When I use this address:
http://localhost/drupal6/sites/DExample.com/install.php
I get this message:
Warning: require_once(./includes/install.inc) [function.require-once]: failed to open stream: No such file or directory in /etc/drupal/6/sites/DExample.com/install.php on line 4
Warning: require_once(./includes/install.inc) [function.require-once]: failed to open stream: No such file or directory in /etc/drupal/6/sites/DExample.com/install.php on line 4
When I use this address:
http://localhost/DExample.com
I get this message:
Not Found
The requested URL /DExample.com was not found on this server.
Apache/2.2.12 (Ubuntu) Server at localhost Port 80
When I use this address:
http://www.DExample.com
I get this message:
Server not found
Fire Fox can't find the server at www.DExample.com.
I hope this means something to you. Since most of this does not mean anything to me. I am starting to realize how little I really know about this.
You're going about it the
You're going about it the wrong way.
Your last try was the closest - when testing multi-site installations locally, you want to try to access them by domain name. But your system doesn't know that it should be looking on your local computer to find the web site, and instead tries to go out and ask the internet where that site is located - but the internet doesn't know either. You have to tell your computer that the site you're trying to access is on the local computer.
But you probably don't want to use the exact domain name that the site will have when it goes live; otherwise, you won't be able to access the "live" version of your site at the proper domain name. In other words, you don't want to always see the local version of the site when you enter dexample.com into your browser.
Here's what I do. First, create a symbolic link (like a Mac OS alias or Windows shortcut) for the site directory and give it a name of a domain in the fictitious ".test" TLD. (Also, rename your site directory to be entirely lowercase - there may be issues otherwise.)
cd /usr/share/drupal6/sites/mv DExample.com dexample.com
ln -s dexample.com dexample.test
Now, we need to tell our computer to look locally for the dexample.test domain name. This is done by editing the hosts file, which is usually at /etc/hosts. Edit it, and add this line to the end:
127.0.0.1<tab>dexample.test(That should be an actual tab character where it says "
<tab>", if that's not obvious.) Now, after saving the hosts file (no reboot necessary), if you go to example.test in your browser, you should now be aiming in the right direction. (In your case, you'll probably need to go to example.test/drupal6.)The Boise Drupal Guy!
A few other tips...
You'll also need to configure apache to serve this domain name. If you have a typical Ubuntu setup, you should have a config file for this site in /etc/apache2/sites-available. It should have either a ServerName or ServerAlias directive with your fictional domain name. After changing this, you'll need to reload your apache config with "apache2ctl graceful".
To check that your fictional domain name is pointed at your local machine, you can "ping dexample.test". If it doesn't return 127.0.0.1, double check your hosts file.
It is possible to use your real domain name locally - just set it up in your hosts file and remember to comment it out with a # when you go live.
Here's a quick overview of how it all works together...
User requests dexample.test in browser
Browser looks up dexample.test and Ubuntu returns 127.0.0.1 from hosts file.
Browser requests page from 127.0.0.1, and inserts an HTTP "host" header specifying the domain "dexample.test". This is how virtual hosting on one IP address works.
Apache is listening to 127.0.0.1 and sees the host header specifying "dexample.test".
Apache looks at it's vhosts and finds one with a ServerName or ServerAlias of "dexample.test"
Apache runs Drupal in that site's DocumentRoot.
Drupal looks at the "hosts" header and finds "dexample.test"
Drupal looks for a folder called "sites/dexample.test". This is the key to multisite. There could be many site folders but they must match the host header sent from the browser.
If found, Drupal uses the settings file found there. If not, Drupal uses the settings in "sites/default"
multisite
i cannot create a multi site,
how the folders should be named within sites,if the sites required are
http://localhost/drupal
http://localhost/drupal/example1
http://localhost/drupal/example2
Multisite folders
You will need to create the right folders as well as configure Apache.
These should be helpful:
http://drupal.org/getting-started/6/install/multi-site
http://drupal.org/node/53705