Pages

Wednesday, 30 March 2016

安装BungeeCord

This tutorial will teach you how to set up a BungeeCord server. BungeeCord will allow you to connect two or more existing Minecraft servers. For this guide, we will show you how to set up BungeeCord on a Linux VPS. The commands we provide will be for Ubuntu/Debian; they should work for all versions.
Please follow the highlighted code; you should be able to just copy and paste all of the code and have a BungeeCord server, however, we’ve also added instructions for learning purposes.
[STEP 1]
Connect via SSH to the VPS that will run the BungeeCord server. Make sure you have your apt packages update and a text editor such as nano installed first:
apt-get update && apt-get upgrade
apt-get install nano
[STEP 2]
Once you have ran both of those commands, you’ll be able to run the following commands to install Java, which is required to run BungeeCord. You will be asked some basic questions and will have to accept Oracle’s license; just agree to install everything.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

[STEP 3]
Now we will install screen, which will help you leave BungeeCord open after you close out of SSH. This means it will continue running, even after you exit when finishing this tutorial.
apt-get install screen
[STEP 4]
Copy the URL for the version of BungeeCord you want and then use the following commands to create a folder for BungeeCord to be placed in. Once the folder is created, the last command will download the BungeeCord file and place it in the folder. For this tutorial, we’ve used a link for the latest BungeeCord build.
cd ~ && mkdir bungeecord
cd bungeecord
wget http://ci.md-5.net/job/BungeeCord/lastSuccessfulBuild/artifact/bootstrap/target/BungeeCord.jar

[STEP 4]
Now we need to run the JAR file once to generate the files and ensure you’ve properly downloaded the file.
java -jar BungeeCord.jar
Once you see that the server is running and everything is done loading, it should say “listening on…” and then you can press ctrl+c to exit. Now, it’s time to set up crontab to make sure BungeeCord will always run, even if you reboot the server.
crontab -e
Then paste the following, and press ctrl+x to close out in nano text editor and save, or i to insert and the escape key and :wq if you’re using vim.
@reboot cd /root/bungeecord/; screen -dmS bungee java -jar BungeeCord.jar
[STEP 5]
To run BungeeCord and leave it open, type the following:
cd /root/bungeecord/; screen -dmS bungee java -jar BungeeCord.jar
Keep in mind you still need to configure BungeeCord to properly link your servers. To quickly add two servers, you need to edit the config.yml file in the BungeeCord folder we created. To edit this file, type:
nano /root/bungeecord/config.yml
Locate this portion in the config.yml file:
lobby:
  address: localhost:25565
  restricted: false
  motd: '&1Just another BungeeCord - Forced Host'
Then simply edit localhost:25565 to the IP and port of your lobby server. The lobby will automatically be the default server. You can add/edit additional servers by copying the same code and changing “lobby” to what you want the server to be called. Don’t forget to edit the address for the new server as well.
For example, if you have a server with the IP 23.45.45.95 and port 25566, and want it to be the lobby server, it will simply end up looking like this:
lobby:
  address: 23.45.45.95:25566
  restricted: false
  motd: '&1Just another BungeeCord - Forced Host'
After you’re done editing the config.yml, you need to restart the server. The easiest way to do this is to reboot the VPS, and this way, you can confirm that BungeeCord properly restarts after a reboot.
Have fun!