Bobcares

The right way we configure Webmin multiple domains

by | May 12, 2019

Pointing multiple domains to a single IP address help server owners to save cost.

But, this need special configuration as all websites should point to correct home directory.

Luckily, Webmin offers a feature to set up multiple sites on a single IP.

At Bobcares, we often get requests from our customers to set up “Webmin multiple domains” as part of our Server Management Services.

Today, we’ll see how our Support Engineers configure multiple domains in Webmin and fix the top 2 common issues.

 

How we set up multiple domains in Webmin

Adding multiple sites is quite easy with front-end interface in Webmin.

Let’s see how our Technical Team configure Webmin multiple sites by performing the below steps.

1. First, we log into the Webmin control panel.

2. Then, we go to Others > File Manager to create a folder under /var/www.

3. Next, to create virtual host we navigate to Servers > Apache Web Server > Create virtual host.

4. Under Create virtual host, we set the port to 80 and selected path in Document Root.

5. Next, in Virtual Server Options, we clicked on Edit directives & added the following codes.

<VirtualHost *:80>
DocumentRoot /var/www/siteA.com
ServerName siteA.com
<Directory /var/www/www.siteA.com>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

6. Now, we repeated the steps 2 to again add multiple sites.

7. Finally, we added the code for the second site & clicked on the Apply Changes.

<VirtualHost *:80>
DocumentRoot /var/www/siteB.com
ServerName siteB.com
<Directory /var/www/www.siteA.com>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

The interface for creating VirtualHost appears as shown.

That’s how we set up multiple domains in Webmin.

 

Top 2 common errors & fixes after setting Webmin multiple domains

From our experience in managing Webmin servers, we often see some errors reported by customers after enabling multiple domains.

Let’s see how our Support Engineers figure it out.

 

1. Wrong settings in Apache configuration file

Recently, one of our customers approached us after setting multiple domains & when he restarted Apache service, it resulted in an error like “Resolving: [warn] _default_ Virtual Host overlap on port 80, the first has precedence”.

This error happens when there is a bad setting in the Apache configuration file.

So, we took the following steps to solve them.

1. Initially, we opened the Apache configuration file /etc/httpd/conf/httpd.conf.

2. Next, we looked for the VirtualHost block to check the settings.

3. We found that the VirtualHost block was commented with #.

4. Then, we uncommented them & saved the file.

5. Finally, we restarted the service.

systemctl restart httpd

That fixed the problem. Now the user could access the multiple domains without any failure.

 

2. Permission issue

Similarly, when the permission is not set in the folder created under /var/www also results in getting an error like 403 Forbidden.

To open a file or directory execute permission is a must. Otherwise, you will get forbidden error when you try to access a directory that contains HTML file.

To grant the permission we executed the following steps.

1. First, we logged into Webmin control panel.

2. Then, we go to Others > File Manager and clicked the directory.

3. Next, at the top, we selected the option Info.

4. And we chose Write permission to Others & Group.

5. Finally, saved the file.

That’s how we fixed the problem.

 

[Having trouble with Webmin multiple domains? We’ll fix it for you.]

 

Conclusion

To be more precise, adding multiple domains to one IP in Webmin is a good way to direct traffic so that it improves the site performance. Today, we saw how our Support Engineers configure Webmin multiple domains & fixed the top 2 common issues.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

3 Comments

  1. Herbert

    This would run under the same user, would it not?

    Reply
    • Sijin George

      Hello Herbert,
      Yes, by default, they would run under the Apache user (nobody). But you can enable suexec and configure it to run CGI scripts as domain owner too.

      Reply
  2. Poonam

    Nice article

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.