题目
1、配置web服务器,当访问网站www.haha.com时显示:haha
2、配置web服务器,当访问网站www.xixi.com/secret/显示:this is secret
一、
①
# 恢复快照,关闭安全软件
# 安装所需软件
[root@server ~] # yum install nginx httpd-tools -y
②
在自己电脑上操作
C:\Windows\System32\drivers\etc\hosts 文件进 行DNS 映射
192 .168.80.128 www.haha.com # 添加
③
配置文件
[root@server ~]# vim /etc/nginx/conf.d/hh.conf
[root@server ~]# vim /etc/hosts

④
测试是否ping通
二、
[root@server ~]# mkdir -pv /www/haha
[root@server ~]# echo "hahaha">/www/haha/haha.html
[root@server ~]# systemctl restart nginx.service
[root@server ~]# mkdir -pv /www/xixi/secret
[root@server ~]# echo "xixixixi">/www/xixi/secret/xixi.html
[root@server ~]# systemctl restart nginx.service