FreeBSD nullfs jail

From: Eugene Kazarinov <kamuzon_at_milshop.ru>
Date: Fri, 20 Aug 2021 03:15:59 UTC
Information

I made this script a few year ago for FreeBSD 9.0

After that it works on 10 with fixes, on 11 and on 12 versions of FreeBSD.
Now I am testing on 13 version.

It makes nullfs links for jailed FreeBSD with different php.ini,
apache.conf, postfix config, etc.

It does not copy any system bin files. Only configs.

You can use it with NFS directories. I used so on 9-10 versions of FreeBSD,
then FreeBSD runs on hardware computers. After that I use the whole system
on NAS-mounted drives, because FreeBSD runs in a virtual machine on vmWare.


Download

https://bsd.kmd.ru/files/nullfsjail.zip


Install

1. make a directory for hosted sites.

I use /usr/home/

2. make a directory for jail files, links and configs.

I use /usr/jail/

3. copy files from nullfsjail.zip archive to /usr/jail/

 4. edit nano "config" in .makejail..sh

5. run ./.makejail..sh

6. you got some files in /usr/jail/your.domain/

file with lines to add in rc.conf of 9 and 10+ FreeBSD version.

and sh files to start, stop, mount, unmount jail.