From the course: Red Hat Enterprise Linux 8 Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Configure a virtual host

Configure a virtual host

From the course: Red Hat Enterprise Linux 8 Essential Training

Start my 1-month free trial

Configure a virtual host

- [Instructor] For this exercise, you will want to be logged into rhhost1 and have a terminal open. Virtual hosts let us have more than one website per server. We can have different logs, site name, and access control for a virtual host, as well. Let's create a basic virtual host now. I've created a virtual host file for you and included it in the exercise files for this chapter. You want to copy vhost1.conf file to /etc/httpd/conf.d. Once you've done that, let's take a look. Type in less /etc/httpd/conf.d/vhost1.conf and hit Enter. We started a virtual host container with the name virtual host followed by the IP address and port to answer on. We've used a wild card for the IP, so it will answer on all IPs. We've also specified port 80, but we could've chosen something else if we wanted to. We also set the server admin email to webmaster@vhost1.localnet.com. We set the document root to /var/www/html/vhost1.com. With virtual hosts, you can specify a different document root per site…

Contents