apache tutorial - How to create virtual host in Apache - apache - apache web server - apache server - apache2
1) IP based vhosts 2) Multiple vhosts with the same Port 3) Defining vhosts using Macro (Apache2.4)
1) IP based vhosts
Just change the port to your given IP(s). The port is irrelevant for the decision which vhost is chosen.
2) Multiple vhosts with the same Port
Since NameVirtualHost isn't needed anymore you can just write multiple vhosts with the same port.
Here the opposite applies: the IP is irrelevant, but if the request is received on port 80 the name you entered is evaluated. Did you call ex1.com the 2nd vhost gets picked. And if you called any other url (like otherurl.com, but also example3.com) the first one will be picked. You can use this vhost as a 'fallback' if you will.
3) Defining vhosts using Macro (Apache2.4)
Creates two vhosts, one for port 80, one for 443, and sets the used variables accordingly.