I have a NFS mount at /mnt/web/ on OpenBSD 5.2.
How can I mount this so it's accessible to the web?
Currently I'm soft linking it to /var/www/web
ln -s /mnt/web /var/www/web
I've added an alias directive in the apache config like so:
Alias /web/ "/var/www/web/" Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all
The ownership shows that everyone should have read and execute. What am I doing wrong? Apache says:
Not Found The requested URL /web was not found on this server.
Is it possible that OpenBSD's default chroot'd apache configuration doesn't allow this?
Additional Info:
I was able to access the NFS share when linked to the /var/www/users directory and apache configured with the "UserDir" option.
UPDATE
It works when Apache is run without chroot enabled ...so, my next question: How can I get this to work within chroot?
UPDATE
I changed the mount location and mount
options and now it works [ see my answer below ]. But I'd like advice on optimal permissions. These are static files only. Who should own these files?
I believe that your alias might be wrong, check out the documentation for the apache website for the difference between an alias such as "/web" and an alias "/web/".
I got it to work in chroot'd Apache on OpenBSD5.2 by mounting the NFS share thusly:
mount -t nfs -o suid,sync nfs-server:/nfs/web/ /var/www/htdocs/web
...then altering the Document root stanza in httpd.conf as follows:
So ....now that it "works" * could someone please clarify what permissions I should be seeing when listing the NFS contents?
ls -al /var/www/htdocs/web
EDIT Everything is A-OK. There was no need for the Apache user 'www' to own these files or directories -- so now he doesn't. There was no need for any write access for anyone other than the owner -- so there isn't. Everything works and is accessible over the web and I believe the security is quite sound -- Ie., the default OpenBSD chroot environment is enabled and the permissions on the NFS share are strict.
755 for directories and 644 for files. I think that's a wrap!
Ie., by works I simply mean: shows up in browser