Ubuntu20.04にFiveMサーバーをインストールする方法

Ubuntu20.04にFiveMサーバーをインストールする方法

このチュートリアルでは、Ubuntu20.04にFiveMサーバーをインストールする方法を説明します。

前提条件

  • 少なくとも1つのCPUコアと2GBのメモリを備えたUbuntu20.04専用サーバーまたはVPS
  • rootユーザーアクセスまたは管理者権限を持つ通常のユーザー。

1.サーバーを最新の状態に保ちます

セキュリティ更新のために、サーバーを常に最新の状態に保ちます。

# apt update -y

# apt- upgrade -y

2.UFWにポートを追加します

FiveMが正しく機能するために必要なため、次のポートを必ず開いてください。

# ufw allow 30120
# ufw allow 30110

3.FiveMをインストールします

まず、空のディレクトリを作成して移動します。このディレクトリには、すべてのFiveMサーバーファイルが保持されます。

# mkdir ~/fivem_server
# cd ~/fivem_server

次のコマンドを使用して、最新のマスターブランチをダウンロードします。

# wget https://runtime.fivem.net/artifacts/fivem/build_proot_linux/master/3074-0c5d71ad77873c159d7542a7e8314d9696c1b55b/fx.tar.xz

最新のマスターブランチビルドについては、アーティファクトサーバーにアクセスしてください。wgetコマンドでダウンロードしてください。

ダウンロード後、次のコマンドを使用して解凍します。

# tar -xvf fx.tar.xz

これにより、必要なすべてのファイルが抽出されます。

ダウンロードしたアーカイブを正常に抽出したら、削除できます。

# rm fx.tar.xz

次に、cfx-server-dataリポジトリをサーバーファイルフォルダー外の新しいディレクトリに複製します。このディレクトリには、サーバーリソースが含まれます。以下のコマンドは、リポジトリを ホームディレクトリのfivem_resourcesという新しいフォルダに 複製します。

次に、FiveMライセンスキーで無料ライセンスを生成します。

私たちは、の名前で1つのコンフィギュレーション・ファイルが作成されますSERVER.CFGfivem_resourcesのディレクトリを。

# vi ~/fivem_resources/server.cfg

次の行を追加します。

# Only change the IP if you’re using a server with multiple network interfaces, otherwise change the port only.
endpoint_add_tcp "0.0.0.0:30120'
endpoint_add_udp "0.0.0.0:30120'

# These resources will start by default.
ensure mapmanager
ensure chat
ensure spawnmanager
ensure sessionmanager
ensure fivem
ensure hardcap
ensure rconlog
ensure scoreboard

# This allows players to use scripthook-based plugins such as the legacy Lambda Menu.
# Set this to 1 to allow scripthook. Do note that this does _not_ guarantee players won’t be able to use external plugins.
sv_scriptHookAllowed 0

# Uncomment this and set a password to enable RCON. Make sure to change the password - it should look like rcon_password "YOURPASSWORD'
#rcon_password "'

# A comma-separated list of tags for your server.
# For example:
# - sets tags "drifting, cars, racing'
# Or:
# - sets tags "roleplay, military, tanks'
sets tags "default'

# Set an optional server info and connecting banner image url.
# Size doesn’t matter, any banner sized image will be fine.
#sets banner_detail "https://url.to/image.png'
#sets banner_connecting "https://url.to/image.png'

# Set your server’s hostname
sv_hostname "FXServer, but unconfigured'

# Nested configs!
#exec server_internal.cfg

# Loading a server icon (96×96 PNG file)
#load_server_icon myLogo.png

# convars which can be used in scripts
set temp_convar "hey world!'

# Uncomment this line if you do not want your server to be listed in the server browser.
# Do not edit it if you *do* want your server listed.
#sv_master1 "'

# Add system admins
add_ace group.admin command allow # allow all commands
add_ace group.admin command.quit deny # but don’t allow quit
add_principal identifier.steam:110000100000000 group.admin # add the admin to the group

# Hide player endpoints in external log output.
sv_endpointprivacy true

# Server player slot limit (must be between 1 and 32, unless using OneSync)
sv_maxclients 32

# License key for your server (https://keymaster.fivem.net)
sv_licenseKey replaceThisWithYourLicenseKey

注:このreplaceThisWithYourLicenseKeyを生成されたライセンスキーと再レースします。必要に応じて、いくつかの設定を変更することもできます。

