Category: Tools

sSMTP – Simple MTA to get Mail off the System

sSMTP – Simple MTA to get Mail off the System

Description

A secure, effective, and simple way of getting mail off a system to your mail hub. It does not include a mail spool to poke around in and no daemons running in the background. Mail is forwarded to the configured email host. It is extremely easy to configure.

WARNING: the above is all it does; it does not receive mail, expand aliases, or manage a queue. That belongs on a mail hub with a system administrator.

WWW: http://packages.debian.org/stable/mail/ssmtp.

Installation

Install sSMTP with;

user@freebsdsrv:~ $ sudo pkg install -y ssmtp [enter]
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	ssmtp: 2.64_7

Number of packages to be installed: 1

21 KiB to be downloaded.
[1/1] Fetching ssmtp-2.64_7.pkg: 100%   21 KiB  21.6kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/1] Installing ssmtp-2.64_7...
===> Creating groups
Creating group 'ssmtp' with gid '916'
[1/1] Extracting ssmtp-2.64_7: 100%
=====
Message from ssmtp-2.64_7:

--
sSMTP has been installed successfully.

Firstly, edit /etc/mail/mailer.conf to replace sendmail with ssmtp:

sendmail	/usr/local/sbin/ssmtp
send-mail	/usr/local/sbin/ssmtp
mailq		/usr/local/sbin/ssmtp
newaliases	/usr/local/sbin/ssmtp
hoststat	/usr/bin/true
purgestat	/usr/bin/true

Hint: in case sSMPT is being installed directly from ports,
editing /etc/mail/mailer.conf can be done by running "make replace".

Secondly, edit the following files to configure sSMTP:

- /usr/local/etc/ssmtp/revaliases
- /usr/local/etc/ssmtp/ssmtp.conf

At this point sSMTP should be ready to go.
--
===>   NOTICE:

The ssmtp port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing
user@freebsdsrv:~ $

Configuration

Stop the Sendmail daemon if it is running:

user@freebsdsrv:~ $ sudo service sendmail stop [enter]
Stopping sendmail.
Waiting for PIDS: 739.
Stopping sendmail_msp_queue.
Waiting for PIDS: 742.
user@freebsdsrv:~ $

Disable sendmail on system boot with this commands:

user@freebsdsrv:~ $ sudo sysrc sendmail_enable="NONE" [enter]
sendmail_enable: YES -> NONE
user@freebsdsrv:~ $

Edit file /etc/mail/mailer.conf with:

user@freebsdsrv:~ $ sudo ee /etc/mail/mailer.conf [enter]

It should look like this:

#
# Use "ssmtp" for sending mail
#
sendmail	/usr/local/sbin/ssmtp
send-mail	/usr/local/sbin/ssmtp
mailq		/usr/local/sbin/ssmtp
newaliases	/usr/local/sbin/ssmtp
hoststat	/usr/bin/true
purgestat	/usr/bin/true

The command sendmail will invoke the ssmtp executable. But you have not told sSMTP which SMTP server to use with which credentials. These settings are looked for in the sSMTP configuration files /usr/local/etc/ssmtp/revaliases and /usr/local/etc/ssmtp/ssmtp.conf.

Copy the sample file /usr/local/etc/revaliases.sample to /usr/local/etc/revaliases with:

user@freebsdsrv:~ $ sudo cp /usr/local/etc/ssmtp/revaliases.sample /usr/local/etc/ssmtp/revaliases [enter]

…and edit appropriately with this command:

user@freebsdsrv:~ $ sudo ee /usr/local/etc/ssmtp/revaliases [enter]

Example:

# sSMTP aliases
#
# Format:       local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.
root:your.mail@example.net:mail.example.net
postmaster:your.mail@example.net:mail.example.net

Edit file ssmtp.conf appropriately with this command:

user@freebsdsrv:~ $ sudo ee /usr/local/etc/ssmtp/ssmtp.conf [enter]

Example:

#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#

# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=your.mail@example.net

# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
# The example will fit if you are in domain.com and your mailhub is so named.
mailhub=smtp.example.net:465

# Example for SMTP port number 2525
# mailhub=mail.your.domain:2525
# Example for SMTP port number 25 (Standard/RFC)
# mailhub=mail.your.domain
# Example for SSL encrypted connection
# mailhub=mail.your.domain:465

# Where will the mail seem to come from?
rewriteDomain=example.net

# The full hostname
hostname=freebsdsrv.example.net

# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
FromLineOverride=YES

# Use SSL/TLS to send secure messages to server.
UseTLS=YES

# Use SSL/TLS certificate to authenticate against smtp host.
#UseTLSCert=YES

# Use this RSA certificate.
#TLSCert=/usr/local/etc/ssmtp/ssmtp.pem

# Get enhanced (*really* enhanced) debugging information in the logs
# If you want to have debugging of the config file parsing, move this option
# to the top of the config file and uncomment
#Debug=YES

# Username/Password
AuthUser=username
AuthPass=password

Edit file /etc/crontab with:

user@freebsdsrv:~ $ sudo ee /etc/crontab [enter]

Add the following two lines (example):

# /etc/crontab - root's crontab for FreeBSD
#
#
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
HOME=/var/log
MAILTO="your.mail@example.net"
#
...

Run some tests as an unprivileged user – user should not a member of groupe ssmtp – with:

user@freebsdsrv:~ $ cat /usr/local/etc/ssmtp/ssmtp.conf [enter]
cat: /usr/local/etc/ssmtp/ssmtp.conf: Permission denied
user@freebsdsrv:~ $

Test your mail settings with:

user@freebsdsrv:~ $ echo Testing | mail -v -s Testing your.name@example.net [enter]
[<-] 220 ts201-smtpout75.ddc.example.net ESMTP Service ready
[->] EHLO freebsdsrv.local.lan
[<-] 250 SIZE 78643200
[->] AUTH LOGIN
[<-] 334 V..........6
[->] c.........y
[<-] 334 U........6
[<-] 235 LOGIN authentication successful
[->] MAIL FROM:
[<-] 250 MAIL FROM: OK
[->] RCPT TO:
[<-] 250 RCPT TO: OK
[->] DATA
[<-] 354 Start mail input; end with .
[->] Received: by freebsdsrv.local.lan (sSMTP sendmail emulation); Mon, 03 Feb 2025 15:48:39 +0100
[->] From: "Admin User" 
[->] Date: Mon, 03 Feb 2025 15:48:39 +0100
[->] To: your.name@example.net
[->] Subject: Testing
[->] 
[->] Testing
[->] .
[<-] 250 <66E9614204233F1E> Mail accepted
[->] QUIT
[<-] 221 ts201-smtpout75.ddc.example.net QUIT
user@freebsdsrv:~ $

N.B.: Mail transfer output to the terminal has been edited for security reasons!

user@freebsdsrv:~ $ mail -s "Testing sSMTP" your.address@example.net [enter]
This is a test with sSMTP [enter]

Type <Ctr><D> on a blank line to send message.

user@freebsdsrv:~ $

Change user to root and heck error log with:

user@freebsdsrv:~ $ tail /var/log/maillog [enter]
Feb  3 16:08:04 freebsdsrv sSMTP[2113]: Creating SSL connection to host
Feb  3 16:08:04 freebsdsrv sSMTP[2113]: SSL connection using ECDHE-RSA-AES256-GCM-SHA384
Feb  3 16:08:05 freebsdsrv sSMTP[2113]: Sent mail for user@local.lan (221 ts201-smtpout73.ddc.example.net QUIT) uid=1001 username=user outbytes=370
user@freebsdsrv:~ $
PhpMyAdmin – PHP-Scripts To Manage MariaDB/MySQL

