2. Virtual hosting is a method for hosting multiple domain names on a single
server. There are two types of virtual hosting: “Name-based virtual hosting”
and “IP-based virtual hosting.” With the name-based virtual hosting, you can
host multiple websites on a single machine with a single IP address.
3. Getting Started: Installing Apache
– First, you need to update your system and then install Apache.
– To do this, run the following command:
– To verify whether the Web server is working or not, open the web browser and
navigate to the URL 127.0.0.1
4. Create Virtual Host Files:
– Now, create a virtual host file by this command
Add the following content:
Save and close the file.
5. After creating the virtual host files, you need to enable a new virtual host
then reload and restart apache2.
You can do this by running
6. Testing Virtual Hosts:
– You need to add a host entry on each and every remote or local system to
resolve the website by name.
– You can do this by editing the “/etc/hosts” file.
10. Conclusion
I hope this presentation will help you to set up virtual host in Ubuntu. There is no
limit on the number of virtual host Apache can handle, so you can create and
host as many websites you want.