Wednesday, February 15, 2006

Little webmin thing

Webmin: think of it as a web-based MMC for your Linux box. That oughta piss off a lot of people, huh? :) It's a great tool once you get it setup. Fortunately, on Fedora it's as simple as yumming it down and it'll be preconfigured for the way things are setup on that OS. Otherwise, I recommend following the docs for installation. It's as simple as putting it into the directory it will eventually run from (think /opt!), and running setup.

Now, as we know, I like to have as much of my network and systems available on the web. The problem is, Webmin uses its own internal webserver, and that server runs on port 10000 by default. Dang! That ain't gonna work from the office, and I hate typing in URLs that include port numbers. Fortunately, there's good instructions on setting it up behind or with Apache here. However, I learned the hard way that they ain't complete (once I finish this post, I'll send them an update). I use the third method provided on that page where I use Apache as a reverse proxy. This hasn't really worked very well for me in the past, but I finally figured out why and here's the solution:

Firstly, my Apache only runs in SSL mode, it doesn't accept connections on port 80. When Webmin is installed, it too sees that SSL is installed and apparently enables it in itself, so it expects you to make https requests. If you keep getting "this server is runnning in SSL mode, try https://..." after setting up your Webmin, you have this problem. To fix, firstly this should be the setup in httpd.conf:

RewriteRule ^/webmin(.*) https://127.0.0.1:10000$1 [P,L]
# ProxyPass /webmin/ https://localhost:10000
ProxyPassReverse /webmin/ https://127.0.0.1:10000/
SSLProxyEngine On

(Note, I use rewrite, rather than ProxyPass. I've left the commented ProxyPass version in place.)

You see, without that, the proxy only makes plain requests to Webmin, but it wants SSL. You also need the SSLProxyEngine On statement to enable the right requests to be presented to Webmin (also missing from the docs).

That's it. A simple solution to a problem that's been bugging me for some time.

1 comment:

  1. Thank you... been trying to proxy in apache with SSL without success until now.

    ReplyDelete