PhpMyAdmin – PHP-Scripts To Manage MariaDB/MySQL

Description:

phpMyAdmin is a free software tool developed in PHP designed to manage MySQL administration over the web. It supports a wide range of operations on MySQL and MariaDB. Common tasks such as managing databases, tables, columns, relationships, indexes, users, permissions, and more can be performed through the user interface. Additionally, you can execute any SQL statement directly.
WWW: https://www.phpmyadmin.net/.

Requirements

The following application(s) must be installed, configured, and running before phpMyadmin is installed:

  1. Apache – Enable Hypertext Transfer Protocol Secure (HTTPS)
  2. Apache – PHP Scripting Language (8.4.X Branch)
  3. Apache – PHP-FPM (FastCGI Process Manager)
  4. MariaDB – Multithreaded SQL Database Server/Client

Check the version of PHP installed with:

user@freebsdsrv:~ $ php -v [enter]
PHP 8.3.15 (cli) (built: Jan 30 2025 02:19:13) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.15, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.15, Copyright (c), by Zend Technologies
user@freebsdsrv:~ $

In this example, PHP version 8.3.15 is installed.

Download phpMyAdmin Code

Download the latest version of the phpMyAdmin code. with:

user@freebsdsrv:~ $ fetch https://files.phpmyadmin.net/phpMyAdmin/5.2.2/phpMyAdmin-5.2.2-all-languages.tar.gz [enter]
phpMyAdmin-5.2.2-all-languages.tar.gz                   13 MB   27 MBps    01s
user@freebsdsrv:~ $

Extract the phpMyAdmin code

user@freebsdsrv:~ $ sudo tar zxvf phpMyAdmin-5.2.2-all-languages.tar.gz -C /usr/local/www/ [enter]
x phpMyAdmin-5.2.2-all-languages/
x phpMyAdmin-5.2.2-all-languages/.rtlcssrc.json
x phpMyAdmin-5.2.2-all-languages/CONTRIBUTING.md
x phpMyAdmin-5.2.2-all-languages/ChangeLog
x phpMyAdmin-5.2.2-all-languages/LICENSE
x phpMyAdmin-5.2.2-all-languages/README
x phpMyAdmin-5.2.2-all-languages/RELEASE-DATE-5.2.2

...
x phpMyAdmin-5.2.2-all-languages/vendor/williamdes/mariadb-mysql-kbs/src/Search.php
x phpMyAdmin-5.2.2-all-languages/vendor/williamdes/mariadb-mysql-kbs/src/SlimData.php
x phpMyAdmin-5.2.2-all-languages/yarn.lock
user@freebsdsrv:~ $
user@freebsdsrv:~ $ sudo mv /usr/local/www/phpMyAdmin-5.2.2-all-languages/ /usr/local/www/phpMyAdmin [enter] 
user@freebsdsrv:~ $

Configuration

Display the MariaDB sock with:

user@freebsdsrv:~ $ sudo sockstat | grep "mariadb" [enter]
mysql    mariadbd    3620 20  tcp4   127.0.0.1:3306        *:*
mysql    mariadbd    3620 21  stream /var/run/mysql/mysql.sock
user@freebsdsrv:~ $

Create a copy of file /usr/local/www/phpMyAdmin/config.sample.inc.php to /usr/local/www/phpMyAdmin/config.inc.php with:

user@freebsdsrv:~ $ sudo cp /usr/local/www/phpMyAdmin/config.sample.inc.php /usr/local/www/phpMyAdmin/config.inc.php ; ls -l /usr/local/www/phpMyAdmin/config* [enter]
-rw-r--r--  1 root wheel 4810 Jan 31 23:57 /usr/local/www/phpMyAdmin/config.inc.php
-rw-r--r--  1 root wheel 4810 Jan 21 04:15 /usr/local/www/phpMyAdmin/config.sample.inc.php
user@freebsdsrv:~ $

Create a Blowfish secret required for cookie-based authentication to encrypt passwords in cookies. The secret must be a 32-byte long string of random bytes. Generate the Blowfish secret with (Example; DO NOT USE THIS CODE!):

user@freebsdsrv:~ $ sudo openssl rand -hex 16 [enter]
f0ae3f22ccd506ec5430f3ac6fde0d63
user@freebsdsrv:~ $

Edit file /usr/local/www/phpMyAdmin/config.inc.php with:

user@freebsdsrv:~ $ sudo ee /usr/local/www/phpMyAdmin/config.inc.php [enter]

Add 32 random characters to $cfg[‘blowfish_secret’] to encrypt passwords in cookies as in this example:

$cfg['blowfish_secret'] = 'f0ae3f22ccd506ec5430f3ac6fde0d63'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

..and then add $cfg[‘Servers’][$i][‘socket’] = ‘/var/run/mysql/mysql.sock’; as in this example:

...
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['socket'] = '/var/run/mysql/mysql.sock';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
...

Create a UploadDir directory where SQL files can be uploaded by other means than phpMyAdmin (for example, FTP) and then set permissions with:

user@freebsdsrv:~ $ sudo mkdir /usr/local/www/phpMyAdmin/UploadDir; sudo chmod -vv 777 /usr/local/www/phpMyAdmin/UploadDir [enter]
/usr/local/www/phpMyAdmin/UploadDir: 040755 [drwxr-xr-x ] -> 040777 [drwxrwxrwx ]
user@freebsdsrv:~ $

Create a SaveDir webserver directory where exported files can be saved and then set permissions with:

user@freebsdsrv:~ $ sudo mkdir /usr/local/www/phpMyAdmin/SaveDir ; sudo chmod -vv 777 /usr/local/www/phpMyAdmin/SaveDir [enter]
/usr/local/www/phpMyAdmin/SaveDir: 040755 [drwxr-xr-x ] -> 040777 [drwxrwxrwx ]
user@freebsdsrv:~ $

Create a tmp for template caching with:

user@freebsdsrv:~ $ sudo mkdir /usr/local/www/phpMyAdmin/tmp ; sudo chmod -vv 777 /usr/local/www/phpMyAdmin/tmp [enter]
/usr/local/www/phpMyAdmin/tmp: 040755 [drwxr-xr-x ] -> 040777 [drwxrwxrwx ]
user@freebsdsrv:~ $

Create an Apache Include file to make phpMyAdmin available on the website with:

user@freebsdsrv:~ $ sudo ee /usr/local/etc/apache24/Includes/phpMyAdmin.conf [enter]

Add the following text;

Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
<Directory "/usr/local/www/phpMyAdmin/">
    DirectoryIndex index.php
    Options None
    AllowOverride Limit
    # range of access allowed
    Require ip 127.0.0.1 192.168.1.0/24
</Directory>

N.B.: Access is only allowed from computers connected to the network 192.168.1.0/24, the same network as this FreeBSD server!
The mbstring and mysqli extension is required by phpMyAdmin. Install php83-mbstring and php83-mysqli with:

user@freebsdsrv:~ $ sudo pkg install -y php83-mbstring php83-mysqli [enter]
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	oniguruma: 6.9.10
	php83-mbstring: 8.3.15
	php83-mysqli: 8.3.15

Number of packages to be installed: 3

The process will require 5 MiB more space.
1 MiB to be downloaded.
[1/3] Fetching php83-mysqli-8.3.15.pkg: 100%   52 KiB  53.6kB/s    00:01    
[2/3] Fetching php83-mbstring-8.3.15.pkg: 100%  922 KiB 944.0kB/s    00:01    
[3/3] Fetching oniguruma-6.9.10.pkg: 100%  253 KiB 258.9kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/3] Installing oniguruma-6.9.10...
[1/3] Extracting oniguruma-6.9.10: 100%
[2/3] Installing php83-mysqli-8.3.15...
[2/3] Extracting php83-mysqli-8.3.15: 100%
[3/3] Installing php83-mbstring-8.3.15...
[3/3] Extracting php83-mbstring-8.3.15: 100%
=====
Message from php83-mysqli-8.3.15:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-mysqli.ini.sample
=====
Message from php83-mbstring-8.3.15:

