55.2. Required Files

Every module has its own directory under the Webmin base directory, in which all the module's CGI programs and configuration files must be stored. For example, if the Webmin base was /usr/local/webmin-1.090, a module called foobar would be installed in /usr/local/webmin-1.090/foobar.

For a module to be displayed on the main Webmin menu, it should contain at least the following files (only module.info is mandatory):

images/icon.gif The icon displayed on the main menu for this module. The icon should be 48x48 pixels, and should use the same color scheme as the other icons on the main menu.

module.info This file contains information about the module and the operating systems under which it runs. Each line of the file is in the name=value format. Required names and their values are:

name A short name for this module, such as FooAdmin.

desc A longer description for the module, such as Foo Web Server. This is the text that will appear below the icon on the main menu.

os_support A space-separated list of operating systems that this module supports. The module will only be displayed on the main menu if the OS on which Webmin is running is in the list or if there is no os_support line at all. Unless your module configures a particular service that only exists on a few operating systems (such as XFree86), this line should be omitted instead of trying to list all of those supported by Webmin.

The actual operating system codes used in this line can be see in the third column of the os_list.txt file in the Webmin root directory, and are the same as those that can be appended to the names of config- files, as explained in Section 55.4 “Module Configuration”. To specify only a certain version of a particular OS, add it to the OS name after a slash. For example, a module.info file might contain

os_support=redhat-linux open-linux suse-linux/8.1

If your module supports all Linux distributions, you can use the OS code *-linux in this line.

depends A space-separated list of other modules upon which this module depends. If module foo depends upon module bar, then Webmin will prevent module bar from being deleted while foo is still installed. Webmin will also prevent foo from being installed if bar has not yet been.

The list can also contain a Webmin version (such as 0.75) upon which the module depends. In that case, installation of this module by an older version of Webmin will not be allowed.

category This value determines under which tab on the main Webmin page your module will be categorized. Supported values are webmin, system, servers, net, and hardware. If your module.info file has no category line, it will appear under the Others category.

lang/en The text strings used by this module, as explained in Section 56.3 “Internationalization”.

Each icon on the main menu is a link to the module directory. You must, therefore, have an index.cgi or index.html file to be displayed when the user clicks on the icon. A typical module contains many .cgi programs that are linked to index.cgi, each of which performs some function such as displaying a form or saving inputs from a form.

When you first create a new module, it will not be in the ACL of any Webmin user and you will not be able to see it in the main menu. You must first delete the /etc/webmin/module.infos.cache file to clear the cache of known modules. Then, to make your module visible, either edit the /etc/webmin/webmin.acl file, or use the Webmin Users module to grant yourself access.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.190.219.49