mod_jail

Current version: 0.4

Installation instructions:

From packages:

# pkg_add -r mod_jail

From ports:

# cd /usr/ports/www/mod_jail && make all install clean

From source code:

Download source code of mod_jail from this page, extract and decompress it tar -xzvf mod_jail-0.4.tar.gz
Building mod_jail:
just type cd mod_jail && make
Install mod_jail:
make install (as root)

Apache:

Edit apache config, you may use httpd.conf.add as example, if you are using apache 1.3 make shure that AddModule mod_jail.so is next line after ClearModuleList, for apache2 LoadModule libexec/apache2/mod_jail2.so is enough.
LoadModule jail_module        libexec/apache/mod_jail.so
# ...

ClearModuleList
AddModule mod_jail.c
# ...
#
<IfModule mod_jail.c>
        jail_rootdir            "/usr/local/www"
        jail_hostname           "www.localhost.net"
        jail_address            192.168.0.1
        jail_scrlevel           3 # recommended value
</IfModule>
	    
All parameters must be set.

Make it all working:

Just restart apache:
apachectl stop; apachectl start
So, it should work now. If verion of your FreeBSD is >= 5.1, you can see jail by jls command:
# jls
 JID  IP Address      Hostname                      Path
  50  192.168.0.1     www.localhost.net             /usr/local/www

This module is tested to compile and work on FreeBSD 6.0, 6.1 and 6.2. I expect it to work on any FreeBSD > 4.0