--
This file has been added to automatically load the installed extension:
/usr/local/etc/php/ext-20-mbstring.ini.sample
user@freebsdsrv:~ $

Restart PHP-FMP and Apache for the changes to take effect.
Restart PHP-FMP with:

user@freebsdsrv:~ $ sudo service php_fpm restart [enter]
Performing sanity check on php-fpm configuration:
[04-Feb-2025 13:23:56] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful
Stopping php_fpm.
Waiting for PIDS: 2041.
Performing sanity check on php-fpm configuration:
[04-Feb-2025 13:23:56] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful
Starting php_fpm.
freebsdsrv:~ $

Show PHP-FMP status with:

user@freebsdsrv:~ $ sudo service php_fpm status [enter]
php_fpm is running as pid 2662.
freebsdsrv:~ $

Restart Apache with:

user@freebsdsrv:~ $ sudo service apache24 restart [enter]
Performing sanity check on apache24 configuration:
Syntax OK
Stopping apache24.
Waiting for PIDS: 2009.
Performing sanity check on apache24 configuration:
Syntax OK
Starting apache24.
user@freebsdsrv:~ $

Show Apache status with:

user@freebsdsrv:~ $ sudo service apache24 status [enter]
apache24 is running as pid 2698.
freebsdsrv:~ $

phpMyAdmin Dashboard

Access the phpMyAdmin dashboard via https://192.168.1.50/phpmyadmin/index.php.
Log in to phpMyAdmin dashboard with the MariaDB database root/DBpassWd credentials.
N.B.: phpMyAdmin is not completely set up!
Some features are not enabled, and this should be indicated on the phpMyAdmin dashboard. Click on the ‘Find out why’ at the end of this message and complete the operation in the phpMyAdmin configuration storage dashboard.

If you encounter a phpMyAdmin login problems:

user@freebsdsrv:~ $ sudo mysql -u root -p [enter]
Enter password: DBpassWd [enter]
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 11.4.4-MariaDB FreeBSD Ports

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

root@localhost [(none)]> SET old_passwords=0; [enter]
Query OK, 0 rows affected (0.000 sec)

root@localhost [(none)]> ALTER USER root@localhost IDENTIFIED BY 'DBpassWd'; [enter]
Query OK, 0 rows affected (0.428 sec)

root@localhost [(none)]> exit [enter]
Bye
user@freebsdsrv:~ $

Enable PMA function

Add user PMA with:

user@freebsdsrv:~ $ sudo mysql -u root -p [enter]
Enter password: DBpassWd [enter]
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 11.4.4-MariaDB FreeBSD Ports

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

root@localhost [(none)]> SET old_passwords=0; [enter]
Query OK, 0 rows affected (0.000 sec)

root@localhost [(none)]> CREATE USER 'pma'@'localhost' IDENTIFIED VIA mysql_native_password USING 'pmaPassWd'; [enter]
Query OK, 0 rows affected (0.428 sec)

root@localhost [(none)]> GRANT ALL PRIVILEGES ON `phpmyadmin`.* TO 'pma'@'localhost'; [enter]
Query OK, 0 rows affected (0.428 sec)

root@localhost [(none)]> FLUSH PRIVILEGES; [enter]
Query OK, 0 rows affected (0 sec)

root@localhost [(none)]> exit [enter]
Bye
user@freebsdsrv:~ $

Enable use of PMA with:

user@freebsdsrv:~ $ sudo sudo ee +43 /usr/local/www/phpMyAdmin/config.inc.php [enter]
...
/**
 * phpMyAdmin configuration storage settings.
 */

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'pmaPassWd';

/* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
...

phpMyAdmin Configuration File

user@freebsdsrv:~ $ sudo ee /usr/local/www/phpMyAdmin/config.inc.php [enter]
<?php
/**
 * phpMyAdmin sample configuration, you can use it as base for
 * manual configuration. For easier setup you can use setup/
 *
 * All directives are explained in documentation in the doc/ folder
 * or at <https://docs.phpmyadmin.net/>.
 */

declare(strict_types=1);

/**
 * This is needed for cookie based authentication to encrypt the cookie.
 * Needs to be a 32-bytes long string of random bytes. See FAQ 2.10.
 */
$cfg['blowfish_secret'] = '7dc4d9bc3eafddd348d0c1bb7d34d139'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

/**
 * Servers configuration
 */
$i = 0;

/**
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['socket'] = '/var/run/mysql/mysql.sock';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;

/**
 * phpMyAdmin configuration storage settings.
 */

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
// $cfg['Servers'][$i]['controluser'] = 'pma';
// $cfg['Servers'][$i]['controlpass'] = 'pmapass';

/* Storage database and tables */
// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
// $cfg['Servers'][$i]['relation'] = 'pma__relation';
// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
// $cfg['Servers'][$i]['history'] = 'pma__history';
// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
// $cfg['Servers'][$i]['recent'] = 'pma__recent';
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
// $cfg['Servers'][$i]['users'] = 'pma__users';
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';

/**
 * End of servers configuration
 */

/**
 * Directories for saving/loading files from server
 */
$cfg['UploadDir'] = '/usr/local/www/phpMyAdmin/UploadDir';
$cfg['SaveDir'] = '/usr/local/www/phpMyAdmin/SaveDir';

/**
 * Whether to display icons or text or both icons and text in table row
 * action segment. Value can be either of 'icons', 'text' or 'both'.
 * default = 'both'
 */
//$cfg['RowActionType'] = 'icons';

/**
 * Defines whether a user should be displayed a "show all (records)"
 * button in browse mode or not.
 * default = false
 */
//$cfg['ShowAll'] = true;

/**
 * Number of rows displayed when browsing a result set. If the result
 * set contains more rows, "Previous" and "Next".
 * Possible values: 25, 50, 100, 250, 500
 * default = 25
 */
//$cfg['MaxRows'] = 50;

/**
 * Disallow editing of binary fields
 * valid values are:
 *   false    allow editing
 *   'blob'   allow editing except for BLOB fields
 *   'noblob' disallow editing except for BLOB fields
 *   'all'    disallow editing
 * default = 'blob'
 */
//$cfg['ProtectBinary'] = false;

/**
 * Default language to use, if not browser-defined or user-defined
 * (you find all languages in the locale folder)
 * uncomment the desired line:
 * default = 'en'
 */
//$cfg['DefaultLang'] = 'en';
//$cfg['DefaultLang'] = 'de';

/**
 * How many columns should be used for table display of a database?
 * (a value larger than 1 results in some information being hidden)
 * default = 1
 */
//$cfg['PropertiesNumColumns'] = 2;

/**
 * Set to true if you want DB-based query history.If false, this utilizes
 * JS-routines to display query history (lost by window close)
 *
 * This requires configuration storage enabled, see above.
 * default = false
 */
//$cfg['QueryHistoryDB'] = true;

/**
 * When using DB-based query history, how many entries should be kept?
 * default = 25
 */
//$cfg['QueryHistoryMax'] = 100;

/**
 * Whether or not to query the user before sending the error report to
 * the phpMyAdmin team when a JavaScript error occurs
 *
 * Available options
 * ('ask' | 'always' | 'never')
 * default = 'ask'
 */
//$cfg['SendErrorReports'] = 'always';

/**
 * 'URLQueryEncryption' defines whether phpMyAdmin will encrypt sensitive data from the URL query string.
 * 'URLQueryEncryptionSecretKey' is a 32 bytes long secret key used to encrypt/decrypt the URL query string.
 */
//$cfg['URLQueryEncryption'] = true;
//$cfg['URLQueryEncryptionSecretKey'] = '';

/**
 * You can find more configuration options in the documentation
 * in the doc/ folder or at <https://docs.phpmyadmin.net/>.
 */
Webmin & Usermin

Webmin & Usermin

Webmin

Description

Webmin is a web-based system administration tool for Unix-like servers and services, and it has about 1,000,000 installations worldwide yearly. Using it, it is possible to configure operating system internals, such as users, disk quotas, services, or configuration files, as well as modify and control open-source apps, such as BIND DNS Server, Apache HTTP Server, PHP, MySQL, and many more.

Required packages

Since Webmin will be installed outside the package manager, ensure the following recommended Perl modules and packages are present:
Perl modules:
– DateTime, DateTime::Locale, DateTime::TimeZone, Data::Dumper
– Digest::MD5, Digest::SHA, Encode::Detect, File::Basename
– File::Path, Net::SSLeay, Time::HiRes, Time::Local, Time::Piece
– lib, open
Packages:
– openssl – Cryptography library with TLS implementation
– shared-mime-info – Shared MIME information database
– tar gzip unzip – File compression and packaging utilities

Install required packages with:

user@freebsdsrv:~ $ sudo pkg install -y perl5 p5-DateTime-Locale p5-DateTime-TimeZone p5-Data-Dumper p5-Digest-MD5 p5-Digest-SHA p5-Encode-Detect p5-File-Path p5-JSON-XS p5-Time-HiRes p5-Time-Local p5-Time-Piece p5-Authen-PAM p5-Net-LDAP-Express p5-Net-SSLeay p5-IO-Tty gzip unzip shared-mime-info [enter]
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 77 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	glib: 2.80.5_1,2
	gzip: 1.13_1
	libffi: 3.4.6
	libiconv: 1.17_1
	libxml2: 2.11.9
	mpdecimal: 4.0.0
	p5-Algorithm-C3: 0.11
	p5-Authen-PAM: 0.16_2
	p5-Authen-SASL: 2.17_1
	p5-B-Hooks-EndOfScope: 0.28
	p5-Class-C3: 0.35
	p5-Class-Data-Inheritable: 0.10
	p5-Class-Inspector: 1.36
	p5-Class-Method-Modifiers: 2.15
	p5-Class-Singleton: 1.6
	p5-Clone: 0.47
	p5-Convert-ASN1: 0.34
	p5-Data-Dumper: 2.183
	p5-Data-OptList: 0.114
	p5-DateTime-Locale: 1.44
	p5-DateTime-TimeZone: 2.63,1
	p5-Devel-StackTrace: 2.05
	p5-Digest-HMAC: 1.05
	p5-Digest-MD5: 2.59
	p5-Digest-SHA: 6.04
	p5-Dist-CheckConflicts: 0.11_1
	p5-Encode-Detect: 1.01_1
	p5-Eval-Closure: 0.14
	p5-Exception-Class: 1.45
	p5-File-Path: 2.18
	p5-File-ShareDir: 1.118
	p5-IO-Socket-IP: 0.43
	p5-IO-Socket-SSL: 2.089
	p5-IO-Tty: 1.20_1
	p5-JSON-XS: 4.03
	p5-MRO-Compat: 0.15
	p5-Module-Implementation: 0.09_1
	p5-Module-Runtime: 0.016
	p5-Mozilla-CA: 20240924
	p5-Net-LDAP-Express: 0.12_1
	p5-Net-SSLeay: 1.94
	p5-Package-Stash: 0.40
	p5-Package-Stash-XS: 0.30
	p5-Params-Util: 1.102
	p5-Params-ValidationCompiler: 0.31
	p5-Role-Tiny: 2.002004
	p5-Specio: 0.49
	p5-Sub-Exporter: 0.991
	p5-Sub-Exporter-Progressive: 0.001013
	p5-Sub-Identify: 0.14
	p5-Sub-Install: 0.929
	p5-Sub-Quote: 2.006008_1
	p5-Text-Soundex: 3.05
	p5-Time-HiRes: 1.9764,1
	p5-Time-Local: 1.35
	p5-Time-Piece: 1.3300
	p5-Try-Tiny: 0.32
	p5-Types-Serialiser: 1.01
	p5-URI: 5.31
	p5-Variable-Magic: 0.64
	p5-XML-Filter-BufferText: 1.01_1
	p5-XML-NamespaceSupport: 1.12
	p5-XML-SAX: 1.02
	p5-XML-SAX-Base: 1.09
	p5-XML-SAX-Writer: 0.57
	p5-XString: 0.005
	p5-common-sense: 3.75
	p5-namespace-autoclean: 0.31
	p5-namespace-clean: 0.27
	p5-perl-ldap: 0.6800
	pcre2: 10.43
	perl5: 5.36.3_2
	py311-packaging: 24.2
	python311: 3.11.11
	readline: 8.2.13_2
	shared-mime-info: 2.4_1
	unzip: 6.0_8

Number of packages to be installed: 77

