On Sun, Feb 12, 2017 at 6:03 PM, wrote:
> I have a special use case for the HTTPD server, I would like to disable
> the chroot but can't seem to get it working correctly.
While I can't help you with your httpd chroot issue, I can suggest that
if you need to access a part of the filesystem outside of /var/www, you
can NFS mount it from yourself.
For example, suppose you have a directory /nfs/archive/dist/OpenBSD, and
you want to serve it via httpd. You can do something like this:
1. add a line to /etc/exports:
/nfs/archive/dist/OpenBSD -ro 127.0.0.1
2. start nfsd:
# rcctl start nfsd
3. remount your data under /var/www:
# mkdir -p /var/www/htdocs/pub/OpenBSD
# mount -r 127.0.0.1:/nfs/archive/dist/OpenBSD /var/www/htdocs/pub/OpenBSD
At this point you should be able to chroot to /var/www, and still be able
to access files under /htdocs/pub/OpenBSD.
This may not be the prettiest way to achieve your goal but it's simple
and it works for ftpd. I assume it would work just as well for httpd.
-ken