# httpd.conf
Listen 192.168.1.100:80
Listen 192.168.1.101:80
DocumentRoot "/var/www/site1"
ServerName site1.example.com
Require all granted
DocumentRoot "/var/www/site2"
ServerName site2.example.com
Require all granted
Listen 指定 IP:Port,VirtualHost 匹配相同地址DocumentRoot、ServerName、日誌apachectl configtest
systemctl reload httpd
curl -H "Host: site1.example.com" https://192.168.1.100/