### Setup Webmin Repository Source: https://github.com/webmin/webmin.com/blob/main/content/download.md Automates the setup of Webmin repositories for RHEL and Debian-based systems, enabling easy installation and upgrades via package managers. ```bash curl -o webmin-setup-repo.sh https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repo.sh sh webmin-setup-repo.sh ``` -------------------------------- ### Install Webmin from Source (Linux/FreeBSD) Source: https://github.com/webmin/webmin.com/blob/main/content/download.md Details the process of installing Webmin from a source tarball on Linux or FreeBSD, including uncompressing, navigating, and running the setup script. ```bash # Change directory cd /tmp # Uncompress gunzip webmin-current.tar.gz tar xf webmin-current.tar.gz cd webmin-current # Install ./setup.sh /usr/local/webmin ``` -------------------------------- ### Install Usermin from Source Source: https://github.com/webmin/webmin.com/blob/main/content/usermin.md Installs Usermin from source code on FreeBSD and other Linux distributions. This involves downloading, uncompressing, and running the setup script. ```bash # Change directory cd /tmp # Uncompress gunzip usermin-current.tar.gz tar xf usermin-current.tar.gz cd usermin-current # Install ./setup.sh /usr/local/usermin ``` -------------------------------- ### Install Foobar Webserver Module Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md Steps to install a demo Webmin module for the Foobar Webserver from a URL. This involves navigating the Webmin interface and providing the module's download URL. ```text Login to Webmin as _root_ and go to **Webmin** ⇾ **Webmin Configuration** ⇾ **Webmin Modules** Select the **From HTTP or FTP URL** option and enter the URL `http://download.webmin.com/download/modules/foobar.wbm.gz` into the adjacent text box Click the **Install Module** button ``` -------------------------------- ### Webmin module.info File Example Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md An example of a `module.info` file, which contains meta-information about a Webmin module. It includes the module's description, supported operating systems, and category. ```text desc=Foo Web Server os_support=*-linux category=servers ``` -------------------------------- ### Virtualmin Automated Installation Script Source: https://github.com/webmin/webmin.com/blob/main/content/virtualmin.md This script automates the setup and installation of Virtualmin by configuring the package manager and downloading necessary packages and dependencies. ```bash curl -o virtualmin-install.sh https://software.virtualmin.com/gpl/scripts/virtualmin-install.sh sh virtualmin-install.sh ``` -------------------------------- ### Setup Usermin Repository Source: https://github.com/webmin/webmin.com/blob/main/content/usermin.md This script automates the setup of Usermin repositories for RHEL and Debian-based systems, enabling easy installation and upgrades of the 'usermin' package. It configures the system to fetch the latest Usermin versions and GPG keys. ```bash curl -o usermin-setup-repos.sh https://raw.githubusercontent.com/webmin/webmin/master/setup-repos.sh sh usermin-setup-repos.sh ``` -------------------------------- ### Webmin Installation Script Source: https://github.com/webmin/webmin.com/blob/main/content/faq.md Instructions on how to execute the Webmin setup script after extracting the archive. It emphasizes the need to navigate to the directory and use the correct execution path. ```bash cd webmin-current ./setup.sh ``` -------------------------------- ### Cloudmin Installation - Xen Setup Source: https://github.com/webmin/webmin.com/blob/main/content/cloudmin.md This describes the Xen installation process for Cloudmin. The Xen install script is responsible for downloading and setting up a Xen-capable kernel on the system. It then registers this system as a Xen host within Cloudmin. If the system is not already running a Xen kernel, a reboot is necessary before Xen instances can be created. ```English The Xen install script should download and setup a Xen-capable kernel on the system you run it on, and then register that system as a Xen host within Cloudmin. If you aren't already running a Xen kernel you will need to reboot the system before Xen instances can be created. ``` -------------------------------- ### Webmin Overlay Theme Installation Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-overlay-themes.md Instructions for installing an example overlay theme in Webmin to demonstrate theme customization. This involves downloading a theme archive and selecting it within the Webmin Themes configuration. ```APIDOC 1. Login to Webmin. 2. Navigate to **Webmin** ⇾ **Webmin Configuration** ⇾ **Webmin Themes**. 3. Click on **Install theme**. 4. Enter the URL: `http://download.webmin.com/download/modules/overlay-theme.wbt.gz` 5. After installation, go to the **Change overlay** tab on the **Webmin Themes** page. 6. Select the **CSS Overlay Demo Theme**. 7. Click the **Change** button. ``` -------------------------------- ### Usermin Manual Installation Source: https://github.com/webmin/webmin.com/blob/main/content/changelog/webmin-2.300-and-usermin-2.200-released.md Fixes the manual installation process for Usermin using the setup script. ```text * Fix Usermin manual installation using setup script ``` -------------------------------- ### Install Webmin (RHEL Derivatives) Source: https://github.com/webmin/webmin.com/blob/main/content/download.md Installs the Webmin package on Red Hat Enterprise Linux and its derivatives using the DNF package manager after repository setup. ```bash dnf install webmin ``` -------------------------------- ### Webmin Module Configuration File Example Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md An example of a Webmin module's configuration file, specifying parameters like configuration file paths and sorting modes. This file is typically copied to the Webmin configuration directory. ```text foobar_conf=/etc/foobar.conf sort_mode=0 ``` -------------------------------- ### Example useradmin_update.pl Script Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md An example Perl script demonstrating how to implement the user creation callback to read and write user information to a file. ```perl do 'foobar-lib.pl'; sub useradmin_create_user { my ($user) = @_; my $lref = &read_file_lines($users_file); push(@$lref, "$user->{'user'}:$user->{'pass'}"); &flush_file_lines($users_file); } ``` -------------------------------- ### Webmin BIND DNS Initial Configuration Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/bind-dns-server.md Guides users through the initial setup of BIND DNS configuration files using Webmin, including downloading root name server lists. ```APIDOC Webmin BIND DNS Server Module: Initialize Configuration: - Allow Webmin to initialize configuration. - Download root name server list. - Option to use included root name server list if not connected to the network. ``` -------------------------------- ### Install Webmin on Solaris Source: https://github.com/webmin/webmin.com/blob/main/content/download.md Provides steps for installing Webmin on Solaris systems, including uncompressing the package and using `pkgadd`. ```bash # The root user be switched from a role account to a normal account to logins to work rolemod -K type=normal root # Uncompress gunzip webmin-current.pkg.gz # Install pkgadd -d webmin-current.pkg ``` -------------------------------- ### Install Usermin Source: https://github.com/webmin/webmin.com/blob/main/content/usermin.md Instructions for installing Usermin on different Linux distributions after setting up the repository. For RHEL derivatives, 'dnf install usermin' is used, while for Debian derivatives, 'apt-get install usermin --install-recommends' is the command. ```bash dnf install usermin ``` ```bash apt-get install usermin --install-recommends ``` -------------------------------- ### Install Webmin from RPM Package Source: https://github.com/webmin/webmin.com/blob/main/content/download.md Installs Webmin on RHEL-based systems by directly installing a downloaded RPM package. ```bash dnf install ./webmin-current.rpm ``` -------------------------------- ### PostgreSQL Server Management with Webmin Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/postgresql-database-server.md This section details the Webmin module for managing PostgreSQL databases. It covers initial setup, connection issues, and error handling, providing guidance on starting the server, logging in, and resolving configuration problems. ```English If the message PostgreSQL is not running on your system appears, you will need to start the database server before this module can be used to manage it. Just click the **Start PostgreSQL Server** button at the bottom of the page. If you want it to be started at boot time from now on, use the Bootup and Shutdown module (covered on [Bootup and Shutdown](/docs/modules/bootup-and-shutdown)) to create a new action to start it. If PostgreSQL is running by Webmin does not know the administration username and password needed to connect to it, and **PostgreSQL Login** form will be displayed on the main page. You must enter valid login details for your database server, typically for the postgres user who has full access to all databases and features. Logging in as some other less privileges user may work at first, but you will not be able to use all of the features of the module. Sometimes PostgreSQL is set up to authenticate users by their Unix username, rather than by a separate login and password (the ident authentication mode). If this is the case on your system, you will need to check the **Connect as same Unix user?** box on the form. If an error message like The PostgreSQL host configuration file **hba.conf** was not found appears, then either the module's configuration is incorrect or your server has not yet been initialised for the first time. Many packaged versions for Linux systems need to be initialised before they can be used, usually by running the initdb command. If the module knows how to do this on your system, an **Initialize Database** button will be displayed that you can click on to set up the server for the first time. The error message The PostgreSQL client program `psql was not found on your system` indicates that PostgreSQL is not installed at all, or that it is in a different directory to the one Webmin expects. On Linux and FreeBSD systems, the module assumes that you have installed the packages for the database included with your distribution, while on other operating systems it assumes that a standard installation from the source code into `/usr/local/pgsql` was done. If you have installed it and that error message still appears, you will need to read the *Configuring the PostgreSQL Database Server module* section for details on how to adjust the paths that the module uses. ``` -------------------------------- ### Install Webmin from DEB Package Source: https://github.com/webmin/webmin.com/blob/main/content/download.md Installs Webmin on Debian-based systems by directly installing a downloaded DEB package, including recommended dependencies. ```bash apt-get install --install-recommends ./webmin-current.deb ``` -------------------------------- ### Webmin Module Library Example (perl) Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md An example of a Webmin module library file (`-lib.pl`). This file contains common functions that CGI programs within the module will call, including initialization of the Webmin environment and custom functions for managing module-specific configurations. ```perl =head1 foobar-lib.pl Functions for managing the Foobar webserver configuration file. foreign_require("foobar"); my @sites = foobar::list_foobar_websites() =cut BEGIN { push(@INC, ".."); }; use WebminCore; init_config(); =head2 get_foobar_config() Returns the Foobar Webserver configuration as a list of hash references with name and value keys. =cut sub get_foobar_config { my $lref = &read_file_lines($config{'foobar_conf'}); my @rv; my $lnum = 0; foreach my $line (@$lref) { my ($n, $v) = split(/\s+/, $line, 2); if ($n) { push(@rv, { 'name' => $n, 'value' => $v, 'line' => $lnum }); } $lnum++; } return @rv; } ``` -------------------------------- ### Webmin CGI Script Example Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md A Perl CGI script demonstrating the use of Webmin UI functions for generating headers, displaying text with placeholders, and creating footers. It includes requirements for Webmin libraries and configuration. ```perl #!/usr/bin/perl require 'foobar-lib.pl'; ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1); $conf = get_foobar_config(); $dir = find($conf, "root"); print &text('index_root', $dir),"

