1. 概要
「Webmin」はブラウザを通して、「FreeBSD」のマシンを管理できるツールです。
詳細は「Webmin - Wikipedia」をご参照ください。
2. インストール
cd /usr/ports/sysutils/webmin/
make
make install
オプションはありません。
インストールの時メッセージを掲載しておきます。
===> Installing for webmin-1.941
===> Checking if webmin is already installed
===> Registering installation for webmin-1.941
Installing webmin-1.941...
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日の時点で、下記のバージョンでした。
$ pkg info webmin
webmin-1.941
Name : webmin
Version : 1.941
Installed on : Tue Jul 28 11:24:59 2020 JST
Origin : sysutils/webmin
Architecture : FreeBSD:11:amd64
Prefix : /usr/local
Categories : sysutils
Licenses : BSD3CLAUSE
Maintainer : olgeni@FreeBSD.org
WWW : http://www.webmin.com/
Comment : Web-based interface for system administration for Unix
Annotations :
FreeBSD_version: 1104001
cpe : cpe:2.3:a:webmin:webmin:1.941:::::freebsd11:x64
Flat size : 79.9MiB
Description :
Webmin is a web-based interface for system administration for Unix.
Using any browser that supports tables and forms, you can setup
user accounts, Apache, DNS, file sharing and so on.
Webmin consists of a simple web server, and a number of CGI programs
which directly update system files like /etc/inetd.conf and
/etc/master.passwd.
WWW: http://www.webmin.com/
3. セットアップ
以下の要領で初期セットアップを行います。
$ /usr/local/lib/webmin/setup.sh
以下、入力のプロンプトがあるところのみ抜粋しています。
↓Webmin のログ出力先(変更なしであれば Enter)
Log file directory [/var/log/webmin]:
↓perl の存在するディレクトリ(変更なしであれば Enter)
Full path to perl (default /usr/local/bin/perl):
↓アクセスするポート番号(変更なしであれば Enter)
Web server port (default 10000):
↓Webmin にログインするユーザ名を入力
Login name (default admin):
↓パスワードを2回入力(エコーバックされない)
Login password:
Password again:
↓SSL 使用の有無(y を推奨)
Use SSL (y/n): y Enter
ポート番号等、変更可能ですが、ポートスキャンされればポートは確認されてしまいます。
ポート番号を変更するしないより、後述する IP アドレス制限により接続可能なアドレスを制限すべきです。
「SSL」はセキュリティのために使用すべきです。
4. /etc/rc.conf の編集
「webmin」を有効化します。
cat << EOF >> /etc/rc.conf
webmin_enable="YES"
EOF
5. /etc/newsyslog の編集
Webmin のログは
/var/log/webmin/miniserv.error
/var/log/webmin/miniserv.log
に出力されます。
一応、参考までにわたしのログローテーション設定は
/usr/local/etc/newsyslog.conf.d/webmin.conf
を作成して、以下のように記述しています。
# 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
で起動します。