1.安装httpd,并将访问apache服务器的首页修改为hello.html, 且内容为: "My Home Page is hello"
1.安装httpd
yum install httpd -y
2.建立hello.html文件
echo "My Home Page is hello" > /var/www/html/hello.html
3.配置httpd.conf文件
vim /etc/httpd/conf/httpd.conf
在index.html前加上hello.html 就会先寻找hello.html文件再找index.html文件
<IfModule dir_module>
DirectoryIndex hello.html index.html
</IfModule>
4.重启服务,停用防火墙
systemctl restart httpd
systemctl stop firewalld
setenforce 0
2.虚拟主机:虚拟两台主机ip为100,200, 对应访问目录:/www/ip/100, /www/ip/200并创建首页文件index.html
1.新建两个ip
nmcli c modify ens160 +ipv4.addresses 192.168.86.100/24
nmcli c modify ens160 +ipv4.addresses 192.168.86.200/24
nmcli c up ens160
2.然后创建对应目录,并定义网页内容
mkdir /www/ip{100,200} -p
echo "This is page for 100" > /www/ip/100/index.html
echo "This is page for 200" > /www/ip/200/index.html
3.接下来定义配置文件/etc/httpd/conf.d/myhost.conf
vim /etc/httpd/conf.d/myhost.conf
<VirtualHost 192.168.86.100:80>
DocumentRoot /www/ip/100
ServerName 192.168.86.100
</VirtualHost>
<VirtualHost 192.168.86.200:80>
DocumentRoot /www/ip/200
ServerName 192.168.86.200
</VirtualHost>
<Directory /www/ip>
AllowOverride None
Require all granted
</Directory>
4.重启服务,停用防火墙和selinux
systemctl restart httpd
systemctl stop firewalld
setenforce 0
3.配置不同端口的虚拟主机访问apache服务器
1.创建对应目录,并定义网页内容
mkdir /www/port{9090,9091} -p
echo "This is page for 9090" > /www/port/9090/index.html
echo "This is page for 9091" > /www/port/9090/index.html
2.定义配置文件/etc/httpd/conf.d/myhost.conf
vim /etc/httpd/conf.d/myhost.conf
3.重启服务,停用防火墙和selinux
systemctl restart httpd
systemctl stop firewalld
setenforce 0
4.可选:SSL握手协议发送哪些包,分几个阶段
这个链接里写的很不错
https://www.fisec.cn/1209.html