On 20 Jun 2014, at 17:02, Antonio Fernández Pérez <email@example.com> wrote:
I have moved /nfs into /chroot/apache2 and I have tried to make a link inside of the chroot (ln -s /chroot/apache2/nfs/www /chroot/apache2/var/www). Symbolic link not works correctly, but I have modified VirtualHost configuration to point to /chroot/apache2/nfs/www directly and works fine.
You have to keep in mind that Apache can only look into the chroot.
So when you make a symlink to /chroot/apache2/nfs/www, Apache will look up that path in the chroot, so in *reality* it will end up at the real path /chroot/apache2/chroot/apache2/nfs/www.
I like personally to always set up chroots like this:
ln -s .. apache2
The advantage of creating such a construction is that a pathname like /chroot/apache2/foo will always be valid for processes inside and outside the chroot. It allows you to easily switch the chroot on and off without having to change application paths.
Maybe I should write a tutorial on this some time...