Setting up a server/Debian/ja

From Minetest Wiki
< Setting up a server‎ | Debian
Revision as of 04:31, 25 September 2021 by Nogajun (talk | contribs) (added init system section)
Jump to navigation Jump to search
Languages 言語: English • Deutsch • 日本語

簡単なMinetestサーバーは、minetestパッケージがインストールされているDebian(Ubuntu、Linux Mint、または派生ディストリビューション)で「ホストサーバー」にチェックを入れるとホスティングできますが、このような場合、ホストがゲームをプレイしている間だけしか利用できません。

このガイドでは、グラフィカルなデスクトップ環境を使わずに永続的で最小限のサーバー環境設定の提供を目的としています。

Buster BackportsからMinetest Ver 5をインストールする

(訳注: 2021年9月現在、DebianはBuster(10)の次のバージョンのBluseye(11)がリリースされており、Backportsを導入しなくてもバージョン 5.3.0がインストール可能です。また、バージョンが離れるとBuster同様にBullseye Backportsから新しいバージョンが提供されるはずです。)

2019年8月現在、MinetestはDebian Buster(10/安定版)ではバージョン 0.4.17、Buster Backportsではバージョン 5.0.1が利用可能です。

この2つのバージョンには互換性がなく、同じシステムに両方のバージョンをインストールするのは厄介です。ほとんどのサーバーは最新バージョンを使っているはずですし、プレーヤーも最新バージョンを使っているでしょうから、バックポートのバージョンを選択するのが自然です。

では、はじめにDebian Wikiで説明されているとおりにBackportsリポジトリを追加します。

そして、必要なMinetestパッケージをインストールします。

# apt install -t buster-backports minetest-server

サーバーの起動を管理する

Systemdは、Debianでサービスを管理するために使われる、デフォルトで推奨されているシステムです。

systemd

Debianのminetest-serverパッケージは、バージョン 0.4.10+repack-3以降、Debian-minetestという名前の非特権ユーザーを自動的に作成します。このユーザーのホームディレクトリは、/var/games/minetest-serverです。すべての設定は、/etc/minetest/minetest.confで行います。すべてのログファイルは、/var/log/minetestに出力されます。

サーバーは、すでに起動しているはずです。起動しているかどうか(または、なぜ起動していないのか)を確認するには、以下のコマンドを使います。

# systemctl status minetest-server

サーバーを起動するには

# systemctl start minetest-server

サーバーを停止するには

# systemctl stop minetest-server

起動時にサーバーの起動を無効にするには

# systemctl disable minetest-server

systemdのテンプレートユニット機能を利用すれば、設定の異なる複数のサーバーを起動できます。

# systemctl start minetest-server@pvp.service

このサーバー用の設定ファイルを/etc/minetest/pvp.confに保存しておけば、サーバーはこの2つ目の設定を使用して、すべてのログを/var/log/minetest/pvp.logに記録します。簡単に言えば、@の後ろにあるpvpを好きな名前に置き換えるだけです。

sysV-init

initシステムにデフォルトのsystemdではなく古いsysV-initスタイルの設定を使いたい場合は、serviceコマンドを使ってサーバーの起動、停止もできます。

# service minetest-server start

または

# service minetest-server stop

サーバーの設定

You can find a commented server configuration file on /usr/share/doc/minetest/minetest.conf.example.gz.

 # zcat /usr/share/doc/minetest/minetest.conf.example.gz > /etc/minetest/myservername.conf

Interesting parameters start with the Server / Singleplayer section, you may delete client parameters prior to that.

modをインストールして有効にする

modのインストール

You can install the packages you want from the available mods.

If you need to install mods which aren't packaged yet in Debian (for instance, mobs_animal and mobs_monster), you can add them in the /var/games/minetest-server/.minetest/mods directory (create it if needed).

modを有効にする

You will need to enable them afterwards. Mod activation is not a general server setup, but a world setup.

Once a server is started, it should create world files, and refresh them to add configuration lines with the available mods in the world.mt file.

 $ cat /var/games/minetest-server/.minetest/worlds/world/world.mt
 creative_mode = false
 auth_backend = sqlite3
 player_backend = sqlite3
 gameid = minetest
 enable_damage = true
 backend = sqlite3
 load_mod_mobs_animal = true
 load_mod_mobs = true
 load_mod_mobs_monster = false

First, stop the server running the world. Then edit this file to enable the mod, just change the value from false to true on the corresponding load_mod_* lines.

詳細情報