ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

考试系统与NHS文件共享

2021-12-30 17:36:17  阅读:169  来源: 互联网

标签:web www 文件共享 upload html nfs NHS root 考试


考试系统与NHS文件共享


 

首先我们要搭建web服务环境

安装web软件

1、安装web软件
[root@web01 opt]# yum install httpd php php-devel -y

2、将代码放置于网站的根目录
[root@web01 opt]# cd /var/www/html/

# 上传代码
上传源代码包
解压源代码包:unzip

3、授权
[root@web01 html]# chown -R www.www /var/www/html

4、关闭selinux和防火墙
[root@nfs ~]# setenforce 0
[root@nfs ~]# systemctl disable --now firewalld

5、修改web软件的用户
[root@web01 html]# vim /etc/httpd/conf/httpd.conf
User www
Group www

6、启动web软件
[root@web01 html]# systemctl start httpd

7、测试

    1、上传
    
    2、访问
    http://172.16.1.7/upload/1_linux.jpg

NFS文件共享


1、修改NFS配置文件
[root@nfs nfs1]# vim /etc/exports
/web/upload  172.16.1.0/20(rw,sync,all_squash,anonuid=666,anongid=666)

2、创建挂载点
[root@nfs nfs1]# mkdir /web/upload
[root@nfs nfs1]# chown www.www /web/upload

3、重启NFS
[root@nfs nfs1]# systemctl restart nfs-server rpcbind

4、客户端安装NFS软件
[root@web01 html]# yum install nfs-utils -y
[root@web02 html]# yum install nfs-utils -y
[root@web03 html]# yum install nfs-utils -y

5、挂载
[root@web01 html]# mount -t nfs 172.16.1.31:/web/upload /var/www/html/upload
[root@web02 html]# mount -t nfs 172.16.1.31:/web/upload /var/www/html/upload
[root@web03 html]# mount -t nfs 172.16.1.31:/web/upload /var/www/html/upload

6、测试
用web2上传,web3查看

 

标签:web,www,文件共享,upload,html,nfs,NHS,root,考试
来源: https://www.cnblogs.com/Roseblack/p/15749780.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有