I have a (probably silly) question concerning virtual hosts. I'm creating a series of sites which all use different databases. That part already works perfect and I'm beginning to love Drupal for not making me reinvent the wheel. But, the problem I'm encountering is dealing with paths. For example, with the image.module, you pick the images directory which is relative to the index.php of the Drupal application itself instead of some virtual root. With the suggested documentation, you have Apache's virtual configuration point to the same site for each site.
<VirtualHost *>
Server bob.bob.com
ServerAlias bob2.bob.com
DocumentRoot /.../drupal
</VirtualHost>
<VirtualHost *>
Server gary.bob.com
DocumentRoot /.../drupal
</VirtualHost>
The problem comes in the relative paths. If bob.bob.com uses "images/" for the image.module and then gary.bob.com also uses "images/" they both end up using the same directory. This is also related to issues with favicon.ico which is different from each one, but is pulled from the same place (/.../drupal). This forced bob.bob.com and gary.bob.com to both have the same favicon.ico, which I don't want.
I could easily fix this with making a complete copy of Drupal for each one and creating a directory, but that would be an administration headache if I add new modules or make changes to the system.
What I think I'm looking for is something I can mark as "non-drupal documents come from" X. So any time Drupal checks to see if a file exists, it actually prepends the virtual root in front of the path. For example, requested http://bob.bob.com/favicon.ico would pull out /var/bob.bob.com/favicon.ico but the rest of the code continued to run from /.../drupal. Naturally, this configuration would probably have to go in the conf.php directory.
Ignoring what I think I want, is there some way to do it without me writing my own modules or creating a path to Drupal to resolve this? And is this a resonable, suggestable, or even an easy thing to figure out?
I also notice that if I use an alias in apache, such as bob2.bob.com (above), it looks for bob2.bob.com.php in the includes file instead of bob.bob.com. Is that right?
Comments
Don't have time to write a le
Don't have time to write a lengty howto on this, but here are some pointers.
For images and seperate favicons use the Apache Alias configuration directive.
Not sure how image module works in regards to paths and it might need some modifications to do the right thing.
--
Kjartan
Alias
I was hoping for a more integrated way, actually. If I use the Alias directive, I pretty much need to create a directory to store all the local stuff (i.e. "site") for the storage. But, that would create the links to say "http://.../site/bob.png".
I'll use that for the time being until I find a better answer. That was where I was going already, I was just hoping to be able to say "http://.../bob.png" and have it look in a different directory.
Thanks.