天天看點

rhel7 http執行個體3

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

[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

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域内的所有系統通路

      本文轉自810105851 51CTO部落格,原文連結:http://blog.51cto.com/4708948/1702489,如需轉載請自行聯系原作者

繼續閱讀