The process will require 347 MiB more space.
57 MiB to be downloaded.
[1/77] Fetching p5-Try-Tiny-0.32.pkg: 100%   18 KiB  18.2kB/s    00:01    
[2/77] Fetching p5-XML-SAX-1.02.pkg: 100%   46 KiB  47.4kB/s    00:01    
[3/77] Fetching p5-Digest-MD5-2.59.pkg: 100%   20 KiB  20.5kB/s    00:01    
[4/77] Fetching p5-Net-SSLeay-1.94.pkg: 100%  281 KiB 288.2kB/s    00:01    
[5/77] Fetching p5-Sub-Quote-2.006008_1.pkg: 100%   25 KiB  25.2kB/s    00:01    
[6/77] Fetching gzip-1.13_1.pkg: 100%  177 KiB 181.4kB/s    00:01    
[7/77] Fetching p5-IO-Socket-SSL-2.089.pkg: 100%  194 KiB 198.7kB/s    00:01    
[8/77] Fetching p5-B-Hooks-EndOfScope-0.28.pkg: 100%   19 KiB  19.7kB/s    00:01    
[9/77] Fetching p5-Algorithm-C3-0.11.pkg: 100%   11 KiB  11.1kB/s    00:01    
[10/77] Fetching mpdecimal-4.0.0.pkg: 100%  156 KiB 159.3kB/s    00:01    
[11/77] Fetching p5-Module-Runtime-0.016.pkg: 100%   16 KiB  16.6kB/s    00:01    
[12/77] Fetching p5-perl-ldap-0.6800.pkg: 100%  305 KiB 311.9kB/s    00:01    
[13/77] Fetching p5-Package-Stash-XS-0.30.pkg: 100%   16 KiB  16.9kB/s    00:01    
[14/77] Fetching p5-Net-LDAP-Express-0.12_1.pkg: 100%   14 KiB  14.1kB/s    00:01    
[15/77] Fetching p5-IO-Socket-IP-0.43.pkg: 100%   29 KiB  29.3kB/s    00:01    
[16/77] Fetching p5-URI-5.31.pkg: 100%  101 KiB 103.0kB/s    00:01    
[17/77] Fetching p5-Digest-SHA-6.04.pkg: 100%   38 KiB  38.8kB/s    00:01    
[18/77] Fetching p5-Module-Implementation-0.09_1.pkg: 100%   10 KiB  10.2kB/s    00:01    
[19/77] Fetching p5-Params-Util-1.102.pkg: 100%   19 KiB  19.2kB/s    00:01    
[20/77] Fetching p5-Package-Stash-0.40.pkg: 100%   21 KiB  21.6kB/s    00:01    
[21/77] Fetching unzip-6.0_8.pkg: 100%  140 KiB 143.2kB/s    00:01    
[22/77] Fetching p5-Class-Method-Modifiers-2.15.pkg: 100%   19 KiB  19.1kB/s    00:01    
[23/77] Fetching p5-Data-OptList-0.114.pkg: 100%   14 KiB  14.4kB/s    00:01    
[24/77] Fetching p5-Class-Inspector-1.36.pkg: 100%   19 KiB  19.9kB/s    00:01    
[25/77] Fetching p5-XML-NamespaceSupport-1.12.pkg: 100%   17 KiB  17.0kB/s    00:01    
[26/77] Fetching pcre2-10.43.pkg: 100%    1 MiB   1.5MB/s    00:01    
[27/77] Fetching p5-Clone-0.47.pkg: 100%   11 KiB  11.3kB/s    00:01    
[28/77] Fetching p5-File-Path-2.18.pkg: 100%   25 KiB  26.0kB/s    00:01    
[29/77] Fetching libiconv-1.17_1.pkg: 100%  734 KiB 751.9kB/s    00:01    
[30/77] Fetching p5-XString-0.005.pkg: 100%   13 KiB  12.9kB/s    00:01    
[31/77] Fetching p5-Params-ValidationCompiler-0.31.pkg: 100%   21 KiB  21.8kB/s    00:01    
[32/77] Fetching p5-Time-Local-1.35.pkg: 100%   19 KiB  19.4kB/s    00:01    
[33/77] Fetching p5-Time-Piece-1.3300.pkg: 100%   31 KiB  31.8kB/s    00:01    
[34/77] Fetching p5-Types-Serialiser-1.01.pkg: 100%   12 KiB  12.7kB/s    00:01    
[35/77] Fetching p5-Class-Singleton-1.6.pkg: 100%   12 KiB  12.3kB/s    00:01    
[36/77] Fetching p5-Encode-Detect-1.01_1.pkg: 100%   81 KiB  82.9kB/s    00:01    
[37/77] Fetching p5-Authen-SASL-2.17_1.pkg: 100%   41 KiB  42.4kB/s    00:01    
[38/77] Fetching p5-Dist-CheckConflicts-0.11_1.pkg: 100%   10 KiB  10.4kB/s    00:01    
[39/77] Fetching libxml2-2.11.9.pkg: 100%  872 KiB 893.4kB/s    00:01    
[40/77] Fetching p5-DateTime-Locale-1.44.pkg: 100%    3 MiB   3.4MB/s    00:01    
[41/77] Fetching p5-Sub-Install-0.929.pkg: 100%   14 KiB  14.7kB/s    00:01    
[42/77] Fetching p5-XML-Filter-BufferText-1.01_1.pkg: 100%    7 KiB   7.0kB/s    00:01    
[43/77] Fetching p5-namespace-autoclean-0.31.pkg: 100%   11 KiB  10.9kB/s    00:01    
[44/77] Fetching p5-Time-HiRes-1.9764,1.pkg: 100%   29 KiB  30.0kB/s    00:01    
[45/77] Fetching py311-packaging-24.2.pkg: 100%  127 KiB 129.9kB/s    00:01    
[46/77] Fetching p5-Variable-Magic-0.64.pkg: 100%   33 KiB  33.4kB/s    00:01    
[47/77] Fetching p5-Class-Data-Inheritable-0.10.pkg: 100%    8 KiB   8.1kB/s    00:01    
[48/77] Fetching p5-Data-Dumper-2.183.pkg: 100%   41 KiB  42.4kB/s    00:01    
[49/77] Fetching p5-Sub-Exporter-0.991.pkg: 100%   53 KiB  53.9kB/s    00:01    
[50/77] Fetching glib-2.80.5_1,2.pkg: 100%    4 MiB   4.3MB/s    00:01    
[51/77] Fetching p5-Convert-ASN1-0.34.pkg: 100%   35 KiB  35.7kB/s    00:01    
[52/77] Fetching p5-Authen-PAM-0.16_2.pkg: 100%   24 KiB  24.6kB/s    00:01    
[53/77] Fetching p5-Role-Tiny-2.002004.pkg: 100%   20 KiB  20.5kB/s    00:01    
[54/77] Fetching p5-Exception-Class-1.45.pkg: 100%   28 KiB  28.6kB/s    00:01    
[55/77] Fetching perl5-5.36.3_2.pkg: 100%   15 MiB  16.1MB/s    00:01    
[56/77] Fetching p5-namespace-clean-0.27.pkg: 100%   13 KiB  13.7kB/s    00:01    
[57/77] Fetching p5-Sub-Identify-0.14.pkg: 100%   10 KiB  10.5kB/s    00:01    
[58/77] Fetching p5-JSON-XS-4.03.pkg: 100%   81 KiB  83.3kB/s    00:01    
[59/77] Fetching p5-Mozilla-CA-20240924.pkg: 100%  129 KiB 132.3kB/s    00:01    
[60/77] Fetching p5-Sub-Exporter-Progressive-0.001013.pkg: 100%   12 KiB  11.8kB/s    00:01    
[61/77] Fetching p5-Specio-0.49.pkg: 100%  129 KiB 132.1kB/s    00:01    
[62/77] Fetching libffi-3.4.6.pkg: 100%   45 KiB  46.0kB/s    00:01    
[63/77] Fetching readline-8.2.13_2.pkg: 100%  397 KiB 406.3kB/s    00:01    
[64/77] Fetching p5-Digest-HMAC-1.05.pkg: 100%   15 KiB  15.5kB/s    00:01    
[65/77] Fetching p5-MRO-Compat-0.15.pkg: 100%   11 KiB  11.0kB/s    00:01    
[66/77] Fetching p5-common-sense-3.75.pkg: 100%    8 KiB   8.6kB/s    00:01    
[67/77] Fetching shared-mime-info-2.4_1.pkg: 100%  631 KiB 645.7kB/s    00:01    
[68/77] Fetching p5-XML-SAX-Writer-0.57.pkg: 100%   22 KiB  22.9kB/s    00:01    
[69/77] Fetching p5-Devel-StackTrace-2.05.pkg: 100%   18 KiB  18.9kB/s    00:01    
[70/77] Fetching p5-File-ShareDir-1.118.pkg: 100%   18 KiB  18.8kB/s    00:01    
[71/77] Fetching p5-Class-C3-0.35.pkg: 100%   19 KiB  19.2kB/s    00:01    
[72/77] Fetching p5-DateTime-TimeZone-2.63,1.pkg: 100%  260 KiB 266.2kB/s    00:01    
[73/77] Fetching p5-Text-Soundex-3.05.pkg: 100%   17 KiB  17.8kB/s    00:01    
[74/77] Fetching python311-3.11.11.pkg: 100%   27 MiB  28.0MB/s    00:01    
[75/77] Fetching p5-XML-SAX-Base-1.09.pkg: 100%   25 KiB  25.2kB/s    00:01    
[76/77] Fetching p5-Eval-Closure-0.14.pkg: 100%   11 KiB  11.0kB/s    00:01    
[77/77] Fetching p5-IO-Tty-1.20_1.pkg: 100%   30 KiB  30.9kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/77] Installing perl5-5.36.3_2...
[1/77] Extracting perl5-5.36.3_2: 100%
[2/77] Installing p5-Params-Util-1.102...
[2/77] Extracting p5-Params-Util-1.102: 100%
[3/77] Installing p5-Sub-Install-0.929...
[3/77] Extracting p5-Sub-Install-0.929: 100%
[4/77] Installing p5-Data-OptList-0.114...
[4/77] Extracting p5-Data-OptList-0.114: 100%
[5/77] Installing p5-Try-Tiny-0.32...
[5/77] Extracting p5-Try-Tiny-0.32: 100%
[6/77] Installing p5-Module-Runtime-0.016...
[6/77] Extracting p5-Module-Runtime-0.016: 100%
[7/77] Installing p5-XML-NamespaceSupport-1.12...
[7/77] Extracting p5-XML-NamespaceSupport-1.12: 100%
[8/77] Installing p5-Sub-Exporter-0.991...
[8/77] Extracting p5-Sub-Exporter-0.991: 100%
[9/77] Installing p5-XML-SAX-Base-1.09...
[9/77] Extracting p5-XML-SAX-Base-1.09: 100%
[10/77] Installing p5-XML-SAX-1.02...
[10/77] Extracting p5-XML-SAX-1.02: 100%
could not find ParserDetails.ini in /usr/local/lib/perl5/site_perl/XML/SAX
[11/77] Installing p5-Algorithm-C3-0.11...
[11/77] Extracting p5-Algorithm-C3-0.11: 100%
[12/77] Installing mpdecimal-4.0.0...
[12/77] Extracting mpdecimal-4.0.0: 100%
[13/77] Installing p5-Package-Stash-XS-0.30...
[13/77] Extracting p5-Package-Stash-XS-0.30: 100%
[14/77] Installing p5-Module-Implementation-0.09_1...
[14/77] Extracting p5-Module-Implementation-0.09_1: 100%
[15/77] Installing p5-Dist-CheckConflicts-0.11_1...
[15/77] Extracting p5-Dist-CheckConflicts-0.11_1: 100%
[16/77] Installing p5-Variable-Magic-0.64...
[16/77] Extracting p5-Variable-Magic-0.64: 100%
[17/77] Installing p5-Sub-Exporter-Progressive-0.001013...
[17/77] Extracting p5-Sub-Exporter-Progressive-0.001013: 100%
[18/77] Installing libffi-3.4.6...
[18/77] Extracting libffi-3.4.6: 100%
[19/77] Installing readline-8.2.13_2...
[19/77] Extracting readline-8.2.13_2: 100%
[20/77] Installing p5-Net-SSLeay-1.94...
[20/77] Extracting p5-Net-SSLeay-1.94: 100%
[21/77] Installing p5-B-Hooks-EndOfScope-0.28...
[21/77] Extracting p5-B-Hooks-EndOfScope-0.28: 100%
[22/77] Installing p5-IO-Socket-IP-0.43...
[22/77] Extracting p5-IO-Socket-IP-0.43: 100%
[23/77] Installing p5-Package-Stash-0.40...
[23/77] Extracting p5-Package-Stash-0.40: 100%
[24/77] Installing p5-Class-Method-Modifiers-2.15...
[24/77] Extracting p5-Class-Method-Modifiers-2.15: 100%
[25/77] Installing p5-XString-0.005...
[25/77] Extracting p5-XString-0.005: 100%
[26/77] Installing p5-XML-Filter-BufferText-1.01_1...
[26/77] Extracting p5-XML-Filter-BufferText-1.01_1: 100%
[27/77] Installing p5-Class-Data-Inheritable-0.10...
[27/77] Extracting p5-Class-Data-Inheritable-0.10: 100%
[28/77] Installing p5-Mozilla-CA-20240924...
[28/77] Extracting p5-Mozilla-CA-20240924: 100%
[29/77] Installing p5-Digest-HMAC-1.05...
[29/77] Extracting p5-Digest-HMAC-1.05: 100%
[30/77] Installing p5-Devel-StackTrace-2.05...
[30/77] Extracting p5-Devel-StackTrace-2.05: 100%
[31/77] Installing p5-Class-C3-0.35...
[31/77] Extracting p5-Class-C3-0.35: 100%
[32/77] Installing python311-3.11.11...
[32/77] Extracting python311-3.11.11: 100%
[33/77] Installing p5-Sub-Quote-2.006008_1...
[33/77] Extracting p5-Sub-Quote-2.006008_1: 100%
[34/77] Installing p5-IO-Socket-SSL-2.089...
[34/77] Extracting p5-IO-Socket-SSL-2.089: 100%
[35/77] Installing p5-URI-5.31...
[35/77] Extracting p5-URI-5.31: 100%
[36/77] Installing p5-Class-Inspector-1.36...
[36/77] Extracting p5-Class-Inspector-1.36: 100%
[37/77] Installing pcre2-10.43...
[37/77] Extracting pcre2-10.43: 100%
[38/77] Installing p5-Clone-0.47...
[38/77] Extracting p5-Clone-0.47: 100%
[39/77] Installing libiconv-1.17_1...
[39/77] Extracting libiconv-1.17_1: 100%
[40/77] Installing p5-Authen-SASL-2.17_1...
[40/77] Extracting p5-Authen-SASL-2.17_1: 100%
[41/77] Installing py311-packaging-24.2...
[41/77] Extracting py311-packaging-24.2: 100%
[42/77] Installing p5-Convert-ASN1-0.34...
[42/77] Extracting p5-Convert-ASN1-0.34: 100%
[43/77] Installing p5-Role-Tiny-2.002004...
[43/77] Extracting p5-Role-Tiny-2.002004: 100%
[44/77] Installing p5-Exception-Class-1.45...
[44/77] Extracting p5-Exception-Class-1.45: 100%
[45/77] Installing p5-namespace-clean-0.27...
[45/77] Extracting p5-namespace-clean-0.27: 100%
[46/77] Installing p5-Sub-Identify-0.14...
[46/77] Extracting p5-Sub-Identify-0.14: 100%
[47/77] Installing p5-MRO-Compat-0.15...
[47/77] Extracting p5-MRO-Compat-0.15: 100%
[48/77] Installing p5-common-sense-3.75...
[48/77] Extracting p5-common-sense-3.75: 100%
[49/77] Installing p5-XML-SAX-Writer-0.57...
[49/77] Extracting p5-XML-SAX-Writer-0.57: 100%
[50/77] Installing p5-Text-Soundex-3.05...
[50/77] Extracting p5-Text-Soundex-3.05: 100%
[51/77] Installing p5-Eval-Closure-0.14...
[51/77] Extracting p5-Eval-Closure-0.14: 100%
[52/77] Installing p5-perl-ldap-0.6800...
[52/77] Extracting p5-perl-ldap-0.6800: 100%
[53/77] Installing p5-Params-ValidationCompiler-0.31...
[53/77] Extracting p5-Params-ValidationCompiler-0.31: 100%
[54/77] Installing p5-Types-Serialiser-1.01...
[54/77] Extracting p5-Types-Serialiser-1.01: 100%
[55/77] Installing p5-Class-Singleton-1.6...
[55/77] Extracting p5-Class-Singleton-1.6: 100%
[56/77] Installing libxml2-2.11.9...
[56/77] Extracting libxml2-2.11.9: 100%
[57/77] Installing p5-namespace-autoclean-0.31...
[57/77] Extracting p5-namespace-autoclean-0.31: 100%
[58/77] Installing glib-2.80.5_1,2...
[58/77] Extracting glib-2.80.5_1,2: 100%
[59/77] Installing p5-Specio-0.49...
[59/77] Extracting p5-Specio-0.49: 100%
[60/77] Installing p5-File-ShareDir-1.118...
[60/77] Extracting p5-File-ShareDir-1.118: 100%
[61/77] Installing p5-Digest-MD5-2.59...
[61/77] Extracting p5-Digest-MD5-2.59: 100%
[62/77] Installing gzip-1.13_1...
[62/77] Extracting gzip-1.13_1: 100%
[63/77] Installing p5-Net-LDAP-Express-0.12_1...
[63/77] Extracting p5-Net-LDAP-Express-0.12_1: 100%
[64/77] Installing p5-Digest-SHA-6.04...
[64/77] Extracting p5-Digest-SHA-6.04: 100%
[65/77] Installing unzip-6.0_8...
[65/77] Extracting unzip-6.0_8: 100%
[66/77] Installing p5-File-Path-2.18...
[66/77] Extracting p5-File-Path-2.18: 100%
[67/77] Installing p5-Time-Local-1.35...
[67/77] Extracting p5-Time-Local-1.35: 100%
[68/77] Installing p5-Time-Piece-1.3300...
[68/77] Extracting p5-Time-Piece-1.3300: 100%
[69/77] Installing p5-Encode-Detect-1.01_1...
[69/77] Extracting p5-Encode-Detect-1.01_1: 100%
[70/77] Installing p5-DateTime-Locale-1.44...
[70/77] Extracting p5-DateTime-Locale-1.44: 100%
[71/77] Installing p5-Time-HiRes-1.9764,1...
[71/77] Extracting p5-Time-HiRes-1.9764,1: 100%
[72/77] Installing p5-Data-Dumper-2.183...
[72/77] Extracting p5-Data-Dumper-2.183: 100%
[73/77] Installing p5-Authen-PAM-0.16_2...
[73/77] Extracting p5-Authen-PAM-0.16_2: 100%
[74/77] Installing p5-JSON-XS-4.03...
[74/77] Extracting p5-JSON-XS-4.03: 100%
[75/77] Installing shared-mime-info-2.4_1...
[75/77] Extracting shared-mime-info-2.4_1: 100%
[76/77] Installing p5-DateTime-TimeZone-2.63,1...
[76/77] Extracting p5-DateTime-TimeZone-2.63,1: 100%
[77/77] Installing p5-IO-Tty-1.20_1...
[77/77] Extracting p5-IO-Tty-1.20_1: 100%
==> Running trigger: gio-modules.ucl
Generating GIO modules cache
==> Running trigger: glib-schemas.ucl
Compiling glib schemas
No schema files found: doing nothing.
==> Running trigger: shared-mime-info.ucl
Building the Shared MIME-Info database cache
=====
Message from python311-3.11.11:

