Re: Best mount point for shared files
Am Donnerstag, 13. Oktober 2011 schrieb Alois Mahdal:
[...]
> Hi,
Hi Alois,
> I have a server from which I want to share files via multiple
> protocols--so far it's HTTP and SMB. The files do not reside
> on the server, they are mounted from other server via NFS. I was
> wondering: where to put the files? Which is the most "Debian"
> way?
>
> For example, I'm mounting these NFS shares to "serve":
>
> storage:/srv/nfs/applications
> storage:/srv/nfs/samples
> storage:/srv/nfs/tools
>
> I'm planning that all of them will available (to Windows stations
> connected to "serve") as:
>
> http://serve/applications/
> http://serve/samples/
> http://serve/tools/
> \\serve\applications\
> \\serve\samples\
> \\serve\tools\
>
> (All shares will be read-only. It's an isolated environment
> for testing, there's no need to have access policy--anyone can
> read, no-one can write.)
>
>
> A) According to FHS, I should put them in /srv/smb/ for SMB
> and /srv/http/ for HTTP. But that would mean mounting each FS
> to two mountpoints. Sounds confusing to me...is it normal? Are
> there any caveats with having one FS in two mountpoints?
>
>
> B) I have noticed that Apache2 has, by default, DocumentRoot set
> to /var/www/. Does this mean that Apache expects me to have main
> storage here? (I know I can change DocumentRoot, but I'm trying
> to learn from default settings... .-D) Actually I'd expect to
> store only index.html and such (there will be some of these).
The FHS suggests /srv for such kind of files and I tend to use it. I am not
sure about sub directories to use in /srv. I use /srv/www for my Apache 2
virtual hosts, in one directory per domain. I create another directory in
there for document root and have a symlink in there point to
/var/log/domain for the log files. I have also used /srv/nfs for nfs
exports. For mounts a directory under /mnt might be more approbiate.
In the end you can choose what you like. But I tend to think that /srv is
more suitable than stuffing files serviced by services.
You could use:
- /mnt/nfs for the nfs mount
- a symlink /srv/smb to /mnt/nfs for the smb export
- a symlink from /srv/http to /mnt/nfs for apache served files
Instead of a symlink you could use a bind mount as well. At work we used
bind mounts to make nfs mounts on a v-server host available to v-server
guests whose images were stored in sub directory trees. Worked like a
charm. But the customer used "/data" for own data and so we sub
directories in there. Works as well. At last its all just a convention.
I am not sure, but sharing files via Samba that were mounted via NFS might
pose some problems. At least I heard that stacking NFS this way might have
its problems. But I am not sure about that.
Ciao,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7
Reply to: