小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

如何在CentOS 6或7服務器上安裝Cuberite

 炒澆面館 2018-09-03
介紹

Cuberite是什么?

Cuberite是一個可擴展的開源Minecraft服務器實現(xiàn),使用c++編寫。它有一個易于使用的插件系統(tǒng),允許用戶用Lua編寫自定義插件,最初是用MCServer的名字創(chuàng)建的。

支持平臺:

Cuberite是多平臺的,可以用于大多數(shù)Linux操作系統(tǒng)和Windows。本教程將只介紹在CentOS 67安裝上安裝服務器軟件的情況。和大多數(shù)Minecraft服務器一樣,插件和其他因素將導致更大的內(nèi)存占用。首先,建議您至少有:

1 g的內(nèi)存

一個CPU核心

 

安裝

先決條件

在開始之前,我們必須確保系統(tǒng)是最新的,并且有一個適當?shù)奈谋揪庉嬈?。這對于配置服務器是必要的。我們還需要適當?shù)墓ぞ邅順?gòu)建和編譯軟件。

在我們安裝任何東西之前,執(zhí)行以下命令更新您的系統(tǒng):

yum update -y

現(xiàn)在,我們將安裝nano (您可以使用vim或任何其他編輯器):

yum install nano -y

完成后,運行以下命令安裝cmake(編譯器):

yum install cmake -y

現(xiàn)在,安裝screen (允許應用程序在后臺運行):

yum install screen -y

screen安裝之后,您可以繼續(xù)進入下一個部分

運行安裝腳本

現(xiàn)在我們已經(jīng)完成了安裝所需的所有依賴項,我們必須檢索腳本。下面的命令將在/root~中創(chuàng)建一個新目錄。

cd ~ && mkdir server
cd server
wget -O install.sh https://www./

現(xiàn)在,您可以運行安裝腳本:

sh install.sh

您將在終端上看到以下信息:

[root@demo server]# sh install sh
Hello, this script will download and compile Cuberite.
On subsequent runs, it will update Cuberite.
The compilation and download will occur in the current directory.
If you're updating, you should run: <Path to Cuberite>/compile.sh
Compiling from srouce takes time, but it usually generates faster
executables. If you prefer ready-to-use binaries or if you want
more info, please visit: https://
   Choose compile mode:
   *  (R)Release: Compiles normally.
                  Generates the fastest build.
   *  (D)Debug:   Compiles in debug mode.
                  Makes your console and crashes more verbose.
                  A bit slower than Release mode. If you plan to help
                  development by reporting bugs, this is preferred.
Choose compile mode: (r/d) (Default: "Release"):

當你看到上面的內(nèi)容時,只需按下鍵盤上的回車鍵。

現(xiàn)在您將看到以下內(nèi)容:

Choose the number of compilation threads.
You have 2 CPU threads.
If you have enough RAM, it is wise to choose your CPU's thread count.
Otherwise choose lower. Old Raspberry Pis should choose 1. If in doubt, choose 1
.
Please enter the number of compilation threads to use (Default: 1):

您可以選擇為編譯使用更多的線程(取決于您擁有的實例)。除此之外,你要做的就是按回車鍵。

一旦你這樣做了,你將被提示如下信息:

#### Settings Summary ####
Build Type:                    Release
Branch:                        master (Currently the only choice)
Compilation threads:           1
CPU Threads:                   2
Previous Compilation:          Not detected. We are assuming this is the first compile.sh run.
Upstream Link:                 https://github.com/cuberite/cuberite.git
Upstream Repo:                 origin
 
After pressing ENTER, the script will connect to https://github.com/cuberite/cuberite.git
to check for updates and/or fetch code. It will then compile your program.
If you compiled before, make sure you're in the proper directory and that "Previous
compilation" is detected.
Press ENTER to continue...

這是編譯開始前的最后一步。您將被告知按回車鍵開始編譯。根據(jù)您的系統(tǒng),大約需要15分鐘。

注意:如果你看到一堆文本在你的終端上滾動,不要驚慌。系統(tǒng)將軟件完全編譯成可執(zhí)行包需要一些時間。

一旦完成,你會收到以下信息:

-----------------
Compilation done!
 
Cuberite awaits you at:
/root/server/cuberite/Server/Cuberite
 
You can always update Cuberite by executing:
/root/server/cuberite/compile.sh
 
Enjoy :)

這標志著安裝的結(jié)束。您可以進入下一節(jié)了解服務器的配置。

配置

為了配置您的服務器,我們必須首先從我們的臨時目錄中找到并復制已編譯的服務器:

cd cuberite
cp -r Server ~/server/cuberiteServer
cd ./cuberiteServer

您的服務器目錄將位于/root/server/cuberiteServer ,配置文件將位于/root/server/cuberiteServer/settings.ini.

我們現(xiàn)在可以使用任何文本編輯器編輯配置:

nano settings.ini

您將看到如下內(nèi)容:

[Server]
Description=Cuberite - in C++!
ShutdownMessage=Server shutdown
MaxPlayers=100
HardcoreEnabled=0
AllowMultiLogin=0
Ports=25565

為了編輯在任何給定時間可以在線的最大玩家數(shù)量,只需將MaxPlayers=100行修改為任何您想要的數(shù)字。

例如,如果您想要最多25個玩家,您所要做的就是將行改為MaxPlayers=25

你也可以改變這個端口,但是不建議這樣做,因為用戶連接到你的服務器的難度增加了(Minecraft服務器的默認端口是25565)。

如果你使用的是nano,你可以退出并通過CTRL + X保存,然后回車。

啟動、停止并連接到新服務器

啟動服務器

要啟動服務器,只需轉(zhuǎn)到服務器目錄(/root/server/cuberiteServer)并啟動一個屏幕:

cd ~/server/cuberiteServer
screen -S MinecraftServer && screen -r MinecraftServer

您可以在任何時候使用screen -r 命令重新連接到屏幕。我們將屏幕命名為MinecraftServer,因此重新連接可以通過執(zhí)行screen -r MinecraftServer來完成。

現(xiàn)在,執(zhí)行服務器二進制文件:

./Cuberite

在使用服務器之前,地形可能需要幾秒鐘才能生成。同樣,使用以下組合退出屏幕:CTRL + A + D。

停止服務器

為了執(zhí)行硬關機,你只需要使用CTRL + c來執(zhí)行一個優(yōu)雅的關機,在控制臺輸入以下命令:

stop

 連接到您的服務器

假設您已經(jīng)配置了防火墻,那么您可以在Minecraft客戶機中輸入服務器地址。

您的地址應該如下所示:192.0.2.5:25565(192.0.2.5是實際的服務器地址)。

最后的評論

此時,您可以將服務器地址和一些朋友一起傳遞,然后開始構(gòu)建。

卸載Cuberite

刪除軟件很簡單。您所要做的就是確保服務器離線并運行rm -rf ~/server。

 

    本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多