I am new to Drupal - but have settled on it (after looking long and hard at Plone). Some of the concepts are going to be difficult for me in that I have always done websites using vi and am used to a structured, hierachical approach. But that's not really to the root of my question...

I am in the process of installing Drupal 6 on my personal machine (running Ubuntu, apache 2, etc) but want to make sure I don't have to "backtrack" things. This machine will be hosting 3 different VirtualHosts and I would like to use Drupal for all 3 of them.

Question 1: Do I need a separate MySql database for each VirtualHost, or does Drupal use the same datafile for all 3?

Question 2: I am somewhat unsure of how to create the virtual hosts in /etc/apache2/conf.d/sites-available when using Drupal. My "old way" of doing it was to setup a separate directory in /home/websites for each virtualhost (and each vh would create it's own set of logs in /var/logs/apache, etc).

I'm sure I'll have other questions as I go along...

Comments

johndoe123456’s picture

I don't know if I misunderstood but if you are trying to use 3 diffrent local sites like localhost, local2, local3 keep reading.
I recommend to use a 3rd party application to handle those sites. I use rapache and after a simple patch its the best way to handle apache on ubuntu. If you don't want to use such tool you have to create sites by hand. First of all you need to create a file with name "drupaldevelopment" (you can use any name) at "/etc/apache2/sites-available"
File content will be

<VirtualHost *:80>

ServerName drupaldevelopment
DocumentRoot /home/yourusername/yourserverdirectory
ServerAlias sitename1 sitename2 sitename3
LogLevel debug
ServerSignature off
<Directory />
		Options FollowSymLinks
		AllowOverride All
</Directory>
<Directory /home/yourusername/yourserverdirectory>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
</Directory>
</VirtualHost>

I would recommend to chose a directory on your user directory so you wont deal with permission problems in future.
Note that aliases for your sites are sitename1 sitename2 sitename3 you can use anything.
next you will enable that site by creating a link to previous file. So your site will be enabled
By the way this is not necessary but I recommend you to enable mod_rewrite to be able to use clean urls. It does not activated at default installation. to do that run "sudo a2enmod" and restart apache.

Now you have done everything with apache next is to extract drupal files to "/home/yourusername/yourserverdirectory" than copy create directories named as sitename1 sitename2 sitename3 under sites folder files at that folder will be exactly same as "default".

So whenever you call sitename1 drupal will look for settings.php file at sitename1 if such file and folder does not exist it will use default folder.

CNBarnes’s picture

You understood my desire KIND OF correctly. The httpd.conf file segment you gave would have all 3 url's answer with the exact same website. But in my case, each website is unique and separate (different templates, different users).

Basically I want to run www.txbarnes.com (my personal family site), www.triumphhomeschool.org (a local homeschool group), and www.texasretrievers.org (for dog folks in texas) all on the same server. I own all of the domain names and have the dns set (at godaddy) to forward http requests to the IP of my server.

I don't quite know why you would recommend a 3rd party application - apache already handles the virtualhosting all by itself.

I think the virtualhost file you gave above is a good start, but I think I will need for each hostname. In fact, I am sure of it.

Also, each virtualhost will have it's own directory; ie.
/home/websites/txbarnes
/home/websites/triumph
/home/websites/txret

johndoe123456’s picture

I recomended rapache because I thought you would use it on your desktop. But checkout this tutorial http://drupal.org/node/138889 I think it has all the answers you need.

CNBarnes’s picture

That post does indeed look to be VERY good. But before I go redoing everything - I do have a couple of other questions:

* what should the hostname of the computer itself be?

--> txbarnes.com is my personal domain name and is the hostname of the machine right now.

--> postfix will need to be configured to answer to all 3 names

--> txbarnes.com and triumphhomeschool.org will both also run MailMan mailing lists (mailman actually makes it very easy to have alternate domain names).

--> triumphhomeschool.org will run a vBulletin board on the same server as well. Either under the url of www.triumphhomeschool.org/forum or forum.triumphhomeschool.org (my inclination is the 2nd).

Are there any "gotchas" I need to be aware of before I begin this?

johndoe123456’s picture

mine is tesla so I believe you can give anything. At least that does not break my local server.
Have no idea about configuring postfix for a remote server.

I don't see myself as a power user so its better to ask to other people I guess.