\n"; ui_print_footer("/", $text{'index'}); ``` -------------------------------- ### Webmin Module Packaging (Bash) Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md Provides a command-line example using `tar` to package a Webmin module directory into a compressed archive. This is a standard method for distributing Webmin modules, with specific file extensions indicating the content type (module, theme, Usermin module). ```Bash cd /usr/libexec/webmin tar cvzf /tmp/foomod.wbm.gz foobar ``` -------------------------------- ### Configure PPP Options for Server Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/ppp-dialin-server.md Details on setting global PPP options in Webmin. This includes enabling automatic PPP detection, defining local and remote IP addresses, and configuring control line modes. ```APIDOC PPP Options: Automatically detect PPP connections on serial ports?: 'Yes' to enable automatic pppd execution. PPP IP Address: Local IP: Server's IP address for the connection. Remote IP: Client's IP address for the connection. Create proxy ARP entry?: Enable to assign client an IP within the local LAN range. Control lines mode: 'Local' for null-modem, 'Modem' for actual modems. ``` -------------------------------- ### Webmin Configuration File Translation Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md Provides an example of a translated `config.info` file for German, showing how to define configuration options with translated labels and values. ```Perl users_file=Die Benutzer-Datei,8 ``` ```Perl groups_file=Gruppen-Datei,8 ``` ```Perl show_groups=Details anzeigen Gruppe?,1,1-Ja,0-Nein ``` -------------------------------- ### Webmin Two-Factor Authentication Setup Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/webmin-configuration.md Guides users through enabling and configuring two-factor authentication in Webmin. This involves selecting a provider, entering necessary details, and enrolling users for the additional security layer. ```APIDOC Enable Two-Factor Authentication: 1. Navigate to the 'Webmin Configuration' module. 2. Select 'Two-Factor Authentication'. 3. Choose an authentication provider (e.g., Authy, Google Authenticator). 4. Enter provider-specific details (e.g., API key for Authy). 5. Click 'Save'. Enroll User for Two-Factor Authentication: 1. Navigate to the 'Webmin Users' module. 2. Click the 'Two-Factor Authentication' button for the desired user. 3. Provide provider-specific information: - Authy: Email address and cellphone number linked to an Authy account. - Google Authenticator: Existing TOTP secret or allow Webmin to generate one. 4. Click 'Enroll For Two-Factor Authentication'. 5. For Google Authenticator, a QR code will be displayed for app scanning. Verification: - Log in using an incognito tab or different browser. - The login page will prompt for a two-factor token (6-7 digit number from authenticator app/device) in addition to username and password. ``` -------------------------------- ### Install Webmin Source: https://github.com/webmin/webmin.com/blob/main/content/cloudmin.md Executes the downloaded Webmin installation script on a Linux system. ```shell sh cloudmin-install.sh ``` -------------------------------- ### Install Webmin (Debian Derivatives) Source: https://github.com/webmin/webmin.com/blob/main/content/download.md Installs the Webmin package on Debian and its derivatives using the APT package manager, including recommended dependencies. ```bash apt-get install webmin --install-recommends ``` -------------------------------- ### Configure mgetty and pppd for Dial-in Server Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/ppp-dialin-server.md This section describes the process of setting up a Linux system with an attached modem as a dial-in server using the point to point protocol (PPP). It involves configuring `mgetty` to answer calls and `pppd` to handle PPP sessions, authentication, and IP address assignment. ```APIDOC PPP Dialin Server Module: - Configures mgetty and pppd for dial-in service. - Supports Linux and Solaris systems. - Main page displays icons for: - Serial Port Configuration - Caller ID Access - PPP Options - PPP Accounts Dependencies: - mgetty: For modem communication and answering calls. - pppd: For establishing PPP sessions, authentication, and IP assignment. Configuration Notes: - mgetty entries are added to /etc/inittab for boot-time execution. - Solaris serial port device files differ from Linux (e.g., /dev/term/a vs /dev/ttyS0). Functionality: - mgetty: Answers phone, displays login prompt, runs pppd for PPP sessions. - pppd: Creates PPP network interface, authenticates client, assigns IP, handles PPP data transfer. Limitations: - Module currently only supports Linux and Solaris. - Requires mgetty and pppd to be installed. ``` -------------------------------- ### Install CSF Webmin Module Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Third Party Modules/configserver-security-and-firewall.md Instructions for installing the ConfigServer Security & Firewall Webmin module through the Webmin interface after the core CSF package is installed. ```APIDOC Navigate to Webmin ⇾ Webmin Configuration ⇾ Webmin Modules. Select the 'From local file' option. Choose '/usr/local/csf/csfwebmin.tgz' file. Click 'Install Module'. ``` -------------------------------- ### Webmin Module Installation via Command Line Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/webmin-configuration.md Installs a Webmin module from a .wbm or .wbt file using the `install-module.pl` script. The script is typically located in the Webmin installation directory. ```bash install-module.pl /path/to/your/module.wbm ``` -------------------------------- ### Perl Module Installation Actions Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/perl-modules.md Describes the different actions that can be performed during Perl module installation via Webmin, including building, testing, and installing the module. ```APIDOC Install action: - Make only: Extracts the file, generates Makefile (perl Makefile.PL), and runs make. Does not install. - Make and test: Like 'Make only', but also runs 'make test' to verify compilation. - Make and install: Extracts, builds, and runs 'make install' to copy compiled files to Perl directories. - Make, test and install: Like 'Make and install', but runs 'make test' before installation. This is the default. ``` -------------------------------- ### Webmin Module Post-Installation Script Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md Modules can define a `postinstall.pl` file containing a `module_install` Perl function. This function is executed after a module is successfully installed, allowing for setup tasks like copying configuration files. It can utilize Webmin's common functions library. ```perl require 'foobar-lib.pl'; sub module_install { if (!-r "$config_directory/somefile") { copy_source_dest("$module_root_directory/somefile", "$config_directory/somefile"); } } ``` -------------------------------- ### Perl Installation from Source Source: https://github.com/webmin/webmin.com/blob/main/content/faq.md Guidance on installing Perl by downloading and compiling the source code, typically for systems where Perl is not pre-installed. ```text Download and compile the latest Perl from source (e.g., http://www.cpan.org/src/stable.tar.gz). ``` -------------------------------- ### Get Webmin Installation Type Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/API/Module/webmin.md Returns the package type used to install Webmin (e.g., 'rpm', 'deb', 'solaris-pkg'). Returns `undef` if installed from a tarball. ```APIDOC get_install_type Returns the package type Webmin was installed form (_rpm_, _deb_, _solaris-pkg_ or `undef` for _tar.gz_). ``` -------------------------------- ### Get Module Installation Type Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/API/Module/webmin.md Determines the installation method for a given module directory (e.g., 'rpm'). Returns `undef` if the module was installed from a `.wbm` archive. ```APIDOC get_module_install_type(dir) Returns the installation method used for some module (such as _rpm_), or `undef` if it was installed from a _wbm_. ``` -------------------------------- ### Access Webmin Interface Source: https://github.com/webmin/webmin.com/blob/main/content/download.md Instructions on how to access the Webmin web interface through a browser, emphasizing the default port and firewall considerations. ```text https://:10000 ``` -------------------------------- ### Usermin Module Packaging and Installation Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md Describes the packaging requirements for Usermin modules, emphasizing the need for the `usermin=1` line in `module.info` for correct installation. ```Usermin module.info: usermin=1 ``` -------------------------------- ### SUSE Repo Setup Source: https://github.com/webmin/webmin.com/blob/main/content/changelog/webmin-2.300-and-usermin-2.200-released.md Adds support for setting up repositories on SUSE distributions using the repo setup script. ```text * Add support for setting up repos on SUSE distros using repo setup script ``` -------------------------------- ### Start Fetchmail Daemon Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/fetchmail-mail-retrieval.md Guide to starting the Fetchmail daemon for automated, regular email checking. Includes configuration for checking intervals and managing the daemon process. ```English Enter the checking interval (in seconds) in the provided text field. Click the **Start Fetchmail Daemon** button. The button label changes to **Stop Fetchmail Daemon** when active. To stop the daemon, click the **Stop Fetchmail Daemon** button. ``` -------------------------------- ### Webmin Module Installation Check Script Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md To determine if a managed server or service is installed, Webmin modules can implement an `install_check.pl` file with an `is_installed` Perl function. This function takes a mode parameter and should return 0 if the service is not installed, or `mode + 1` if it is. ```perl do 'foobar-lib.pl'; sub is_installed { my $mode = $_[0]; if (!-r $config{'foo_config_file'}) { return 0; } else { return $mode + 1; } } ``` -------------------------------- ### Creating Filesystem after Partitioning Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/partitions-on-local-disks.md Demonstrates the command to create an ext4 filesystem on a newly created partition using `mkfs.ext4`. ```Bash sudo mkfs.ext4 /dev/sda1 ``` -------------------------------- ### Install ConfigServer Security & Firewall (CSF) Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Third Party Modules/configserver-security-and-firewall.md Steps to download, extract, and install the ConfigServer Security & Firewall package using the command line. Requires root access. ```bash cd /usr/local/src curl -O https://download.configserver.com/csf.tgz tar -xzf csf.tgz cd csf ./install.sh ``` -------------------------------- ### ProFTPD Boot-time Startup Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/proftpd-server.md Instructions on how to configure ProFTPD to start automatically at boot time using the Bootup and Shutdown module. ```APIDOC Use the Bootup and Shutdown module to create an action named 'proftpd' that runs the command '/usr/sbin/proftpd' at boot time. Note: The actual path to the proftpd executable may vary (e.g., '/usr/local/sbin/proftpd', '/usr/sbin/in.proftpd'). ``` -------------------------------- ### Parted: Create New Partition Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/partitions-on-local-disks.md Creates a new partition on the selected disk. This example creates a primary partition of type 'ext4' starting at 1GiB and ending at 5GiB. The syntax allows specifying partition type, filesystem, start, and end points. ```bash mkpart primary ext4 1GiB 5GiB ``` -------------------------------- ### Webmin Module Installation Source: https://github.com/webmin/webmin.com/blob/main/content/faq.md Steps to install new modules in Webmin via the Webmin Configuration interface. ```text Navigate to Webmin Configuration -> Webmin Modules -> Install module from local file or Upload module file from your computer. ``` -------------------------------- ### Install Squid Proxy Server Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/squid-proxy-server.md Instructions for installing the Squid proxy server. This can be done via a package manager or by compiling from source. ```APIDOC Squid Installation: - Via Package Manager: Use 'Software Packages' module to install 'squid'. - From Source: Download, compile, and install from squid-cache.org if no package is available. - Dependencies: Requires a compiler; relatively simple process. ``` -------------------------------- ### Webmin Runlevel Management Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/API/Module/init.md Functions for managing system runlevels, including getting the list of start runlevels and determining the directory for a given runlevel. ```APIDOC get_start_runlevels() Returns a list of runlevels that actions should be started in. runlevel_dir( runlevel ) Given a runlevel (e.g., 3), returns the directory containing symlinks for it (e.g., /etc/rc2.d). ``` -------------------------------- ### Linux Disk Partitioning with fdisk Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/partitions-on-local-disks.md Provides command-line examples for using the `fdisk` utility in Linux to manage disk partitions, including listing, creating, deleting, and modifying them. ```Bash sudo fdisk -l sudo fdisk /dev/sda p d n t w ``` -------------------------------- ### Webmin ACL Enforcement Example Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md Demonstrates how to retrieve and enforce module access control settings within a Webmin Perl script using `get_module_acl`. ```Perl #!/usr/bin/perl require 'foobar-lib.pl'; %access = &get_module_acl(); $access{'create'} || error("You are not allowed to create new websites"); ``` -------------------------------- ### FreeBSD RC Script Creation Source: https://github.com/webmin/webmin.com/blob/main/content/changelog/webmin-2.300-and-usermin-2.200-released.md Ensures correct RC script creation on FreeBSD systems when Webmin is installed using the setup script. ```text * Fix to create correct RC script on FreeBSD systems when Webmin is installed using the setup script ``` -------------------------------- ### Get Module Root Directory Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/API/WebminCore.md Retrieves the root directory for a specified module. While typically modules reside in a single directory, this function accounts for potential multi-directory installations. ```Perl module_root_directory(module) Given a module name, returns its root directory. On a typical Webmin install, all modules are under the same directory - but it is theoretically possible to have more than one. ``` -------------------------------- ### Webmin Theme Packaging Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-themes.md Instructions on how to package Webmin themes into distributable formats like RPM and Debian packages using provided Perl scripts. ```APIDOC Packaging Webmin Themes: - **RPM Package**: Use the `makemodulerpm.pl` script to package a theme directory into an RPM. The script automatically creates the spec file. - Download script: https://raw.githubusercontent.com/webmin/webmin/master/makemodulerpm.pl - **Debian Package**: Use the `makemoduledeb.pl` script to create a Debian package of a theme. The resulting `.deb` file is placed in `/tmp`. - Download script: https://raw.githubusercontent.com/webmin/webmin/master/makemoduledeb.pl - **Package Naming**: The package name is `webmin-` followed by the theme directory name for both modules and themes. ``` -------------------------------- ### Webmin API: Calling Functions from Other Modules Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md Demonstrates how to use the Webmin API to call functions exported by other modules. This example shows how to require the 'useradmin' module and list users. ```perl foreign_require("useradmin"); @users = useradmin::list_users(); foreach my $u (@users) { print $u->{'user'},"\n"; } ``` -------------------------------- ### Running and Managing Backup Jobs Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/filesystem-backup.md Details on how to initiate backup jobs, monitor their progress, and manage them through the Webmin interface, including background execution and job termination. ```APIDOC Running Backups: - Start a defined job by clicking the **Backup** button in the jobs table. - To run in the background: Go to **Module Config**, change **Run backups in** to **Background**. - Monitor running jobs under **Running Backup Jobs** on the main page. - Actions for running jobs: Terminate or signal for new tape availability. Editing and Deleting Jobs: - Edit: Click the source directory in the backup jobs table to modify settings. - Delete: Select the job's checkbox and click **Delete Selected Backups**. ``` -------------------------------- ### Webmin RPC: Get List of Remote Servers Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/creating-modules.md Illustrates how to retrieve a list of available remote Webmin servers that can be used for RPC calls. This involves querying the Webmin Servers Index module. ```perl foreign_require("servers", "servers-lib.pl"); @allservers = servers::list_servers(); @rpcservers = map { $_->{'host'} } grep { $_->{'user'} } @allservers; ``` -------------------------------- ### PostgreSQL Installation and Module Configuration Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/postgresql-database-server.md Guidance on installing PostgreSQL and configuring the Webmin module. This includes installing necessary packages on Linux, downloading source code for other operating systems, and adjusting module paths if the client program is not found. ```English If you are running Linux and PostgreSQL is not installed, use the [[Software Packages]] module to install all packages starting with postgres from the distribution CD or website. Often there will be several, such as postgresql, postgresql-server and postgresql-devel. For other operating systems, visit [www.postgresql.org](https://www.postgresql.org/) to download the source code distribution, then compile and install it. ``` -------------------------------- ### LVM Physical Volume Creation Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/logical-volume-management.md Demonstrates how to initialize physical disks for use with LVM using the `pvcreate` command. Includes the command to list all initialized physical volumes using `pvdisplay`. ```bash # Initialize two disks for use by LVM pvcreate /dev/sda1 /dev/sdb1 ``` ```bash # To list all PVs: pvdisplay ``` -------------------------------- ### Webmin Form Start Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Development/API/WebminCore.md Generates HTML for the beginning of a form. It specifies the script to submit to, the HTTP method (GET, POST, or form-data), an optional target window, and additional HTML attributes for the form tag. ```Perl ui_form_start(script, method, [target], [tags]) ``` -------------------------------- ### Start and Test Squid Proxy Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/squid-proxy-server.md Starts the Squid proxy service and provides steps for testing its functionality. This includes checking log files for startup information and configuring a browser to use the Squid proxy. ```APIDOC Webmin Squid Module: 1. Start Squid: Click 'Start Squid' link. 2. Check Logs: Monitor `cache.log` for startup errors. 3. Test: Configure browser proxy settings (HTTP, HTTPS, FTP) to point to the Squid server's IP and port. 4. Verify: Browse websites and check `access.log` for cache hits/misses. Use 'Calamaris' icon for reports if installed. ``` -------------------------------- ### Parted: Resize Partition Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/partitions-on-local-disks.md Resizes an existing partition. This example resizes the second partition ('2') to end at 10GiB, keeping its original start point. The size can be specified in various units like GiB. ```bash resizepart 2 10GiB ``` -------------------------------- ### ProFTPD Per-Directory Options Setup Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/proftpd-server.md Guides users through creating and configuring per-directory options in ProFTPD. This involves specifying directory paths, setting access controls, defining ownership for uploaded files, and applying changes. ```APIDOC Configure Per-Directory Options: 1. Access the module's main page or a virtual server's options page. 2. Use the 'Directory path' field to specify the target directory (absolute or relative paths like '/usr/local', '~/public_html', '~jcameron/www'). Add '/*' to apply options only to contents, not the directory itself. 3. Click 'Create' to proceed to option categories. 4. Configure settings under categories like 'Access Control' (e.g., 'Deny all' clients) and 'User and Group' (e.g., 'Owner of uploaded files'). 5. Click 'Save' after making changes. 6. Return to the main page and click 'Apply Changes' to activate the configuration. Remove Directory Configuration: 1. Navigate to the directory's configuration. 2. Click 'Delete directory config' to remove all settings for that directory. ``` -------------------------------- ### Configure Client Services for NIS Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/nis-client-and-server.md Sets up which services (users, groups, hosts) will query NIS, prioritizing local files and then NIS. ```text Click on the **Client Services** icon. Each row of the client services form controls what your system will query when looking something up for a particular service. For each, you can select several sources that will be checked in order until one finds a match. The available sources are: - **Files**: Local configuration files, such as `/etc/passwd` or `/etc/hosts`. - **NIS**: This NIS server that your system is currently connected to. - **NIS+**: The NIS+ server that your system is connected to. Configuring NIS+ is not supported by Webmin though. - **NIS and Files**: This option only works for the **Unix users** and **Unix groups** services. If chosen, special lines in `/etc/passwd` and `/etc/group` starting with `+` or `–` can be used to indicate that some or all NIS users should be included. This is actually more flexible than just choosing the **NIS** source, as special `+` and `–` lines can be used to bring in only some users and groups, or change the attributes of those that are included. - **DNS**: This option only makes sense for the **Host addresses** source. It tells the system to query a DNS server when looking up hostnames, which is almost always what you want to do. Typically, you should set each of the services that you want to use NIS for (such as **Unix users** and **Unix groups**) to **Files** and **NIS**. Everything else should be left set to just **Files**, or in the case of **Host addresses** just **Files** and **DNS**. Click the **Save** button. ``` -------------------------------- ### Configure Serial Port for PPP Server Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/ppp-dialin-server.md Steps to configure a serial port for PPP server functionality in Webmin. This involves selecting the serial device, connection type (direct or modem), port speed, and answering behavior. ```APIDOC Serial Port Configuration: Serial device: Select the device file (e.g., /dev/ttyS0) or 'Other device' for custom paths. Type: 'Direct connection' for null-modem, 'Modem' for dial-in. Port speed: Baud rate for the connection (e.g., 57600, 33600). Answer after: Number of rings before answering (for modems). Create: Adds configuration to /etc/inittab. Apply Configuration: Activates mgetty on the new port. ``` -------------------------------- ### RPM Package Management Commands Source: https://github.com/webmin/webmin.com/blob/main/content/docs/Modules/software-packages.md Demonstrates the basic shell commands used for managing RPM packages, including installation, querying, and deletion. ```bash rpm -i # Install an RPM package rpm -e # Remove an RPM package rpm -q # Query an installed package rpm -qa # List all installed packages ```