--
Note that some standard Python modules are provided as separate ports
as they require additional dependencies. They are available as:

py311-gdbm       databases/py-gdbm@py311
py311-sqlite3    databases/py-sqlite3@py311
py311-tkinter    x11-toolkits/py-tkinter@py311
user@freebsdsrv:~ $

Download Webmin Code

Download the current version of the Webmin code with:

user@freebsdsrv:~ $ fetch https://github.com/webmin/webmin/releases/download/2.202/webmin-2.202.tar.gz [enter]
webmin-2.202.tar.gz                                   44 MB   27 MBps    02s
user@freebsdsrv:~ $

Extract the Webmin code

user@freebsdsrv:~ $ tar zxvf webmin-2.202.tar.gz [enter]
x webmin-2.202/
x webmin-2.202/acl/
x webmin-2.202/acl/module.info.fi
...
x webmin-2.202/change-user/module.info.pt_BR.auto
x webmin-2.202/password_change.cgi
x webmin-2.202/config-irix
user@freebsdsrv:~ $

Webmin setup

Create directory /usr/local/etc/rc.d with:

user@freebsdsrv:~ $ sudo mkdir /usr/local/etc/rc.d [enter]
user@freebsdsrv:~ $

Change directory to the Webmin installation directory with:

user@freebsdsrv:~ $ cd webmin-2.202 [enter]
user@freebsdsrv:~/webmin-2.202 $

