Get The Most Affordable Hosting in the World!

Starting at just $1.87/month, Vercaa offers unbeatable pricing for world-class web hosting services.

Fast, reliable, and secure hosting to power your website without breaking the bank. Plus, enjoy a free CDN for faster loading times worldwide!

Get Started Now!

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:

    apache
    <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.
Помог ли вам данный ответ? 1 Пользователи нашли это полезным (1 голосов)