In this tutorial we’ll install the Debian Linux 9 (squeeze), Apache 2 with mpm-itk (to run each web as a isolated user),...
Setting up NFS client/server
adminNetwork File System (NFS) is a network file system protocol originally developed by Sun Microsystems in 1983, allowing a user on a client computer to access files over a network as easily as if the network devices were attached to its local disks.
Server
1. Install the server package
apt-get install nfs-kernel-server
2. Grant permission to a client computer
Add the following line to /etc/exports to grant read only permissions to the folder /var/www for the ip address 192.168.1.2:
/var/www 192.168.1.2(rw,root_squash)
Available options:
ro = Read only access
rw = Read/Write access
root_squash = Replace logins from root user with nobody to avoid superuser privileges over nfs
Restart the server to enable the changes
/etc/init.d/nfs-kernel-server restart
Client
Create the target mount folder
mkdir /mnt/www
Mount the file system:
mount 192.168.1.1:/var/www /mnt/www
Optionally you can mount the filesystem on system boot by adding entry to the /etc/fstab file:
192.168.1.1:/var/www /mnt/www nfs