RHCE(7.5)第二次作业

该文详细描述了如何为openlab搭建基于www.openlab.com的web网站,包括创建学生信息、教学资料和缴费网站的子页面,并设置了song和tian两位用户的访问权限。同时,对缴费网站实现了HTTPS加密访问,确保数据安全。
摘要由CSDN通过智能技术生成

综合练习:请给openlab搭建web网站
1.基于域名www.openlab.com可以访问网站内容为 welcome to openlab!!!
默认yum源已配置
先关闭防火墙和selinux
mount /dev/sr0 /mnt
安装http服务
yum install httpd
编写配置文件
vim /etc/httpd/conf.d/vhosts.conf
在这里插入图片描述

创建对应的资源文件
mkdir /www/openlab -p
echo ‘welcome to openlab!!!’ > /www/openlab/index.html
cat /www/openlab/index.html
image.png
systemctl restart httpd(重启服务)
vim /etc/hosts(添加对应的ip和域名到缓存文件)
curl http://www.openlab.com(测试连接)
image.png
2.给该公司创建三个子界面分别显示学生信息,教学资料和缴费网站,基于www.openlab.com/student 网站访问学生信息,www.openlab.com/data网站访问教学资料
www.openlab.com/money网站访问缴费网站
mkdir /www/openlab/data(先创建data文件)
echo this is data > /www/openlab/data/index.html(写入信息)
curl http://www.openlab.com/data/
mkdir /www/openlab/student(创建student文件)
echo this is student > /www/openlab/student/index.html(写入信息)
vim /etc/httpd/conf.d/vhosts.conf(编写配置文件)
image.png
添加song和tian两个用户并设置密码
htpasswd -c /etc/httpd/users song
htpasswd /etc/httpd/users tian
cat /etc/httpd/users
systemctl restart httpd(配置完成之后重启服务)
curl http://www.openlab.com/student/ -u song:1234(测试连接)
ll /www/openlab/
vim /etc/httpd/conf.d/vhosts.conf(编写配置文件并实现加密)
image.png
创建对应的资源文件
mkdir /www/certs
mkdir /www/certs/money
echo this is money > /www/certs/money/index.html(写入信息)

3.要求
(1)学生信息网站只有song和tian两人可以访问,其他用户不能访问。
(2)访问缴费网站实现数据加密基于https访问。

yum install mod_ssl -y
mkdir /certs
mkdir /private
openssl genrsa 2048 > /private/haha.key
openssl req -new -key /private/haha.key -x509 -days 365 -out /certs/haha.crt
ll
ll /private/
ll /certs/
systemctl restart httpd
curl -k https://www.openlab.com/money/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值