Step 1: Create a new Sudo User

First of all create a new sudo user for a virtual host. Please see the link below to create a new user.

Create a sudo user in ubuntu (Linux) for our virtual host.

On creation of the user the user directory woud automatically be created in home directory. For example if you have created the user new_user then you can find your user directory in

/home/new_user/

This will be your users root directory

Step 2: Create a virtual host conf file

Type the following command to open a host configuration file.

$ sudo nano /etc/apache2/sites-available/your_vhost_name.com.conf

Paste the following lines to the file:

<VirtualHost *:80>    
    ServerName your_vhost_name.com
    ServerAlias www.your_vhost_name.com
    ServerAdmin webmaster@your_vhost_name.com
    DocumentRoot /home/new_user/your_vhost_name/
	<Directory "/home/new_user/your_vhost_name/">
           AllowOverride all
           Require all granted
        </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Now save the file by CRTL+X , press Y for confirmation then Enter.

You need to enable this configuration by

a2ensite your_vhost_name.com.conf

and You can disable the default host configuration if needed:

$ a2dissite 000-default.conf

Reload the apache

$ sudo systemctl reload apache2

Or restart

$ sudo systemctl restart apache2

Now your host configuration from hosting side is completed. You need to point your domain(vhost_name) to your server IP for this you can edt DNS settings from the domain panel or for testing purpose you can simply edit your host file to point the domain to the server IP.

After that just try to access the site with your_vhost_name.com

You will be able to see your site with your virtual host.

Your feedback is highly appreciated!