Getting Started

The first step in creating a brand spanking new Webmin module is to create a directory within the Webmin executable directory for your module to reside within. The next step is to fill in this directory with a skeleton of the files that Webmin requires to consider the contents of this directory a module rather than a bunch of random cruft in a directory. The files required by Webmin by all modules are a module.info file that contains the basic information about the module that Webmin needs to know to present it on the index page. Thus, the module name, description, category, and any dependency or version requirements. Also required is an index icon, named icon.gif within the images subdirectory. Finally, at minimum you'll need an index.cgi or index.html which is the first page the user will see when opening your new module.

If your module has any path requirements, or any information that the user should be able to provide to the module, a config.info file defining these options will also be needed. This file is needed anytime the module needs to know where to find files, or the methods of starting and stopping the configured service are variable across OS variants. In other words, if your module does anything more than echo the time or something similarly simplistic, you'll probably need a config.info file.

If your module relies on OS specific behavior or file locations, you should also create config files for each supported OS to specify that information. If a configuration file is available for the current OS when installing a module, it will be copied into the Webmin etc directory under a new subdirectory for your module. This allows a single self-contained .wbm module to contain everything needed for all support OS versions. The configuration files have a special naming convention to allow Webmin to choose the correct one for the OS in use.

module.info

This file contains all of the information that Webmin needs to categorize and label your new module. The specific information that can be included, is:

module.info directives

name

A short name for this module.

desc

This is a longer name, which will be displayed in the index page below the icon.

op_support

A space-separated list of operating systems that this module supports. The module will only be displayed in the index if the currently configured operating system is among these values.

depends

A space-separated list of modules on which this module depends. It is possible for a module to interact, via remote_foreign_call functions or via configuration file sharing, with other Webmin modules. If the modules specified here are not installed, Webmin will not allow this module to be installed. This directive can also be used to specify a minimum Webmin version that is required for this module to be installed. If your module relies on a feature that was not present in some past Webmin versions, the lowest supported version can be entered here.

category

Webmin divides modules into a number of categories, and it is possible for you to create your own categories as well (with some caveats discussed later). This option allows you to choose which category your module will appear in on the index page. The current categories accepted for this value as of version 0.950 are: servers, hardware, system, webmin, net, syslet, cluster, and info. If the category is undefined it will be place into the Others category.

version

Webmin supports versioning of modules, to make it easier to keep up with patched modules. It also makes it easier to know when changes have been made to a module that might be causing a problem that appears in a recent version that was not present in older revisions.

Some of the above are optional. Specifically, the only required directives are name and description. If your module works for any OS and has no dependencies, you can provide a very simple module.info file with just those directives.

icon.gif

The icon.gif is the image that will be displayed in the index page for your module. The only limitation on this file is that it be a GIF with a 48x48 resolution. Any other icons or images you would like to use in your module may also be included in the images directory.