RHCE第三次作业

网站需求:
1.基于域名www.openlab.com可以访问网站内容为 welcome to openlab!!!
2.给该公司创建三个子界面分别显示学生信息,教学资料和缴费网站,基于www.openlab.com/student 网站访问学生信息,www.openlab.com/data网站访问教学资料
www.openlab.com/money网站访问缴费网站。
3.要求 :(1)学生信息网站只有song和tian两人可以访问,其他用户不能访问。
(2)访问缴费网站实现数据加密基于https访问。
第一题:
第一步:挂载,安装,关闭防火墙和selinux
[root@localhost hh]# mount /dev/sr0 /mnt
[root@localhost hh]# yum install httpd
[root@localhost hh]# systemctl stop firewalld
[root@localhost hh]# setenforce 
第二步:更改配置,实现自定义设置
[root@localhost hh]# cd /etc/httpd/conf.d
[root@localhost conf.d]# vim hhh.conf
u003CVirtualHost192.168.233.131:80>      
 Servername www.openlab.com
 DocumentRoot /www/openlab
\u003C/VirtualHost>\\u003CDirectory /www/>\n        AllowOverride none
        Require all granted\n\u003C/Directory>
手动建立连接
[root@localhost conf.d]# cd /etc
[root@localhost etc]# vim hosts
192.168.233.131 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
第二步:用户访问控制\u003CDirectory /www/openlab/student>
        AllowOverride none
       AuthType Basic
        AuthName \"Please Login...\"
      AuthUserfile /etc/httpd/users       Require user song tian\u003C/Directory>

 SSL:
装包:[root@localhost ~]# yum install mod_ssl
生成证书:
[root@localhost ~]# openssl req -newkey rsa -nods -keyout openlab.key -x509 -days 365 -out openlab.crt
Country Name (2 letter code) [XX]:86
State or Province Name (full name) []:jiangsu
Locality Name (eg, city) [Default City]:nanjing
Organization Name (eg, company) [Default Company Ltd]:openlab
Organizational Unit Name (eg, section) []:ce
Common Name (eg, your name or your server's hostname) []:localhost
Email Address []:admin
添加信息:(所有)
u003CVirtualHost 192.168.233.131:80>       Servername www.openlab.com  DocumentRoot /www/openlab       Alias /student /root/student\n        Alias /data /root/data\n\u003C/VirtualHost>
\u003CDirectory /www/>
     AllowOverride none
 Require all granted\n\u003C/Directory>
u003CDirectory /root/data>
    AllowOverride none
  Require all granted\n\u003C/Directory>
u003CDirectory /root/money>      AllowOverride none
Require all granted
\u003C/Directory>\\u003CDirectory /root/student>
       AllowOverride none
    AuthType Basic\n        AuthName \"Please Login...\"
    AuthUserfile /etc/httpd/users       Require user song tian
\u003C/Directory>
\u003CVirtualHost 192.168.233.131:443>       ServerName www.openlab.com\     DocumentRoot /www/openlab Alias /money /root/money SSLEngine on     SSLCertificateFile /etc/pki/tls/certs/localhost.crt       SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
\u003C/VirtualHost>

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值