Hosting Multiple Websites on One Server with Apache Virtual Hosts
Maximize Your Server’s Potential
You don’t need a separate server for every website you want to host. The ‘Ubuntu System Administration Guide’ explains how to use Apache’s Virtual Hosts feature to run multiple, independent websites on a single server with a single IP address.
How Virtual Hosts Work
Virtual Hosts allow Apache to serve different content based on the domain name the visitor is requesting. You create a separate configuration file for each site (e.g., `wordpress.conf` and `observium.conf`) in the `/etc/apache2/sites-available` directory. Inside each file, you specify the `ServerName` or `ServerAlias` and the `DocumentRoot` for that particular site.
Enabling Your Sites
To activate a new site, you simply create a symbolic link from its configuration file in `sites-available` to the `sites-enabled` directory. After restarting Apache, the server will be ready to serve content for the new domain, allowing you to host dozens of websites on one machine.
This post is based from content of the book Ubuntu System adminstration guide. And the book can be found here https://www.amazon.com/stores/Mattias-Hemmingsson/author/B0FF5CQX13