QuestionI want to seperate PHP (PHP-FPM) and Nginx into different jails. One jail with Nginx, and one with PHP-FPM / PHP / Wordpress. Nginx is good at serving static assets, so I would like to serve those directly with Nginx. How can I mount a folder from one jail into an other jail (read-only)?I also have a Nodejs app in an other jail, so I would also like to serve the static assets of it directly with Nginx.Side question: When you host multiple PHP sites on the same server. Do you have to install PHP / PHP-FPM in each jail if you want each web-app in each own jail?InfoVersion: FreeBSD 10.2Filesystem: root on ZFSSourceskeramida.wordpress.com - freebsd-nullfscyberciti.biz - freebsd-mount_nullf-usrports-inside-jailI have found this blog on using mount_nullfs for it. But can you use it between jails instead of between the host and a jail?
FreeBSD jails - Nginx, PHP-FPM, Wordpress - Share folder between jails (read-only)
mount;freebsd;nginx;jails;wordpress
nullfs can be used to give a jail read-only access to parts of the host's file system. All the jails live within the host's file system, so the idea of jail-to-jail access is moot.On my system (and I do jails the hard way) I have the following directive in /etc/jails.conf:mount.fstab = /etc/fstab.${name};which means I have separate fstabs for each jail, which then contains something like:/jail/base /jail/somejail/base nullfs ro 0 0There is obviously a whole range of arguments regarding the partitioning of jails, processes and applications. Personally, I like to keep an application self contained within a single jail, then use (yet another) nginx jail to reverse-proxy to all of the application jails. Using ZFS and one application per jail makes it very easy to manage different versions of the stack simultaneously, test new versions, and roll-back where necessary. In summary, I advocate running nginx and php-fpm in each application jail (that contain both static and dynamic content).