How to set up Apache Virtual Hosts on Ubuntu?

The purpose of Apache Virtual Hosts is to run multiple websites on a single machine. It could be IP-based or Name-based. IP-based virtual hosting sets different directives based on IP addresses. Therefore, each host needs a separate IP address, and…