Configuring Apache Virtual Hosts in WHM

thumb_up 1  ·  sell WHM Virtual Host Configuration, Setting Up Virtual Hosts in WHM, Apache Virtual Hosts Management in WHM

Apache Virtual Hosts are a fundamental aspect of web server configuration, allowing you to host multiple websites on a single server. When you're using cPanel's WebHost Manager (WHM), managing Apache Virtual Hosts becomes a streamlined process. In this comprehensive tutorial, we'll guide you through the process of configuring Apache Virtual Hosts in WHM, enabling you to host multiple websites on your server efficiently.

Prerequisites

Before we dive into the configuration process, ensure you have the following prerequisites:

  1. Access to WHM: You need administrative access to your WHM control panel.
  2. A Registered Domain: You should have a registered domain name that you want to associate with one of your virtual hosts.
  3. SSH Access: SSH access to your server is required for some advanced configurations.

Step 1: Log in to WHM

  1. Open your web browser and navigate to your WHM login URL (usually https://your-server-ip:2087).

  2. Enter your WHM username and password to log in.

Step 2: Access the Apache Configuration Interface

  1. In the WHM dashboard, locate and click on the "Apache Configuration" option or use the search bar to find it.

  2. In the "Apache Configuration" interface, click on "Include Editor."

Step 3: Configure Virtual Hosts

  1. Within the "Include Editor," locate the "Pre VirtualHost Include" section.

  2. Click on "Editor" next to "All Versions."

  3. In the text editor, you can define your virtual hosts using Apache configuration directives. Here's a basic example of a virtual host configuration:

    apacheCopy code
    <VirtualHost *:80> ServerAdmin webmaster@example.com DocumentRoot /var/www/html/example ServerName example.com ServerAlias www.example.com </VirtualHost>

    Replace /var/www/html/example with the path to your website's files and example.com with your domain name.

  4. Click "Save" to save your virtual host configuration.

Step 4: Verify Configuration

  1. After saving the configuration, click "Apply" to apply the changes to your Apache server.

  2. To verify that your virtual host is working, open a web browser and enter your domain name (e.g., http://example.com). It should display the content from the specified DocumentRoot.

Step 5: Manage Virtual Hosts

  1. To add more virtual hosts, repeat steps 3 and 4, modifying the configuration for each additional domain.

  2. To edit or delete existing virtual hosts, return to the "Include Editor" and make the necessary changes or remove the corresponding configuration.

Conclusion

Configuring Apache Virtual Hosts in WHM is an essential skill for web server administrators, enabling you to host multiple websites efficiently on a single server. With this step-by-step tutorial, you can confidently create and manage virtual hosts to host multiple websites, ensuring that each site functions independently and securely. As your web hosting needs grow, mastering virtual host configuration in WHM will be a valuable asset in managing your server effectively and providing a seamless web hosting experience for your clients or users.

 
 
The End! should you have any inquiries, we encourage you to reach out to the Vercaa Support Center without hesitation.

Was this answer helpful?

Related Articles

description

Enabling Global Gzip Compression in WHM for All Accounts and Websites

Apache mod_deflate module is one of the best friends of a cPanel system administrator. It allows you to save bandwidth and accelerate page…

arrow_forward
description

Validating and Confirming cPanel License Information

cPanel and WHM is the #1 leading control panel in the web hosting market. And time ago we posted a post about how to get a free cpanel…

arrow_forward
description

Changing SSH Port via WHM for Enhanced Security

This is a new way I found to reset ssh port from WHM control panel if you ever lost SSH access because you forgot what is the port you are…

arrow_forward
description

Essential Nginx Modules for cPanel and WHM: Top 4 Picks

As we all know, cPanel doesn’t fully support Nginx yet, it will be ready in the future as it is one of the most requested features from…

arrow_forward
description

A Guide to Utilizing the MultiPHP INI Editor in cPanel

With the new EasyApache 4 we have a new option called MultiPHP INI Editor. It’s a simple PHP editor for WHM users who need to change PHP…

arrow_forward
arrow_back « Back