Would you like to learn how to install Apache and configure multiple Websites on a computer running Ubuntu Linux? In this tutorial, we are going to show you how to use the Virtualhost feature to configure multiple Websites on the same Apache server.
• Ubuntu 18
• Ubuntu 19
• Ubuntu 20
• Apache 2.4.41
In our example, the IP address of the Apache server is 36.160.86.106.
In our example, we are going to create the website: WWW.GAMEKING.TIPS.
Copyright © 2018-2021 by Techexpert.tips.
All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means without the prior written permission of the publisher.
Equipment list
The following section presents the list of equipment used to create this tutorial.
As an Amazon Associate, I earn from qualifying purchases.
Apache – Related Tutorial:
On this page, we offer quick access to a list of tutorials related to Apache.
Apache Virtualhost – DNS configuration
Access the GODADDY website and purchase a DNS domain.
In our example, we purchased a domain named:
You can use any website to purchase a DNS domain, GoDaddy is just my personal choice.
Create a DNS entry pointing your website to the computer running Apache.
In our example, we created a DNS entry pointing WWW.GAMEKING.TIPS to 35.160.86.106.
Use the NSLOOKUP command to test your DNS configuration.
Here is the command output.
Congratulations! You have finished the required DNS configuration.
Tutorial Apache – Virtualhost configuration
Install the Apache server.
Enable Apache module named: Mod_rewrite.
Edit the Apache configuration file.
Add the following lines at the end of this file.
Create directories to store the new website files and logs.
The website files will be stored inside the following directory:
The website logs will be stored inside the following directory:
Create an Apache configuration file for the new website.
Here is the file with our configuration.
Enable the new website.
Restart the Apache service.
Open your browser and try to access the HTTP version of the website.
In our example, the following URL was entered in the Browser:
• http://www.gameking.tips
You have finished the virtual host configuration on the Apache server.