This article covers how to create apache virtual host files to host multiple domains on a single Ubuntu server. Each website published on the Internet is hosted on a web server (host), connected to the network with a public IP address and able to manage requests for web pages on a browser (client) such as Chrome, Firefox or Internet Explorer.
If you need to host a website on your machine, first, install a web server. Among those available, one of the best known is Apache, an open source software compatible with both Unix and Windows systems.
How to Install Apache on Ubuntu ?
1. To install Apache 2 through the official Ubuntu repositories, proceed by typing:
$ sudo apt-get update
$ sudo apt install apache2
Since Apache communicates externally, it should be inserted among the exceptions of your Firewall.
2. In case of using UFW, allow bidirectional communications between Apache and a Client by typing:
$ sudo ufw allow 'Apache Full'
3. Apache should already be running. To check its stateuse the command:
$ sudo systemctl status apache2