模拟搭建httpd服务配置网页访问内容

本文详细介绍了在Linux环境下配置httpd服务的五个实际案例,包括站点设置、TLS加密、虚拟主机创建、权限控制及动态内容提供。每个案例都包含具体步骤和验证方法,适用于RHCE相关技能的学习和实践。
摘要由CSDN通过智能技术生成

1.案例一

需求:本例要求为 http://server0.example.com 配置Web站点,要求如下:
1.从http://ldap.example.com/pub/example.html下载一个主页文件,将其重命名为 index.html
2.将此文件拷贝到站点的 DocumentRoot 目录下,不要对文件 index.html 的内容作任何修改
3.来自my133t.org的客户端的访问会被拒绝

1.1方案步骤

[root@server0 ~]# yum -y install httpd
[root@server0 ~]# cd /var/www/html/
[root@server0 html]#  wget http://classroom.example.com/pub/example.html
[root@server0 html]# mv example.html index.html
[root@server0 html]# systemctl start httpd
[root@server0 html]# systemctl start httpd
[root@server0 html]# systemctl enable httpd
[root@server0 html]# systemctl mask iptables.service ebtables.service
[root@server0 html]# systemctl stop iptable ebtables
[root@server0 html]# firewall-cmd --add-rich-rule 'rule family=ipv4 source address=172.25.0.0/24 service name=http accept'  --permanent
[root@server0 html]# firewall-cmd --reload

1.2验证结果
在这里插入图片描述

2.案例二

需求为站点 http://server0.example.com 配置TLS加密需求如下
1.一个已签名证书从以下地址获取 http://classroom.example.com/pub/server30.crt
2.此证书的密钥从以下地址获取 http://lclassroom.example.com/pub/server30.key
3.此证书的签名授权信息

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值