Keep watch over your server system with Webmin
Log Files, System Monitoring, and Automatic Jobs
Even with logfiles, Webmin clearly distinguishes between its own stuff and the operating system in which it runs. The Webmin | Webmin Actions Log window is a search interface for Webmin's internal log. Use it whenever you need to figure out exactly what you did in all of Webmin or just in some of its modules.
Rotation of system logfiles – and definition of post-rotation commands for each of them – has its own panel in the System section. Monitoring system performance is split between Networking | Bandwidth Monitoring and Others | System and Server Status. In the latter window, you can activate tens of system monitors, and you can set how often they should run and to which email address they should send updates and warnings.
Speaking of automated actions, the most useful part of Webmin might be its interface to set up and control cron jobs – that is, automatic execution of specific commands or scripts at regular intervals. From the visual point of view, the form in System | Scheduled Cron Jobs might be outdated, but it makes it very, very easy to create cron jobs that run only when you want. You can even specify a non-recurring range of dates in which each job should be executed and define which users can have their own cron jobs.
Firewall and Servers
The most critical part of the Networking section is probably the configuration of your firewall. By default, Webmin includes two modules for firewall configuration, called FirewallD and Linux Firewall. Which one is more appropriate depends on which distribution you are running. Luckily, Webmin is smart enough to advise you, in most cases, which you should use.
Out of the box, Webmin knows how to configure the servers corresponding to the essential services of any Linux system: remote access via SSH; websites with Apache; databases with MySQL; and email with Postfix, Procmail, and SpamAssassin. Many more servers, from DNS to DHCP, have separate modules that you can activate with a few clicks.
On one hand, this part of Webmin is the least useful: This is not Webmin's fault, it's just the nature of the beast. Regardless of which flavor of Linux you use, any configuration interface for services like running websites or email can only do so much for its users. Webmin has many practical forms that help a lot – and save lots of time – to set each variable of those servers; however, it's still up to you to know what those variables mean.
Beyond the GUI: Advanced Webmin Usage
No software interface is really useful if you cannot customize at least part of it to your specific needs or occasionally do something that is not specifically listed in its menus. Webmin provides several functions that make these things possible even without hacking its source code.
To execute a command that you would otherwise have to enter at a shell prompt, click on Others | Command Shell and type the command. To do serious terminal work, choose Others | Text Login (Figure 4). This option opens a terminal inside your browser in which you can run all the commands and scripts you want inside a secure SSH session. If there's a command that you want to assign to a clickable button for frequent use, add it in the Others | Custom Commands page shown in Figures 5 and 6.
These features alone make Webmin flexible enough for most users, but there is more: If you want to save even more time, you can write Perl scripts that will use Webmin on your behalf, using the XML Remote Procedure Call protocol. To understand how this trick works, look at Listing 1, which shows the essential parts of one of the sample scripts provided by the Webmin developers [5]. This script connects to your Webmin with the credentials in the single line of a file called url.txt
(line 1), which has the following format:
Listing 1
Using Webmin from a Perl Script
https://USERNAME:PASSWORD@yourserver.com:10000/xmlrpc.cgi
Lines 2 to 6 create an object that connects to the specified Webmin instance. Using the cron::list_cron_jobs
method, lines 7 to 10 check whether a cron job that executes the command echo foo
as user root
already exists. If yes, it is deleted (remember, this is just an example). Otherwise (lines 17 to 25), the server object is told to connect to Webmin again to create the cron job with the specified parameters. Of course, in real life, the user
and command
terms specified in the script would be parameters passed to the script.
« Previous 1 2 3 4 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.