mod_vd

Here I am hosting a copy of Anthony Howe’s mod_vd Apache 2 module (version 2.0), because I had an extremely difficult time finding it while setting up my new VPS.

Please note that I will NOT provide support for this module , because I did not write it.  I’m simply hosting a copy of it here to be nice to people who want it.

Files

Installation

Run

apxs2 -a -i -c mod_vd.c

as root, and then restart Apache.  On Ubuntu (and possibly other distros) you’ll need to install the Apache development packages (on Ubuntu, I think these are apache2-threaded-dev for threaded Apache (apache2-mpm-worker) or apache2-prefork-dev for non-threaded (apache2-mpm-prefork), and I think the default on Ubuntu is non-threaded).

I’ve tested this on this server, which is was running Ubuntu Minimal 10.04 x86 with Apache 2.2.14 (packages apache2-mpm-prefork and apache2-prefork-dev 2.2.14-5ubuntu8) at the time of this writing.

Credits

mod_vd is copyright 2003 by Anthony Howe.  The reason I’m hosting this is because he (quite rudely) removed all of his Apache modules from his site with no explanation (and also saying that requests for explanation and archives will be ignored), and it was very difficult for me to find.  (The license does allow non-commercial redistribution without modification, provided that the license info remains intact, which is what I have done here.)

I found the source file in the archive for a NetWare build of it I found here.  Thanks to whoever maintains that site for hosting it!

The original Web site for mod_vd, which has of course been removed, is here.  The archive contains a (maybe older) copy of it.

TIP:  How to map subdomains using mod_vd

To use mod_vd to map subdomains to a corresponding directory in your document root, like this:

http://sub.domain.example/ -> /www/domain.example/sub

or

http://c.b.a.domain.example/ -> /www/domain.example/a/b/c

use this in your configuration file (this also works in vhosts):

<IfModule mod_vd.c>
    VdEnable on
    VdChopSuffix 2
    VdPathPrefix /path/to/document/root
</IfModule>

Be sure to change the value of VdChopSuffix if your domain (without subdomain) has anything other than two levels (eg. john.doe.name = 3, localhost = 1).

(I just copied this out of the vhost conf file from my old shared hosting account with Joyent, who uses mod_vd.)