1.安装httpd,并将访问apache服务器的首页修改为hello.html, 且内容为: "My Home Page is hello"
[root@wjy ~]yum install httpd -y
[root@wjy html]# vim /etc/httpd/conf/httpd.conf
[root@wjy html]# ls -l
total 8
-rw-r--r--. 1 root root 22 Jul 28 16:10 hello.html
-rw-r--r--. 1 root root 27 Jul 28 15:53 index.html
[root@wjy html]# echo "My Home Page is Hello" >hello.html
[root@wjy html]# systemctl restart httpd
2.虚拟主机:虚拟两台主机ip为100,200, 对应访问目录:/www/ip/100, /www/ip/200
并创建首页文件index.html
[root@wjy ~]# nmcli c modify ens160 +ipv4.addresses 192.168.139.100/24
[root@wjy ~]# nmcli c modify ens160 +ipv4.addresses 192.168.139.200/24
[root@wjy www]# mkdir /www/ip/{100,200} -p
[root@wjy ip]# echo "This is page for 100" > /www/ip/100/index.html
[root@wjy ip]# echo "This is page for 200" > /www/ip/200/index.html
[root@wjy ip]# cd /etc/httpd/conf.d/
[root@wjy conf.d]# vim myhosts.conf
<Directory "/www/ip">
AllowOverride None
Require all granted
</Directory>
<VirtualHost 192.168.139.100:80>
DocumentRoot "/var/www/ip/100"
</VirtualHost>
<VirtualHost 192.168.139.200:80>
DocumentRoot "/var/www/ip/200"
</VirtualHost>
[root@wjy conf.d]# systemctl restart httpd
[root@wjy conf.d]# getenforce
Enforcing
[root@wjy conf.d]# setenforce 0
[root@wjy conf.d]# curl 192.168.139.100
This is page for 100
[root@wjy conf.d]# curl 192.168.139.200
This is page for 200
3.配置不同端口的虚拟主机访问apache服务器
[root@wjy conf.d]# mkdir /www/port/{8080,9090} -p
[root@wjy conf.d]# echo "this is page for port 8080" > /www/port/8080/index.html
[root@wjy conf.d]# echo "this is page for port 9090" > /www/port/9090/index.html
[root@wjy conf.d]# cd /etc/httpd/conf.d/
[root@wjy conf.d]# vim myhosts_port.conf
Listen 8080
Listen 9090
<Directory "/www/port/">
AllowOverride None
Require all granted
</Directory>
<VirtualHost 192.168.139.100:8080>
DocumentRoot "/www/port/8080"
</VirtualHost>
<VirtualHost 192.168.139.100:9090>
DocumentRoot "/www/port/9090"
</VirtualHost>
[root@wjy conf.d]# systemctl restart httpd
[root@wjy conf.d]# curl 192.168.139.100:8080
this is page for port 8080
[root@wjy conf.d]# curl 192.168.139.100:9090
this is page for port 9090
4.可选:SSL握手协议发送哪些包,分几个阶段