3

I want to install a module in webmin by command line (bash). How do you do this?

Example:

wget https://download.webmin.com/download/modules/text-editor.wbm.gz

inside this .gz: text-editor.wbm

sudo tar -xf text-editor.wbm.gz

enter image description here

The module (in this case text-editor) when installed via GUI:

enter image description here

It sends the files to several places. Example:

To /usr/share/webmin/text-editor

enter image description here

To : /etc/webmin/text-editor

enter image description here

To: /var/webmin/modules/text-editor (empty):

enter image description here

Important:

Webmin installation methods used in my test:

Method 1:

sudo sh -c 'echo "deb http://download.webmin.com/download/repository sarge contrib" >> /etc/apt/sources.list'
wget -q http://www.webmin.com/jcameron-key.asc -O- | sudo apt-key add -
sudo apt -y install webmin

Method 2:

wget https://prdownloads.sourceforge.net/webadmin/webmin_1.910_all.deb
sudo dpkg --install webmin_1.910_all.deb

I asked the author (Jamie Cameron) no response to the date, because he is the author of webmin and the author of the module that I try to install

Text Editor 1.4
Description Provides a simple interface for editing text files, with a history of recently-edited files.
Download    text-editor.wbm.gz
Author  Jamie Cameron
Last updated    2007-04-18 11:27:19

Update:

I have managed to make a script that installs the text-editor module. It is not very "elegant", but it works:

sudo chmod +x text-editor.sh && sudo ./text-editor.sh

#!/bin/bash

fshare=/usr/share/webmin/text-editor
fetc=/etc/webmin/text-editor
fvar=/var/webmin/modules/text-editor

if [ ! -d $fshare ]; then mkdir -p $fshare; fi
if [ ! -d $fetc ]; then mkdir -p $fetc; fi
if [ ! -d $fvar ]; then mkdir -p $fvar; fi
touch $fetc/files
wget -c https://download.webmin.com/download/modules/text-editor.wbm.gz
tar -xf text-editor.wbm.gz
cp -f -R text-editor/* $fshare
cp text-editor/config $fetc
sed -i '$ s/$/ text-editor/' /etc/webmin/webmin.acl
sh -c 'echo "text-editor=1" >> /etc/webmin/installed.cache'
/etc/init.d/webmin restart

However, there should be a better method to install any webmin module by command line

Update:

Jamie Cameron replied.

enter image description here

So, In my case it would be:

sudo /usr/share/webmin/install-module.pl text-editor.wbm

I hope this answer serves all interested parties

The theme is closed. You can vote for the closing of the question

  • This is exactly what I was looking for. Thanks! – Recognizer Jun 15 at 17:45
0

Introduction --------- Webmin is designed to allow the easy addition of new modules without changing any of the existing code. A module can be thought of as something like a Photoshop plugin or iPhone application - it can be written by someone other than the developers of Webmin and distributed under a license the developer chooses.

A module should be written to administer one service or server, such as the Unix password file or the Apache web server. Some complex system functions may even be split over several modules - for example, disk partitioning, mounting disks, and disk quota management are 3 separate modules in the standard Webmin distribution.

Modules can theoretically be written in any language. However, to make use of the Webmin API Perl version 5.8 or above should be used. A module should be written entirely in Perl, with no C functions or external binary programs. The aim is for modules to be as portable as possible across different Unix systems and CPU types.

Modules written in other languages will not be displayed using the standard Webmin UI and will not be able to call its API. For these reasons, using Perl is strongly recommended.

At their simplest, modules are really just directories of CGI programs that Webmin's web server runs. However, there are certain rules that should be followed to make sure that they work with the Webmin API, main menu, and access control system. Even though you can just stick any existing CGI script into a module directory, this is not a good idea.

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/libexec/webmin, a module called foobar would be created or installed in /usr/libexec/webmin/foobar.

You can find this base directory by looking at the root line in your /etc/webmin/miniserv.conf file. It will differ depending on which operating system Webmin is installed.

For a module to be displayed on the main Webmin menu, it should contain at least the following files. Only module.info is mandatory though.

module.info This file contains information about the module and the operating systems it runs under. See below for details on its format. images/icon.gif The icon displayed on the main menu for this module. The icon should be 48x48 pixels and should use the same colour scheme as the other icons on the main menu. lang/en The text strings used by this module, as explained in the Internationalization section of this documentation. install_check.pl Program that checks to see if the service or program is installed and usable, returning a non-zero value if so.

Each module name on Webmin's left menu is a link to the module directory. Thus you must have an index.cgi file to be displayed when the user clicks on the link. A typical module contains many .cgi programs that are linked to from 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 allowed list of any Webmin user and so you will not be able to see it in the main menu. To fix this, you must first delete the file /etc/webmin/module.infos.cache to clear the cache of known modules. Then to make your module visible, either edit the file /etc/webmin/webmin.acl or use the Webmin Users module to grant yourself access.

https://doxfer.webmin.com/Webmin/Module_Development


I found a guide to the webmin module installation and removal like you are trying:

https://www.smarthomebeginner.com/install-webmin-modules/

https://www.linode.com/docs/websites/cms/how-to-install-a-webmin-control-panel-and-modules/

and here:

Here is a module download page:

http://www.webmin.com/standard.html

here are all third party modules:

http://www.webmin.com/cgi-bin/search_third.cgi?modules=1


Use a prebuilt rpm or deb package:

The current Webmin distribution is available in various package formats for download from:

https://prdownloads.sourceforge.net/webadmin/webmin_1.910_all.deb 14.8 MB

http://webmin.com/download.html

If you want to use the apt command for deb files, use it like this:

sudo apt install path_to_deb_file

If you want to use dpkg command for installing deb packages, here’s how to do it:

sudo dpkg -i path_to_deb_file

In both commands, you should replace the path_to_deb_file with the path and name of the deb file you have downloaded.

From the github page:

Requirements

Perl 5.10 or higher. Installation

Webmin can be installed in two different ways:

By downloading a pre-built package, available for different distributions (CentOS, Fedora, SuSE, Mandriva, Debian, Ubuntu, Solaris and other) from our download page;

Note: It is highly recommended to add repository to your system for having automatic updates.

By downloading, extracting source file, and running setup.sh script, with no arguments, which will setup to run it directly from this directory, or with a command-line argument, such as targeted directory.

Note: If you are installing Webmin on Windows system, you must run the command perl setup.pl instead. The Windows version depends on several programs, and modules that may not be part of the standard distribution. You will need process.exe commmand, sc.exe command, and Win32::Daemon Perl module.

  • Please read my question carefully. Thank you – ajcg Jun 5 at 15:32
  • @ajcg Yes I saw this later, sorry, does the first link help?? – somethingSomething Jun 5 at 15:37
  • Now test your method (.deb) and the same result. I can not install the module via command line (which is what I ask). The "howto" you put in your answer are for GUI. Anyway, I appreciate your explanation – ajcg Jun 5 at 15:40
  • @ajcg thank you again sorry for rushing into it – somethingSomething Jun 5 at 15:43
  • 1
    Even though your answer does not answer the question, the explanation is very good and illustrative and complements the question. Thank you for your contribution – ajcg Jun 5 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.