1. 概要
「Webmin」はブラウザを通して、「FreeBSD」のマシンを管理できるツールです。
詳細は「Webmin - Wikipedia」をご参照ください。
2. インストール
cd /usr/ports/sysutils/webmin/
make
make install
オプションはありません。
インストールの時メッセージを掲載しておきます。
===> Installing for webmin-2.000
===> Checking if webmin is already installed
===> Registering installation for webmin-2.000
Installing webmin-2.000...
After installing Webmin for the first time you should perform the following
steps as root:
* Configure Webmin by running /usr/local/lib/webmin/setup.sh
* Add webmin_enable="YES" to your /etc/rc.conf
* Start Webmin for the first time by running "service webmin start"
The parameters requested by setup.sh may then be changed from within Webmin
itself.
2020年 7月28日の時点で、バージョン「1.941」でした。
2021年 5月28日の時点で、バージョン「1.973」でした。
2021年12月20日の時点で、バージョン「1.981_1」でした。
今回(2022年12月22日)は、バージョン「2.000」で、久々のメジャーアップグレードです。
3. セットアップ
以下の要領で初期セットアップを行います。
/usr/local/lib/webmin/setup.sh
メジャーバージョンが変わったためか、今までと手順が異なります。
以下、入力のプロンプトがあるところのみ抜粋します。
***********************************************************************
Welcome to the Webmin setup script, version 2.000
***********************************************************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.
Installing Webmin in /usr/local/lib/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 [/usr/local/etc/webmin]:
コンフィグレーションファイルの置き場所が上記で良いかってことですな。
Enter
Log file directory [/var/db/webmin]:
ログファイルの置き場所ですな。
今までは「var/log/webmin」だったんだけど、どうだろう?
提示のままにするならば Enter
変えるのであれば、ディレクトリ名を入力して 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):
「perl」の場所はここかってことで Enter
***********************************************************************
Testing Perl ..
.. done
***********************************************************************
Operating system name: FreeBSD
Operating system version: 12.4
***********************************************************************
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):
Login password:
Password again:
ここは、アクセスするユーザ名とパスワードの入力です。
パスワードの入力は、2回求められます。
パスワードは、例によってエコーバックされません。
Use SSL (y/n):
「SSL」を使用するかってことで y Enter
後は、ログを出力して終了します。
ポート番号等、変更可能ですが、ポートスキャンされればポートは確認されてしまいます。
ポート番号を変更するしないより、後述する IP アドレス制限により接続可能なアドレスを制限すべきです。
「SSL」はセキュリティのために使用すべきです。
4. /etc/rc.conf の編集
「webmin」を有効化します。
「root」ユーザ権限で。
sysrc webmin_enable=YES
5. /etc/newsyslog の編集
「Webmin」のログは、デフォルトに沿うと
/var/db/webmin/miniserv.error
/var/db/webmin/miniserv.log
に出力されるようになりました。
以前のように、「/var/db/webmin」のままが良ければ、前項の設定で変更します。
一応、参考までにわたしのログローテーション設定は
/usr/local/etc/newsyslog.conf.d/webmin.conf
を作成して、以下のように記述しています(「/var/db/webmin」に出力する形式で書いています)。
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/var/log/webmin/*.log 644 10 100 * BG
/var/log/webmin/*.error 644 10 100 * BG
フラグ等の意味は「メンテナンス・トラブルシュート - ログ」をご参照ください。
6. 起動
起動スクリプトは
/usr/local/etc/rc.d/webmin
です。
service webmin start
で起動します。