完了したら、保存して終了します。

4.サーバーを起動します

サーバーを起動するには、サーバーリソースディレクトリにいる必要があります。次に 、fivem_server ディレクトリのrunserver.shスクリプト を使用してサーバーを起動できます 。+ execserver.cfg パラメーターを必ず含めて ください

# cd ~/fivem_resources && bash ~/fivem_server/run.sh +exec server.cfg

オプション:サーバーをバックグラウンドで実行します

サーバーをバックグラウンドで実行するには、screensessionを使用します

# cd ~/fivem_resources && screen -s "FiveM server' bash ~/fivem_server/run.sh +exec server.cfg

FiveMコンソールを終了する場合は、  CTRL + A押してから、D押します。コマンドscreen-rを使用して、ウィンドウを再度開くことができ ます

一般的な問題

  • 「リソースが見つかりません」がなく、「リソースの開始に失敗しました」と表示されている場合は、適切なフォルダーにCDを挿入していません。
  • citizen:/ scripting /について多くのエラーが発生した場合は、run.shを使用していません。
  • ハートビートを送信する以外に何も起こらない場合は、run.shを使用せず、フォルダーへのcdに失敗しました。
  • リソースが開始されず、接続できない場合は、+ execを追加していません。
  • ライセンスキーが指定されていない場合は、上記のいずれかが適用されます。

FiveMサーバーが正常にインストールされました。

このチュートリアルでは、Ubuntu20.04にFiveMサーバーをインストールする方法を見てきました。


CentOS 7にCSF(ConfigServer Security&Firewall)をインストールして構成する方法

CentOS 7にCSF(ConfigServer Security&Firewall)をインストールして構成する方法

ConfigServer Security&Firewall(略してcsfとも呼ばれます)は、ステートフルパケットインスペクション(SPI)ファイアウォールです。CentOS7へのCSFのインストールと構成について学ぶ

CentOSにR1Softバックアップエージェントをインストールする方法

CentOSにR1Softバックアップエージェントをインストールする方法

CentOSにR1SoftBackupAgentをインストールして構成する方法を学びます。R1Soft Server Backup Managerは、サービスプロバイダーに柔軟でサーバーフレンドリーなソリューションを提供します。

CloudLinuxLVE制限を変更する方法

CloudLinuxLVE制限を変更する方法

この記事では、CloudLinuxLVE制限を変更する方法について説明しました。それでは、始めましょう。CloudLinux LVE制限は、LVEマネージャーを使用して変更できます。

ポートのSSHを変更する方法Linuxサーバー

ポートのSSHを変更する方法Linuxサーバー

LinuxサーバーのSSHポートを変更するには、SSH経由でサーバーにログインし、SSH構成ファイルを変更する必要があります。

CentOSにCentovaCastをインストールする方法

CentOSにCentovaCastをインストールする方法

Centova Castは、インターネットラジオストリームの主要な管理プラットフォームであり、ストリームホスティングプロバイダーに広範な洞察と制御を提供します。CentovaCast

メールサーバーでメールリレーを設定する方法

メールサーバーでメールリレーを設定する方法

次の電子メールリレー設定を使用すると、電子メール送信の問題を解決できます。

Ubuntu 18.04にApache、MariaDB、PHP、およびphpMyAdminをインストールする方法

Ubuntu 18.04にApache、MariaDB、PHP、およびphpMyAdminをインストールする方法

Ubuntu18.04サーバーにApacheMariaDBPHPとPHPMyAdminをインストールする方法を学習します。Apache、MySQL / MariaDB、およびPHPはパッケージで構成されています。それはランプとして知られています

Linuxでの基本的なユーザー管理を学ぶ

Linuxでの基本的なユーザー管理を学ぶ

Linuxでユーザーを追加、変更、または削除しますか?これがあなたにぴったりの記事です。

Linuxでの基本的なグループ管理について学ぶ

Linuxでの基本的なグループ管理について学ぶ

Linuxでのグループ管理の詳細をご覧ください。Linuxでグループを追加、グループを変更、グループを削除、メンバーを追加する方法。新しいグループを作成し、groupaddコマンドを使用します。

CentOS7にFail2banをインストールする方法を学ぶ

CentOS7にFail2banをインストールする方法を学ぶ

Fail2banは、SSH接続を保護するのに非常に役立ちます。これで、centos7にfail2banをインストールして構成し、サーバーにセキュリティのレイヤーを追加できるようになります。