zoukankan      html  css  js  c++  java
  • linux NFS 服务器的安装

    1. 安装 nfs 服务

    [root@allentuns ~]# yum -y install  nfs-utils rpcbind

    2. 启动 nfs 服务

    [root@allentuns ~]# /etc/init.d/rpcbind start

    Starting rpcbind:                                           [  OK  ]

    [root@allentuns ~]# /etc/init.d/nfs start

    Starting NFS services:                                      [  OK  ]

    Starting NFS mountd:                                        [  OK  ]

    Starting NFS daemon:                                       [  OK  ] Starting RPC idmapd:                                        [  OK  ]

    3. 创建共享目录

    [root@allentuns ~]# mkdir -pv /web/htdocs mkdir: created directory `/web'

    mkdir: created directory `/web/htdocs'

    [root@allentuns ~]# ll -d /web/htdocs/                                                                                                50

    drwxr-xr-x. 2 root root 4096 May  3 18:50 /web/htdocs/

    4. 添加共享目录其它用户有写权限 [root@allentuns ~]# chmod o+w /web/htdocs [root@allentuns ~]# ll -d /web/htdocs/

    drwxr-xrwx. 2 root root 4096 May  3 18:50 /web/htdocs/

    5. 修改配置文件,设置共享目录或者分区

    [root@allentuns ~]# vim /etc/exports

    #增加一行

    /web/htdocs 192.168.1.5(rw)

    6. 重读 exports 文件,使立刻生效

    [root@allentuns ~]# exportfs -r

    7. 查看服务器共享的文件。前提需要域名解析,否则报错

    [root@allentuns ~]# uname -n

    allentuns

    [root@allentuns ~]# echo "127.0.0.1 allentuns" >> /etc/hosts

    [root@allentuns ~]# showmount -e

    Export list for allentuns:

    /web/htdocs 192.168.1.5

  • 相关阅读:
    SQL语句基础之 单表查找
    SQL语句基础之 管理数据库,表 和 数据
    JavaWeb之 JSP:自定义标签
    JavaWeb之 JSP:内置对象,EL表达式,JSP标签基础
    JavaWeb之 JSP基础
    JavaWeb之Servlet:Cookie 和 Session
    JavaWeb之Servlet: ServletConfig 与 ServletContext
    JavaWeb之 Servlet执行过程 与 生命周期
    JavaWeb之Servlet:请求 与 响应
    Vue.js中 watch(深度监听)的最易懂的解释
  • 原文地址:https://www.cnblogs.com/fanweisheng/p/11327505.html
Copyright © 2011-2022 走看看