Bobcares

Webmin Apache reverse proxy – Here’s how we configure it

by | May 20, 2019

Apache reverse proxy (or gateway) helps to balance load among several back-end servers.

As a result, it improves the performance of the websites for faster communication.

But, wrong reverse proxy setup can result in website failure.

At Bobcares, we often get requests from our customers to configure the “Webmin Apache reverse proxy” as part of our Server Management Services.

Today, we’ll see how our Support Engineers configure Apache reverse proxy in Webmin and fix the related errors with it.

 

How we configure Apache reverse proxy in Webmin

Let’s see how our Support Engineers set up Apache reverse proxy in Webmin control panel.

Here are the steps we execute to configure Apache reverse proxy.

1. First, we login to Webmin, and go to Webmin > Servers > Apache Webserver > Global configuration > Configure Apache Modules.

2. Then, we mark the checkbox for the mod_proxy module.

3. And we click the Enable Selected Modules button.

4. Next, we navigate to Global Configuration > Edit Config Files.

5. In Edit Directives in File, we choose /etc/httpd/conf/httpd.conf & added the virtual host block like this.

<VirtualHost *:80>
ServerName webmin.yourdomain.com
ProxyPass / http://localhost:10000/
ProxyPassReverse / http://localhost:10000/
</VirtualHost>

6. After that in /etc/webmin/config file, we add the line referer=webminhostname.

7. Finally, we restart the service to apply the changes.

service httpd restart

The proxy settings interface of a Webmin virtualhost look as shown below.

Common issues after setting Apache reverse proxy in Webmin

From our experience in managing servers, we’ve seen customers facing different kinds of problems with Apache reverse proxy in Webmin.

Let’s see how our Support Team solved common errors.

 

1. Wrong setting in Webmin configuration file

Recently, one of our customers reported us with a problem regarding the Apache reverse proxy. When he tried to access Webmin on the browser, it resulted in an error like “503 Service Temporarily Unavailable”

So, to solve this error we took the following steps.

1. First, we checked the error log /var/log/apache2/error.log.

2. By analyzing, we found that the HTTP connection was disabled.

3. Then, we checked Webmin configuration file /etc/webmin/miniserv.conf.

4. Webmin normally runs as https with a self-generated certificate. So, to use HTTP we disabled ssl value ie.,

ssl=0

5. And then we restarted the services to reflect the changes made in the configuration file.

/etc/init.d/apache2 restart
/etc/init.d/webmin restart

This allowed users to access URL without any failure.

 

2. Misconfiguration of Apache file

Similarly, another customer reported us that after setting Apache reverse proxy & when he tried to access “https://webmin.example.com“, it resulted in an “internal server error (500)”.

Our Support Engineers took the following steps to solve the issue.

1. First, we checked the error log /var/log/apache2/error.log to verify the problem.

2. Next, we opened Apache configuration file /etc/httpd/conf/httpd.conf.

3. We found the following entry under the Virtual host.

ServerName webmin.example.com
ServerAlias webmin.example.com
 <Proxy *>
Order deny,allow
 Allow from all
</Proxy>

4. In this case, ServerAlias & ServerName are same, so removed that part. Also, we omitted the proxy part because by default the user will have access granted.

5. So, we corrected them like this:

ServerName webmin.example.com
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/server.pem
SSLCertificateKeyFile /etc/apache2/ssl/server.key
SSLProxyEngine On
SSLProxyCheckPeerCN on
SSLProxyCheckPeerExpire on
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / https://127.0.0.1:10000/
ProxyPassReverse / https://127.0.0.1:10000/

6. Then, we logged in to Webmin & navigated to Webmin > Servers > Apache Webserver > Global configuration > Configure Apache Modules.

7. And enabled the Apache modules mod_ssl, mod_proxy, mod_proxy_http.

8. Finally, we restarted the services to reflect the changes made.

That fixed the problem. Now, the user could access the Webmin URL without any failure.

[Having trouble after setting Apache reverse proxy in Webmin? We’ll fix it for you.]

 

Conclusion

In short, to improve website performance & to load balance between client & server setting Apache reverse proxy is a good practice. Today, we saw how our Support Engineers configured Webmin Apache reverse proxy and fixed the common errors.

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. Ahmad Mushtaq

    If your reverse proxy setup takes you to the default website you may try disabling cloudflare.

    Reply
  2. Tony, Martin Berbel

    I’ve got no access to the content of the webmin folder after login. No images displayed pr sripts loaded.
    I’m on a bind FQDN with wy 2 NS sevrvers running webmin and ns1 running apache. I’m running a desktop interface on ns2 to get a webmin access to all my wireguard VPN hosts (servers included).
    the main page of apache list the avialable hosts as a link hostname.FQDN.xxx and redirect it with apache to the same address:webmin port.

    I think something is wrong with Webmin and the proxysettings. Let’sencrypt for my domain has run for all correctly.

    I could access all the webmin hosts localy before trying to setup the proxy to ssl the all domain for webmin hosts.

    Reply
    • Hiba Razak

      Hi,
      Please contact our support through live chat(click on the icon at right-bottom).

      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