Im trying to understand how apache and drupal work together. Im using Apache2 and Drupal 5. (6 would not install due to a mySQL bug in ubuntu. Unless theres major differences between Drupal 5 and 6, its ok)
Earlier this week I figured out how to install and setup apache locally for multiple sites. The key there was making files in /etc/apache2/sites-available
and then doing a sudo a2ensite [my site]. This worked fine and allowed me to 'host' multiple sites on my local computer having only 1 copy of apache.
Then I installed Drupal. :-)
No longer do my numerous locally hosted sites work. (error 404) :( So I begin digging into Drupal, trying to understand how it all fits together with apache. Heres what I found, and what I think it means.
In etc/apache2/conf.d/drupal.conf, there is an Alias command (?) and a Directory tag. These seem to override virtual.conf (in the same directory). Reason I think so : virtual hosting is broken and drupal works.
drupal.conf has mention of /usr/share/drupal5. I understand this to be the main, default site that you see when visiting your drupal driven site for the first time. There is index.php, and some folders, one of which is sites. I believe we are to make a folder in sites for each site we want drupal to run. This location differs from the apache way of doing it : in apache, the folder for a site is defined in /etc/apache2/sites-enabled/[my test site] in a VirtualHost tag.
There is also a /etc/drupal/5 folder. I am not sure what it does. It also has an apache.conf folder that points to /usr/share/drupal5. Perhaps this is for a different version of apache, as the file is apache.conf, not apache2.conf?
There is also the lingering question of where my locally hosted (pre drupal) sites went. And how to type the address to a drupal site, then a different one, on this machine. (localhost/example1.com then localhost/example2.com... dosent work) For apache, typing 127.0.1.1 then 127.0.2.1 was working.
Anyway, would be grateful for anyone with a drupal flashlight to shine some light on this!!!
Comments
I have tried the Ubuntu
I have tried the Ubuntu drupal package and I think it is not a good idea.
The useful thing that it is supposed to offer is that it creates automatically a vhost which is supposed to be accessible at http://localhost/drupal6. (or 5). Only it doesn't work if your apache configuration is using, for example, mod_fcgid with suexec and wrappers. (There are other packages which can understand that.)
Drupal's files are owned by root, but at least the package does take case to give apache ownership of the files directory. No problem there.
The real question is not how Drupal communicates with apache but what the package does to configure the server. I think it is simpler to upload Drupal under a user directory, to set up a vhost as usual with a DocumentRoot, a ServerName, and as many ServerAlias you need for your Drupal sites, and to set up a database and a database user.