基于域名[www.openlab.com](http://www.openlab.com)可以访问网站内容为 welcome to openlab!!!
给该公司创建三个子界面分别显示学生信息,教学资料和缴费网站,基于[www.openlab.com/student](http://www.openlab.com/student) 网站访问学生信息,[www.openlab.com/data](http://www.openlab.com/data)网站访问教学资料,网站访问缴费网站(http://www.openlab.com/money网站访问缴费网站)。
学生信息网站只有song和tian两人可以访问,其他用户不能访问。
访问缴费网站实现数据加密基于https访问。
架设一台NFS服务器,并按照以下要求配置
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
[root@localhost ~]# yum install nginx
[root@localhost ~]# vim /etc/nginx/conf.d/openlab.conf
创建文件和目录,并在文件中写入数据:
[root@localhost ~]# mkdir /www/openlab -pv
[root@localhost ~]# echo welcome to openlab!!! > /www/openlab/index.html
[root@localhost ~]# systemctl restart nginx.service
配置dns
C:\Windows\System32\drivers\etc打开在该路径下的hosts文件
将IP地址和域名对应:192.168.146.135 ?www.openlab.com
配置dns:
[root@localhost ~]# vim /etc/hosts
在hosts里写:192.168.146.135 www.openlab.com
Curl www.openlab.com
[root@localhost ~]# vim /etc/nginx/conf.d/openlab.conf
创建文件和目录:
[root@localhost ~]# mkdir /www/openlab -pv
[root@localhost ~]# vim /etc/nginx/conf.d/openlab.conf
[root@localhost ~]# systemctl restart nginx.service
[root@localhost ~]# vim /etc/nginx/conf.d/openlab.conf
创建一个虚拟目录用来设置https
[root@localhost ~]# vim /etc/nginx/conf.d/money.conf
[root@localhost ~]# mkdir /www/openlab/money
[root@localhost ~]# mv /www/openlab/money.html? /www/openlab/money/
[root@localhost private]# openssl genrsa 2048 > money.key
[root@localhost certs]# openssl req -utf8 -new -key ../private/money.key -x509 -days 365 -out money.crt
[root@localhost certs]# systemctl restart nginx
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
?
[root@localhost ~]# yum install nfs-utils rpcbind -y
systemctl start nfs
【注】:启动nfs会默认启动rpcbind
vim /etc/exports
[root@localhost ~]# mkdir -pv /nfs/shared
[root@localhost ~]# touch /nfs/shared/{file1,file2,flie3}
[root@localhost ~]# systemctl restart nfs-server
客户机需要创建一个挂载点目录并将文件挂载在此处
[root@client ~]# mkdir /nfs_1
[root@client ~]# mount 192.168.146.135:/nfs/shared ?/nfs_1
在配置一的基础上配置:
vim /etc/exports
/nfs/upload 192.168.239.0/24(rw,all_squash,anonuid=210,anongid=210)
Exportfs -r
在配置一的基础上配置:
vim /etc/exports
/home/tom 192.168.146.129(rw)
[root@localhost ~]# mkdir /home/tom -pv
[root@localhost ~]# touch /home/tom/{file1,file2}