rhce第三次作业

该文详细描述了在Linux环境中安装和配置HTTP服务的过程,包括挂载设备,安装httpd服务,关闭防火墙和SELinux。然后,进行了虚拟主机配置,创建自定义目录并设置权限。接着,创建了用户并实施了基于用户名的访问控制,确保了对特定目录的访问安全。
摘要由CSDN通过智能技术生成

第一步:挂载,安装,关闭防火墙和selinux

[root@localhost hh]# mount /dev/sr0 /mnt

[root@localhost hh]# yum install httpd
[root@localhost hh]# systemctl stop firewalld
[root@localhost hh]# setenforce 0

第二步:更改配置,实现自定义设置

[root@localhost hh]# cd /etc/httpd/conf.d
[root@localhost conf.d]# vim hhh.conf

<VirtualHost 192.168.164.80:24>
        Servername www.openlab.com
        DocumentRoot /www/openlab
</VirtualHost>

<Directory /www/>
        AllowOverride none
        Require all granted
</Directory>
手动建立连接

[root@localhost conf.d]# cd /etc
[root@localhost etc]# vim hosts
192.168.164.80 www.openlab.com

创建目录
[root@localhost etc]# mkdir /www/openlab 
[root@localhost etc]# echo welcome to openlab > /www/openlab/index.html

测试:
[root@localhost etc]# curl http://www.openlab.com
welcome to openlab

第一步:创建目录

[root@localhost etc]# cd /root
[root@localhost ~]# mkdir {student,data,money}

修改权限:[root@localhost ~]# chmod /root 777

第二步:添加内容

[root@localhost ~]# echo who is money > /root/money/index.html
[root@localhost ~]# echo who is data > /root/data/index.html
[root@localhost ~]# echo who is student > /root/student/index.html


 

第一步:创建用户

[root@localhost ~]# htpasswd -c /etc/httpd/users song
New password: 
Re-type new password: 
htpasswd: password verification error
[root@localhost ~]# htpasswd /etc/httpd/users tian
New password: 
Re-type new password: 
Adding password for user tian
 

第二步:用户访问控制

<Directory /www/openlab/student>
        AllowOverride none
        AuthType Basic
        AuthName "Please Login..."
        AuthUserfile /etc/httpd/users
        Require user song tian
</Directory>
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Rek'Sai

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

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

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

打赏作者

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

抵扣说明:

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

余额充值