Home >Backend Development >PHP Tutorial >Linux NFS server setup_PHP tutorial

Linux NFS server setup_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 08:50:091151browse

Linux NFS server construction

1. NFS: NFS (Network File System) is a network file system. It is one of the file systems supported by FreeBSD. It allows computers on the network to communicate with each other. Share resources over a TCP/IP network.
In NFS applications, local NFS client applications can transparently read and write files located on the remote NFS server, just like accessing local files.
2. Install the NFS server: sudoapt-get install nfs-kernel-server;
3. Configure /etc/exports: sudo vim /etc/exports;
Directories and permissions allowed for Ubuntu NFS mounting It is defined in the file /etc/exports.
Share the folder /home/student/xushan directory under the root directory.
Add the following line at the end of the /etc/exports file: /home/student/xushan *(rw,sync,no_root_squash)

*: represents allowing all network segments to access,

rw: is read and write permissions,

sync: is data is written to the memory and hard disk synchronously,

no_root_squash: is Ubuntu nfs The permissions of the user of the client's shared directory. If the client uses the root user, then the client has root permissions for the shared directory.
4. NFS restart service
$sudo /etc/init.d/portmap restart
$sudo /etc/init.d/nfs-kernel-server restart
5. Test Ubuntu NFS
At this time, you can run the following command to display the shared directory: $showmount -e
Or you can use the following command to mount it on the local disk, for example, mount /home/student/xushan
to Under /mnt: $sudo mount -t nfs 192.168.1.117:/home/student/xushan /mnt
You can run the df command to check whether the mount is successful.
(In this way, the directory created under the /mnt directory will also appear under /home/student/xushan)
After viewing, you can use the following command to uninstall: $ sudo umount /mnt
Note: When using the uninstall command , exit the mounted directory first, and then execute the uninstall command, otherwise the device will be busy and cannot be uninstalled

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1134393.htmlTechArticleLinux NFS server construction 1. NFS: NFS (Network File System) is a network file system, which is a file supported by FreeBSD A system that allows computers on the network to communicate via TCP/I...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn