Comments on How to Configure Apache Virtual Hosts on Ubuntu 22.04

The virtual hosting concept is used by companies to host multiple websites using a single machine. In this tutorial, we will see how we can host two virtual hosts on an Ubuntu 22.04 system using name-based virtual hosting. We will use the Apache web server.

5 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: oxoocoffee

" Let these directories be public_html and public_html"Did you mean host1/ and host2/ above?

By: AL Rachels

I have followed the directions and I get the correct results when trying the steps in, Testing the Apache vhost Setup. BUT, you left off the vital steps and examples to actually get apache2 to show a web page! How do you do that?

By: till

Apache serves the pages you added as part of this guide. To show that site, you enter its domain name in your web browser.

By: AL Rachels

I followed all the steps and got the correct results using curl. BUT, you do not show or give examples of how to get apache2 to serve web pages from these virtual hosts. How do you do that?

By: till

> I followed all the steps and got the correct results using curl.

This means apache works and serves the web pages you created as part of this tutorial in the folders /var/www/host1/public_html and /var/www/host2/public_html Now you can replace the pages with your own HTML pages.