Port-based implementation
[root@localhost httpd]# cat conf.d/test.conf
<VirtualHost *:80>
DocumentRoot /data/html/a
<Directory "/data/html/a">
Options none
Allowoverride none
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:8080>
DocumentRoot /data/html/b
<Directory "/data/html/b">
Options none
Allowoverride none
Require all granted
</Directory>
</VirtualHost>
Hostname-based access
[root@localhost httpd]# cat conf.d/test.conf
<VirtualHost *:80>
DocumentRoot "/data/html/a"
ServerName "www.a.com"
<Directory "/data/html/a">
Options none
Allowoverride none
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/data/html/b"
ServerName "www.b.com"
<Directory "/data/html/b">
Options none
Allowoverride none
Require all granted
</Directory>
</VirtualHost>
IP address-based access
[root@localhost httpd]# cat conf.d/test.conf
<VirtualHost 192.168.199.243:80>
DocumentRoot "/data/html/a"
ServerName "www.a.com"
<Directory "/data/html/a">
Options none
Allowoverride none
Require all granted
</Directory>
</VirtualHost>
<VirtualHost 192.168.192.128:80>
DocumentRoot "/data/html/b"
ServerName "www.b.com"
<Directory "/data/html/b">
Options none
Allowoverride none
Require all granted
</Directory>
</VirtualHost>