1.安装httpd,并将访问apache服务器的首页修改为hello.html, 且内容为: "My Home Page is hello"
[root@server conf.d]# yum install httpd -y
[root@server conf.d]# rpm -al httpd
[root@server html]# vim index.html
2.虚拟主机:虚拟两台主机ip为100,200, 对应访问目录:/www/ip/100, /www/ip/200,并创建首页文件index.html
[root@server html]# nmcli connection modify ens160 +ipv4.addresses 192.168.111.100/24
[root@server html]# nmcli connection modify ens160 +ipv4.addresses 192.168.111.200/24
[root@server html]# nmcli connection up ens160
[root@server ~]# echo "this is page for 100" > /www/ip/100/index.html
[root@server ~]# echo "this is page for 200" > /www/ip/100/index.html
配置虚拟主机
3.配置不同端口的虚拟主机访问apache服务器
[root@server prot]# ls -l
total 0
drwxr-xr-x. 2 root root 6 Jul 27 18:19 80
drwxr-xr-x. 2 root root 6 Jul 27 18:19 90
[root@server prot]# echo the port is 80 > /www/prot/80/index
[root@server prot]# echo the port is 90 > /www/prot/80/index