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.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF