RHCE基础服务之web&nfs

本文详细描述了如何通过安装Apache和Nginx,配置域名访问,设置权限,以及搭建NFS服务器的过程,包括学生信息、教学资料和缴费网站的权限管理和数据加密。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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
ginx: master 
tcp6       0      0 :::80                   :::*                    LISTEN      33088
ginx: master 
[root@localhost html]# 
避免httpd进程还在使用端口

/etc/nginx/nginx.conf这个文件是nginx的配置信息

cur1 -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 刷新一下

一次性写完
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值