Recently I’ve been using FreeBSD for development, in part because I really like the experience of developing inside of jails. No, I’m not delinquent for tax evasion, what I mean is that FreeBSD provides something called a Jail , which I have found is a happy medium between a VM and a Linux container. Jails, like containers, use the host kernel, however, are less ephemeral than containers. Here’s how I created a container to run Apache for developing this blog. Note in the future I want to use a different web server, maybe something I develop in Rust.
FreeBSD Version: 13.0-RELEASE.
install a new jail to /root/jails/apache
paste the following
start the jail called apache
invoke the default shell
update, upgrade and install bash
change the default shell to bash
exit current shell
We can now use bash!
I needed to run the following command on the host (not the jail) to give permissions to use raw_sockets. Without this, an ominous error message is displayed when in the Jail and using the interface, for example to ping. edit: This is only needed for certain network capabilities such as ping
install and start apache. After this, on the host machine you should be able to curl 192.168.0.1