Run the Webmin installtion script with:

user@freebsdsrv:~/webmin-2.202 $ sudo ./setup.sh /usr/local/webmin [enter]
****************************************************************************
           Welcome to the Webmin setup script, version 2.202
****************************************************************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.

Installing Webmin from /home/user/webmin-2.202 to /usr/local/webmin

****************************************************************************
Webmin uses separate directories for configuration files and log files.
Unless you want to run multiple versions of Webmin at the same time
you can just accept the defaults.

Config file directory [/etc/webmin]: [enter]
Log file directory [/var/webmin]: [enter]

****************************************************************************
Webmin is written entirely in Perl. Please enter the full path to the
Perl 5 interpreter on your system.

Full path to perl (default /usr/local/bin/perl): [enter]

Testing Perl ..
.. done

****************************************************************************
Operating system name:    FreeBSD
Operating system version: 14.2

****************************************************************************
Webmin uses its own password protected web server to provide access
to the administration programs. The setup script needs to know :
 - What port to run the web server on. There must not be another
   web server already using this port.
 - The login name required to access the web server.
 - The password required to access the web server.
 - If the web server should use SSL (if your system supports it).
 - Whether to start webmin at boot time.

Web server port (default 10000): [enter]
Login name (default admin): [enter]
Login password: AdminPassWd [enter]
Password again: AdminPassWd [enter]
Use SSL (y/n): y [enter]
Start Webmin at boot time (y/n): y [enter]

****************************************************************************
Copying files to /usr/local/webmin ..
.. done

Creating web server config files ..
.. done

Creating access control file ..
.. done

Inserting path to perl into scripts ..
.. done

Creating start and stop scripts ..
.. done

Copying config files ..
.. done

Configuring Webmin to start at boot time ..
.. done

Creating uninstall script /usr/local/etc/webmin/uninstall.sh ..
.. done

Changing ownership and permissions ..
.. done

Running postinstall scripts ..
.. done

Enabling background status collection ..
.. done

Attempting to start Webmin web server ..
.. done

****************************************************************************
Webmin has been installed and started successfully.

Since Webmin was installed outside the package manager, ensure the
following recommended Perl modules and packages are present:
 Perl modules:
  - DateTime, DateTime::Locale, DateTime::TimeZone, Data::Dumper
  - Digest::MD5, Digest::SHA, Encode::Detect, File::Basename
  - File::Path, Net::SSLeay, Time::HiRes, Time::Local, Time::Piece
  - lib, open
 Packages:
  - openssl - Cryptography library with TLS implementation
  - shared-mime-info - Shared MIME information database
  - tar gzip unzip - File compression and packaging utilities

Use your web browser to go to the following URL and login
with the name and password you entered previously:

  https://freebsdsrv:10000

Because Webmin uses SSL for encryption only, the certificate
it uses is not signed by one of the recognized CAs such as
Verisign. When you first connect to the Webmin server, your
browser will ask you if you want to accept the certificate
presented, as it does not recognize the CA. Say yes.

user@freebsdsrv:~/webmin-2.202 $

Change directory with:

user@freebsdsrv:~/webmin-2.202 $ cd [enter]
user@freebsdsrv:~ $

Configure permissions for access to the Webmin service with:

user@freebsdsrv:~ $ sudo sh -c 'echo -e "allow=127.0.0.1 192.168.1.0/24" >> /etc/webmin/miniserv.conf' ; sudo cat /etc/webmin/miniserv.conf [enter] 
port=10000
root=/usr/local/webmin
mimetypes=/usr/local/webmin/mime.types
addtype_cgi=internal/cgi
realm=Webmin Server
logfile=/var/log/webmin/miniserv.log
errorlog=/var/log/webmin/miniserv.error
pidfile=/var/log/webmin/miniserv.pid
logtime=168
ssl=0
no_ssl2=1
no_ssl3=1
ssl_honorcipherorder=1
no_sslcompression=1
env_WEBMIN_CONFIG=/usr/local/etc/webmin
env_WEBMIN_VAR=/var/log/webmin
atboot=1
logout=/usr/local/etc/webmin/logout-flag
listen=10000
denyfile=\.pl$
log=1
blockhost_failures=5
blockhost_time=60
syslog=1
ipv6=1
session=1
premodules=WebminCore
server=MiniServ/2.202
userfile=/usr/local/etc/webmin/miniserv.users
keyfile=/usr/local/etc/webmin/miniserv.pem
passwd_file=/etc/master.passwd
passwd_uindex=0
passwd_pindex=1
passwd_mode=0
preroot=authentic-theme
passdelay=1
logout_script=/usr/local/etc/webmin/logout.pl
cipher_list_def=1
login_script=/usr/local/etc/webmin/login.pl
failed_script=/usr/local/etc/webmin/failed.pl
allow=127.0.0.1 192.168.1.0/24
user@freebsdsrv:~ $

