I've been trying to get a multisite setup config'd without success. I have a simple, internal LAMP server for work. Currently I have an existing drupal install in the /var/www/html/drupal directory. I have tried to setup a new site as described in many posts I've read, but I can't get it working.
I have created a directory "news" in /var/www/html/drupal/sites and moved in the default/settings.php file. I modified the file to point to a new database.
I created the new database and gave appropriate rights.
I created a sym link in /var/www/html to point to /var/www/html/drual
ln -s /var/www/html/drupal news
I have previously made one mod to my httpd.conf file that is
<Directory "/var/www/html/drupal">
AllowOverride All
</Directory>
This has worked well, and allows clean URLS
When I navigate to servername/drupal things work great
When I navigate to servername/news I end up at the default site. When I click on a link like /node/200 I get sent to servername/news/node/200 which does not exits
If I try to nav to news/install.php I get the page that states my site is already setup
What an I missing here. My goal is to have a news site that is independate of the original, but will share the code/modules/etc
Thanks
Comments
The secret is in the server
The directory you create in "sites" should correspond with the url of the site, not the directory in which it is.
You need to tell apache that you are hosting a new site called /localhost/news. I think you may need to rename the news directory accordingly, but I am not sure.
Drupal distinguishes between sites by what the webserver asks for. Even though you created a new entry in /sites, the webserver is still only asking for pages from the default site.
The server you say...
what then is the best way, or anyway for that matter, to get the server to recognize the new site. Is this via a virtualhost in httpd.conf? If so, can you provide an example.
Thanks
Virtual hosting
http://www.google.com/search?q=apache+virtual+hosting
Ugh
I thought that drupal would automatically handle subsites and that virtualhosts (ie different domains) were something different. Here is a basic example.
if I install drupal in /var/www/html/drupal
then create two subsites
/var/www/html/drupal/sites/site1
/var/www/html/drupal/sites/site2
and move in the default settings.php file into these new sites
I thought that drupal would automatically share the codebase/modules/themes/etc between these two site.
so that I could navigate to localhost/drupal/site1 and localhost/drupal/site2 and each could be totally separate sites, sharing the code.
Am I wrong? Yeah! Help.
You can host several
You can host several different domains or several separate sites within subdomains on one Drupal installation, just as you mention.
However, for Drupal to differentiate between the default site and all the others (whether they be a subdomain of the default domain or a completely different domain (or a subdomain of a different domain, too)) the webserver must treat them all as separate sites. Apache can handle multiple virtual hosts effortlessly - you only need to set them up in the config. See your distro's documentation. To add a new site in apache2 is completely different than apache1.3.
Heck Yeah
Thanks to all who helped out and posted the numerous help tips that made it possible to get this done. Everything is now clicking.
Thanks again.
Harley