Keep watch over your server system with Webmin

Steady Hand

© Lead Image © Martin Malchev, 123RF.com

© Lead Image © Martin Malchev, 123RF.com

Article from Issue 190/2016
Author(s):

Every leading Linux distribution offers some kind of built-in GUI management tool, but the world still has room for a flexible, distribution-independent tool like Webmin.

Webmin [1] is a web-based interface for system administration of Unix-like systems. The first part of this tutorial explains what Webmin is and when and why you might want to use it. The second part describes how to set up Webmin and use it for some basic administration tasks. Finally, I'll show you some advanced Webmin features.

If you want to configure your Linux computers in the best possible way or be able to rescue them when something goes wrong, there are no shortcuts: You need to know the basics of the command line and understand how to edit shell scripts and configuration files manually. However, just because you use the command line doesn't mean you like it, and this is where interfaces like Webmin can help.

Of course, if Webmin were nothing more than a mouse-first version of some system administrations utilities, it would be much less useful now than when it first appeared. These days, every desktop-oriented Linux distribution provides a suite of graphical management tools. However, Webmin still provides some benefits for today's networks.

First, Webmin is "network transparent." It doesn't matter whether you're actually sitting in front of the computer you need to manage or half a planet away, if you configure your firewall properly, you will be able to manage your computers in the same way. Plus, you can operate Webmin through any browser, even if you cannot connect via SSH. Even in cases where Webmin is little more than a web-based text editor for configuration files, it is still worth using.

Second, running a personal server is becoming a more common task. If you care about your blogging, photographs, and email, you really should locate these services on a server that is actually yours. Many Linux distributions that are optimized for such scenarios don't run any desktop environment – nor should they. With Webmin, you can manage many parts of your servers through the same interface you use on your own desktop.

Third, Webmin lets you delegate. If the basic management tasks are possible from any browser with a few clicks, you can ask colleagues, friends, or relatives, who might not even know Linux, to look after your computer when you're sick or traveling.

Fourth, Webmin hides differences among distributions. Things have improved since the 1990s, but in many cases you still cannot reuse exactly the same script or command across distributions. Webmin does its best to hide all that. The Webmin form to create a user, for example, will always be basically the same for all the versions of Linux that Webmin supports, plus Solaris, FreeBSD, and HP/UX.

Finally, for all the reasons above, Webmin can also be a great (self-)training environment. You can configure programs and tasks with Webmin and then study how it modified the configuration files of your system, or you can set up Webmin in a computer class to let your students do the same thing.

Gotchas and Limitations

If you carefully read the previous paragraphs, you have probably noticed some limitations in what Webmin can do. The limitations arise from the fact that Webmin, no matter how convenient it is, is ultimately just a configuration and management assistant.

To use Webmin, you must first install Linux and possibly other programs (not to mention Webmin itself) the traditional way, but you cannot install Webmin on systems where you do not have root access.

Overview and Initial Configuration

Technically speaking, Webmin is a set of Perl scripts that can be extended with many modules, and the configuration includes a small web server. At a low level, all Webmin does is translate (or reapply) your commands as changes in the standard, textual configuration files used to configure a Linux system.

The good thing is that, although Webmin directly updates the usual configuration files, it doesn't overwrite all their contents. Inside those files, Webmin only changes the parts that you tell it to change and leaves the rest alone. In other words, almost all the careful changes and customizations you did manually before you started using Webmin should be unchanged. In general, you should be able to mix Webmin and good old command-line typing as you wish.

Installing and Configuring Webmin

Webmin is not generally included in the package repositories of most Linux distributions. To install it, you must download the files from the website in the format most compatible with your distribution, then follow the instructions. If you use a Linux distribution based on the .rpm or .deb packaging formats, just download the corresponding binary package and install it with your usual software manager. You might have to force your package manager to ignore dependencies or install the dependencies manually yourself, but usually this does not create any problem. On some distributions, you have to start Webmin manually after the installation by issuing a command like the following as root:

service webmin start

At that point, you will be able to log in to Webmin by pointing your browser to the address https://localhost:10000. If you are accessing Webmin from another computer, replace localhost with the hostname or IP address of the system you want to access. If you want to manage your computer remotely, you will also have to tell the firewall to forward incoming traffic to TCP port number 10000.

Because Webmin generates its own SSL certificate when you install it – to use encrypted (HTTPS) connections – you'll also get the standard warning from your browser that the certificate cannot be trusted; in this case, you may ignore the warning.

Figure 1 shows what Webmin looks like when you start using it. You can change the look and feel by choosing another of the (few) themes included, but be warned: None of the themes will win a web design award anytime soon (Figure 2). However, they all do the job, and for the most part, Webmin themes also work in text browsers that support frames.

Figure 1: The Webmin Configuration page gives an idea of how complex and flexible this tool can be, but you can do lots of useful stuff with it.
Figure 2: Part of the initial Webmin page, with the default theme. The main panel shows system performance and status, whereas the left sidebar groups all the available functions in several areas.

Webmin is well documented, and you should spend some time browsing the resources listed in the System | System Documentation section. The search box at the bottom of the sidebar will help you to find the functions you need and assist you with installing the corresponding packages if they aren't already in your computer. Most Webmin windows include links to relevant instructions or chapters of the online documentation [2] to facilitate their usage.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus