LTER Home | Intranet | LNO
Search:

Multiple Sites vs Multisites

Submitted by isangil on Fri, 11/06/2009 - 13:22.
I have no idea what you like best, whether to let apache control the one to many relationships between a single IP and many "websites" (using virtual hosts - lets call this 'multiple sites') or whether you prefer a drupal approach, using the same codebase and database to host multiple instances of drupal, lets call this a 'multisite' deploy.  both approaches have pros and cons, with the drupalites leaning towards the 'multisite' approach.

there is some confusion out there.  i sure got confused between outdated or incomplete instructions, and of course, my total lack of formal training in apache. i use hardy heron (ubuntu 8.04) with apache calling the game - that is - using multiple sites.

let me explain you what worked for me.

1) I have at least three DNS entries pointing to the same IP address, call them "microbe", "eneko" and "genome" (im faking it).  I needed my friendly sysadmin help to make those entries in my DNS server.

In my physical host (an old dell), I have three websites corresponding to those three mentioned entries in the DNS tables, plus some more websites not declared (you'll hit those other instances (of drupal) if you know the path relative to the DocumentRoot.

2) The important files are in /etc/apache2/sites-available   I made an entry for two of the
DNS entries.  I edited a file called "microbe.lternet.edu" - this is the file minimum content that works.

NameVirtualHost *
<VirtualHost *:80>
        ServerName microbe.lternet.edu
        ServerAdmin ***@***.edu
        DocumentRoot /var/www/path_to_microbes
        <Directory /var/www/path_to_microbes>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

Note:
of special importance is: -you need the NameVirtualHost directive. Otherwise Apache will tell you something like:

 [warn] VirtualHost ***.***.***.***:80 overlaps with VirtualHost ***.***.***.***:80, the first has precedence, perhaps you need a NameVirtualHost directive

It is important that the argument of NameVirtualHost and <VirtualHost coincides.  Here i put "*".

After this file, I created other file named "genome.lternet.edu".  Then this is my content:


NameVirtualHost *
<VirtualHost *:80>
        ServerName genome.lternet.edu
        ServerAdmin ***@***.edu
        DocumentRoot /var/www/path_to_genomes
        <Directory /var/www/path_to_genomes>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

then i reloaded apache  sudo /etc/init.d/apache2 reload
and all went good..  i did not make a third host for the third DNS entry: By default, that points to the documentRoot, and am able to navigate to the other un-DNS-mapped instances of drupal.

There is more to it... Some "blogs" out there were misleading, with partial info that worked, and partial info missing.  I am assuming you know about other tweaks you may need.

I gathered the knowledge using google, but when i had a basic understanding i had to go
to apache's own: http://httpd.apache.org/docs/2.2/vhosts/name-based.html

Next: LDAP and Drupal + SSL
Submitted by isangil on Fri, 11/06/2009 - 13:22.