1.基于域名[www.openlab.com](http://www.openlab.com)可以访问网站内容为 welcome to openlab!!!
1.安装服务
[root@localhost ~]# mount /dev/sr0 /mnt ---获取软件包,挂载光盘
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@localhost ~]# vim /etc/yum.repos.d/base.repo ---配置yum源
yum install httpd -y
2.关闭防火墙
systemctl stop firewalld.service
setenforce 0
3.重启服务
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# cd /var/www/html
3.1
编写内容
[root@localhost html]# echo welcome to openlab!!! >index.html
echo welcome to openlabcd /var/www/html! >index.html
4.直接在浏览器输入我们的IP地址
3-2
域名访问
1.我们先下载nginx这个模块
yum install nginx -y
2.
$ sudo systemctl start nginx
$ sudo systemctl enable nginx
启动服务
[root@localhost html]# systemctl stop httpd
[root@localhost html]# netstat -lntp | grep 80
[root@localhost html]# systemctl start nginx
[root@localhost html]# netstat -lntp | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 33088/nginx: master
tcp6 0 0 :::80 :::* LISTEN 33088/nginx: master
[root@localhost html]#
避免httpd进程还在使用端口
/etc/nginx/nginx.conf这个文件是nginx的配置信息
curl -v http://<Server-IP-Address>
到我们的指定的目录下添加我们的openlab.com
由于我们自己添加的一个域名需要在Windows上自己添加
这是我个人的配置信息
这里我们也是找到了我们的网站(404问题还在解决ing)
2.给该公司创建三个子界面分别显示学生信息,教学资料和缴费网站,基于[www.openlab.com/student](http://www.openlab.com/student) 网站访问学生信息,[www.openlab.com/data](http://www.openlab.com/data)网站访问教学资料,网站访问缴费网站(http://www.openlab.com/money网站访问缴费网站)。
要求 (1)学生信息网站只有song和tian两人可以访问,其他用户不能访问。
(2)访问缴费网站实现数据加密基于https访问。
这里设计到多个网页和域名解析以及https加密的网页,限制用户等需求
我们这里重新开始写
配置一个自定的网站,index网页是student.html
空白页
写个页面跳转
我们现在把权限先写了
给这个组文件所属
现在我们给money网页使用https加密
成功!!!
架设一台NFS服务器,并按照以下要求配置
1、开放/nfs/shared目录,供所有用户查询资料
2、开放/nfs/upload目录,为192.168.xxx.0/24网段主机可以上传目录,
并将所有用户及所属的组映射为nfs-upload,其UID和GID均为210
3、将/home/tom目录仅共享给192.168.xxx.xxx这台主机,并只有用户tom可以完全访问该目录
还是先关闭防火墙
#systemctl stop firewalld
#setenforce 0
2.装服务程序
[root@localhost ~]# yum install nfs-utils rpcbind -y
记得重新启动
systemctl restart nfs-server
按照要求创建目录
并给shared目录a+rw的权限
[root@localhost ~]# vi /etc/exports
一次性在/etc/exports 写完
/nfs/shared/ 0.0.0.0/24(rw)
mkdir /nfs/upload/ -v #创建目录
touch /nfs/upload/{1..5}
vim /etc/exports #编辑共享文件
/nfs/upload 192.168.110.0/24(rw,all_squash,anonuid=210,anongid=210)
/nfs/tom 192.168.232.131(rw)
加上exporfts -r 刷新一下
一次性写完