rhel7 http实例3

前面的配置请参考:

rhel7 http实例:http://4708948.blog.51cto.com/4698948/1702486

rhel7 http实例2 :http://4708948.blog.51cto.com/4698948/1702487

题目14

配置虚拟主机

在server0上扩展您的web服务器,为站点

http://14.example.com创建了个虚拟主机,然后执行下述步骤:

A设置document Root 为/var/www/virtual

B 从ftp://172.25.254.250/pub/RHCE/14.html下载文件并重名名为index.html不要对文件index.html的内容做任何修改

C 将文件index.html放到虚拟的documentRoot目录下

D 确保floyd用户能够在/var/www/virtual目录下创建文件

注意:原始站点http://server0.example.com必须仍然能够访问

配置WEB内容的访问

在您的server0上的web服务器的documentRoot目录下创建一个名为private的目录,要求如下

A 从ftp://172.25.254.250/pub/RHCE/15.html下载一个文件副本到这个目录,并且生命名为index.html

B 不要对这个文件的内容做任何修改

C 在server0上,任何人都可以浏览private的内容,但是从其他系统不能访问这个目录的内容

服务器

[root@server0 conf.d]# vim hrr.conf

rhel7 http实例3_style

[root@server0 conf.d]# systemctl restart httpd

[root@server0 conf.d]# curl http://www.server0.example.com/restricted/

desktop0 only

[root@server0 conf.d]# ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

inet 172.25.0.11 netmask 255.255.255.0 broadcast 172.25.0.255

客户机

[root@desktop0 conf.d]# curl http://www.server0.example.com/restricted/

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<html><head>

<title>403 Forbidden</title>

</head><body>

<h1>Forbidden</h1>

You don't have permission to access /restricted/

on this server.

</body></html>

[root@desktop0 conf.d]# curl http://www.server0.example.com

151515151515151515151515151515

[root@desktop0 conf.d]#

[root@desktop0 conf.d]# ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

inet 172.25.0.10 netmask 255.255.255.0 broadcast 172.25.0.255

实现动态WEB内容

在server上配置提供动态web内容,要求如下:

A 动态内容名为16.example.com的虚拟主机提供

B 虚拟主机侦听在端口8909

C 从ftp://172.25.254.250/pub/RHCE/webinfo.wsgi下载一个脚本,然后放在适当的位置,无论如何都不要修改此文件的内容

D 客户端访问http://14.example.com:8009/必须被example.com域内的所有系统访问