Restart the Webmin service with:

user@freebsdsrv:~ $ sudo service webmin.sh restart [enter]
Stopping Webmin server in /usr/local/webmin
Starting Webmin server in /usr/local/webmin
user@freebsdsrv:~ $

The Webmin service should be listening on port 10000. Verify this with:

user@freebsdsrv:~ $ sudo sockstat -4 -6 | grep 10000 [enter]
root     perl        3724 5   tcp4   *:10000               *:*
root     perl        3724 6   udp4   *:10000               *:*
user@freebsdsrv:~ $

You can now access the Webmin service at https://192.168.1.50:10000/ from a client computer in the network you allowed. When the Webmin login form is displayed, log in as the admin user you set during the installation.

Delete downloaded file

user@freebsdsrv:~ $ rm -R webmin-* [enter]
user@freebsdsrv:~ $

Usermin

Usermin is a web-based interface for webmail, password changing, mail filters, fetchmail and much more. It is designed for use by regular non-root users on a Unix system, and limits them to tasks that they would be able to perform if logged in via SSH or at the console.

Most users of Usermin are sysadmins looking for a simple webmail interface to offer their customers. Unlike most other webmail solutions, it can be used to change passwords, read email with no additional servers installed (like IMAP or POP3), and setup users’ configurations for forwarding, spam filtering and autoreponders.

Download Usermin Code

Download the current version of the Userbmin code with:

user@freebsdsrv:~ $ fetch https://github.com/webmin/usermin/releases/download/2.102/usermin-2.102.tar.gz [enter]
usermin-2.102.tar.gz                                    17 MB   36 MBps    00s
user@freebsdsrv:~ $

Extract the Usermin code

user@freebsdsrv:~ $ tar zxvf usermin-2.102.tar.gz [enter]
x usermin-2.102/
x usermin-2.102/update-from-repo.sh
x usermin-2.102/forward/
...
x usermin-2.102/ui-lib.pl
x usermin-2.102/password_change.cgi
x usermin-2.102/config-irix
user@freebsdsrv:~ $

Usermin setup

Change the directory to the Webmin installation directory with:

user@freebsdsrv:~ $ cd usermin-2.102 [enter]
user@freebsdsrv:~/usermin-2.102 $

Run the Userbmin installation script with:

user@freebsdsrv:~/usermin-2.102 $ sudo ./setup.sh /usr/local/usermin [enter]
****************************************************************************
          Welcome to the Usermin setup script, version 2.102
****************************************************************************
Usermin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.

Installing Usermin from /root/usermin-2.102 to /usr/local/usermin

****************************************************************************
Usermin uses separate directories for configuration files and log files.
Unless you want to run multiple versions of Usermin at the same time
you can just accept the defaults.

Config file directory [/etc/usermin]: [enter]
Log file directory [/var/usermin]: [enter]

****************************************************************************
Usermin is written entirely in Perl. Please enter the full path to the
Perl 5 interpreter on your system.

Full path to perl (default /usr/local/bin/perl): [enter]

Testing Perl ..
.. done

****************************************************************************
Operating system name:    FreeBSD
Operating system version: 14.2

****************************************************************************
Usermin uses its own password protected web server to provide access
to the administration programs. The setup script needs to know :
 - What port to run the web server on. There must not be another
   web server already using this port.
 - If the web server should use SSL (if your system supports it).

Web server port (default 20000): [enter]

Use SSL (y/n): y [enter]
****************************************************************************
Copying files to /usr/local/usermin ..
.. done

Creating web server config files ..
.. done

Creating access control file ..
.. done

Inserting path to perl into scripts ..
.. done

Creating start and stop init scripts ..
.. done

Creating start and stop init symlinks to scripts ..
.. done

Copying config files ..
.. done

Creating uninstall script /usr/local/etc/usermin/uninstall.sh ..
.. done

Changing ownership and permissions ..
.. done

Attempting to start Usermin web server ..
.. done

****************************************************************************
Usermin has been installed and started successfully.

Since Usermin was installed outside the package manager, ensure the
following recommended Perl modules and packages are present:
 Perl modules:
  - DateTime, DateTime::Locale, DateTime::TimeZone, Data::Dumper
  - Digest::MD5, Digest::SHA, Encode::Detect, File::Basename
  - File::Path, Net::SSLeay, Time::HiRes, Time::Local, Time::Piece
  - lib, open
 Packages:
  - openssl - Cryptography library with TLS implementation
  - shared-mime-info - Shared MIME information database
  - tar gzip unzip - File compression and packaging utilities

Use your web browser to go to the following URL and login
with the name and password you entered previously:

  http://freebsdsrv:20000

user@freebsdsrv:~/usermin-2.102 $

Change directory with:

user@freebsdsrv:~/usermin-2.102 $ cd [enter]
user@freebsdsrv:~ $

Enable Usermin to start on system boot with:

user@freebsdsrv:~ $ sudo sysrc usermin_enable="YES" [enter]
usermin_enable: -> YES
user@freebsdsrv:~ $

Configure permissions for access to the Usermin service with:

user@freebsdsrv:~ $ sudo sh -c 'echo -e "allow=127.0.0.1 192.168.1.0/24" >> /etc/usermin/miniserv.conf' ; sudo cat /etc/usermin/miniserv.conf [enter]
port=20000
root=/usr/local/usermin
mimetypes=/usr/local/usermin/mime.types
addtype_cgi=internal/cgi
realm=Usermin Server
logfile=/var/usermin/miniserv.log
errorlog=/var/usermin/miniserv.error
pidfile=/var/usermin/miniserv.pid
logtime=168
ppath=
ssl=1
no_ssl2=1
no_ssl3=1
env_WEBMIN_CONFIG=/etc/usermin
env_WEBMIN_VAR=/var/usermin
atboot=
logout=/etc/usermin/logout-flag
listen=20000
denyfile=\.pl$
log=1
blockhost_failures=5
blockhost_time=60
session=1
unixauth=user
pam=usermin
premodules=WebminCore
server=MiniServ/2.102
userfile=/etc/usermin/miniserv.users
keyfile=/etc/usermin/miniserv.pem
passwd_file=/etc/master.passwd
passwd_uindex=0
passwd_pindex=1
passwd_mode=2
sidname=usid
preroot=authentic-theme
passdelay=1
allow=127.0.0.1 192.168.1.0/24
user@freebsdsrv:~ $

The Usermin service should be listening on port 20000. Verify this with:

user@freebsdsrv:~ $ sudo sockstat -4 -6 | grep 20000 [enter]
root     perl        4619 4   tcp4   *:20000               *:*
root     perl        4619 5   udp4   *:20000               *:*
user@freebsdsrv:~ $

You can now access the Usermin service at https://192.168.1.50:20000/ from a client computer in the network you allowed. When the Usermin login form is displayed, log in as a local FreeBSD Server user.

Delete downloaded file

user@freebsdsrv:~ $ rm -R usermin-* [enter]
user@freebsdsrv:~ $