RHCE---给openlab搭建web网站

本文详细描述了如何为OpenLab搭建一个多页面网站,包括创建www.openlab.com下的子页面如学生信息、教学资料和缴费网站,并设置了访问权限,使用HTTPS进行数据加密,确保只有特定用户能访问学生信息部分。
摘要由CSDN通过智能技术生成

作业:请给openlab搭建web网站
网站需求:
1.基于域名 www.openlab.com 可以访问网站内容为 welcome to openlab!!!
2.给该公司创建三个子界面分别显示学生信息,教学资料和缴费网站,
1、基于 www.openlab.com/student 网站访问学生信息,
2、基于 www.openlab.com/data 网站访问教学资料
3、基于 www.openlab.com/money 网站访问缴费网站。
3.要求
(1)学生信息网站只有 song 和 tian 两个用户可以访问,其他用户不能访问。
(2)访问缴费网站实现数据加密基于 https 访问。

  1. 搭建web网站
    1  cd /etc/yum.repos.d/
    2  vim rpm.repo
    3  mount /dev/sr0 /mnt/
    4  cd 
    5  yum install httpd -y
    6  mkdir -pv /www/openlab
    7  vim /etc/hosts
    8  echo welcome to openlab ! > /www/openlab/index.html
    9  systemctl restart httpd
   10  cd /etc/httpd/conf.d
   11  vim vhost.conf
   12  systemctl restart httpd
   13  setenforce 0
   14  firewall-cmd --permanent --add-service=http
   15  firewall-cmd --reload 

此步骤相关配置文件如下:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  1. 创建三个子界面
[root@localhost ~]# mkdir /www/openlab/student
[root@localhost ~]# mkdir /www/openlab/data
[root@localhost ~]# mkdir /www/openlab/money
[root@localhost ~]# echo welcome to openlab of student ! > /www/openlab/student/index.html
[root@localhost ~]# echo welcome to openlab of data ! > /www/openlab/data/index.html
[root@localhost ~]# echo welcome to openlab of money ! > /www/openlab/money/index.html
[root@localhost ~]# cat /www/openlab/student/index.html
welcome to openlab of student !
[root@localhost ~]# cat /www/openlab/data/index.html
welcome to openlab of data !
[root@localhost ~]# cat /www/openlab/money/index.html
welcome to openlab of money !
[root@localhost ~]# 

  1. 加密
   33  htpasswd -c /etc/httpd/user song
   34  htpasswd /etc/httpd/user tian
   35  cd /etc/httpd/conf.d
   36  vim vhost.conf
   37  systemctl restart httpd
   40  dnf install mod_ssl
   41  cd /etc/pki/tls/certs/
   42  openssl genrsa > jiami.key
   43  openssl req -utf8 -new -key jiami.key -x509 -days 100 -out jiami.crt
   You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:86
State or Province Name (full name) []:shanxi
Locality Name (eg, city) [Default City]:xian
Organization Name (eg, company) [Default Company Ltd]:xianopen
Organizational Unit Name (eg, section) []:rhce
Common Name (eg, your name or your server's hostname) []:www.openlab.com
Email Address []:admin
   44  mv jiami.key ../private/
   45  cd /etc/httpd/conf.d
   46  vim vhost.conf
   47  systemctl restart httpd
   48  setenforce 0
   49  firewall-cmd --permanent --add-service=https
   50  firewall-cmd --reload 
   51  vim vhost.conf
   52  systemctl restart httpd

在这里插入图片描述
测试结果
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

acro_09

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值