Skip to content

Latest commit

 

History

History
349 lines (264 loc) · 18.7 KB

File metadata and controls

349 lines (264 loc) · 18.7 KB

 # Minecraft Team

" Code Blockers"

Glanel

Fungo

Xee

Joseph

Adam

http://minecraft.wikia.com/wiki/File:Minecraft-creeper-wallpaper-1920x1080esourceenginecom---minecraft-downloads-uzfaxphw.png

Team Members presentation:

Documentation Glanel

Support Kasia

Testing Adam

Support Xee

Research Fongoh

     We will host a minecraft server on a selected HP machine and Raspberry Pi 3 in order to test two environments. The HP machine will run on the Ubuntu ditro while Raspbian will run on the Raspberry Pi 3.

We will configure an afraid.org dnsto ensure our stable versions go online. We will obtain a subdomain from Saintpaul college through our lecturer Matthew.

We will use as communication platform discord.

While all support and research updtates will be sent to the project created on github.

                                        # Support:

TCP vs UDP

TCP: Transmission Control Protocol

Connection oriented, Guaranteed reliable, 3-way handshake, A send SYN to B, B send SYN ACK to A, A send ACK to B, Connection established between two neighbor

UDP: User Datagram Protocol

Connectionless Not guarantee and unreliable protocol

SSH: SSH is stand for Secure Shell.

TCP port 22 is assigned to this protocol. It was designed to replace Telnet(port 23) and other unsecured protocols. The protocol is used to start the SSH client session that enables secure connection to the SSH server on a remote machine.

How to BootMinnecraft

#How to Restart Server Hello Team CodeBlockers. I realised the minecraft service fails after awhile, while we report tis to the ADMIN, we should do the following to keep the service alive;

     #  Login into your SootSplash account
     # cd /opt
     # cd scripts
     # then WHEN SCREEN LAUNCES JUST ACCEPT BY USING THE RETURN.
     # sudo ./codebminecraft.sh

Once the script is launched, the server will boot up.

THANKS TEAM

"CodeBlockers Codes"

#!/bin/sh #echo "go to /opt directory" #cd /opt #echo "install oracle java and accept agreement" #sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-arm32-vfp-hflt.tar.gz #echo "complile into a zip file" #sudo tar -zxvf jdk-8u161-linux-arm32-vfp-hflt.tar.gz #echo"configure java environment" #sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_161/bin/java 1 #sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_161/bin/javac 1 #echo "set java version and compiler as default" #sleep 1 #echo "ensure you select the right option downloaded" #sudo update-alternatives --config java #sudo update-alternatives --config javac

#echo "check java version" #java -version #sleep 2 #javac -version #sleep 2 #echo "update and upgrade" #sudo apt-get update && sudo apt-get -y upgrade #echo "install git" #echo "install screen to help run minecraft server console" #sudo apt-get install screen #echo "create a folder" #cd ~ #mkdir codeblockers #cd codeblockers #sleep 1 #echo "download buildtools" #wget #https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar #echo "build the server" #sudo java -jar BuildTools.jar --rev 1.12.2 #echo "lets run our server" #sudo java -Xms512M -Xmx1008M -jar #/codeblockers/spigot-1.12.2.jar nogui #echo "accept eula agreement" #sudo nano eula.txt #echo "configure server.properties" #sudo nano server.properties #echo "rerun our minecraft server" #sudo java -Xms512M -Xmx1008M -jar #/codeblockers/spigot-1.12.2.jar nogui #echo "bootup server automatically with a script" #mkdir ~/startup #cd ~/startup #nano codebminecraft.sh #echo "insert the command to run the server in the bash script you create" sleep 2 #echo "make the script executable" #chmod u+x codebminecraft.sh #echo "lets start the server" screen #sudo ~/startup/minecraft.sh #echo "to exit screen use CTRL AD" #sleep 1 #echo "lets save our working serving" #cd ~ #tar -zcvf codebminecraft_backup.tar.gz codeblockers

#echo "end of script"

Code-Blocker Next

#!/bin/sh

Installing on x64 platform,Linux server

echo "we will be installing on a linux based distribution with this script."

#sleep 5

#echo "go to /opt directory" #cd /opt #echo "install oracle java and accept agreement" #sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz

#echo "complile into a zip file" tar -zxvf jdk-8u161-linux-x64.tar.gz #echo"configure java environment" #sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_161/bin/java 1 #sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_161/bin/javac 1

#echo "set java version and compiler as default" sleep 1 #echo "ensure you select the right option downloaded" #sudo update-alternatives --config java #sudo update-alternatives --config javac

#echo "check java version" #sudo java -version sleep 2 #sudo javac -version sleep 2 #echo "update and upgrade" #sudo apt-get update && sudo apt-get -y upgrade #echo "install git" #echo "install screen to help run minecraft server console" #sudo apt-get install screen #echo "create a folder" #cd /opt

sudo mkdir minecraft

#cd minecraft

sleep 1 #echo "download buildtools" #sudo wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar

#echo "build the server" #sudo java -jar BuildTools.jar --rev 1.12.2 #echo "lets run our server" #sudo java -Xms1024M -Xmx2048M -jar /opt/minecraft/spigot-1.12.2.jar nogui #echo "accept eula agreement" #sudo nano eula.txt #echo "configure server.properties" #sudo nano server.properties #echo "rerun our minecraft server" #sudo java -Xms1024M -Xmx2048M -jar /opt/minecraft/spigot-1.12.2.jar nogui #echo "bootup server automatically with a script" #cd /opt && sudo mkdir scripts #cd scripts #sudo nano codebminecraft.sh #echo "insert the command to run the server in the bash script you create" #echo " cd /opt/minecraft/ && java -Xms1024M -Xmx2048M -jar /opt/minecraft/spigot-1.12.2.jar nogui"

sleep 5 #echo "make the script executable" #sudo chmod u+x codebminecraft.sh #echo "lets start the server" #sudo screen ./opt/scripts/codebminecraft.sh #echo "to exit screen use CTRL AD" sleep 1 #echo "lets save our working serving" #cd /opt #tar -zcvf codebminecraft_backup.tar.gz minecfraft #echo "lets harden our firewall" gsudo iptables -A INPUT -p tcp --dport 25565 -m state --state NEW -j ACCEPT #echo "lets make the script to start on bootup" #sudo nano /etc/rc.local #echo "add the foolowing into the line before exit 0... screen -dm -S minecraft /opt/scripts/codebminecraft.sh"

#echo "end of script"

#Team Contribution

Our last deployment process was qausi successful as we got the minecraft server running. Nevertheless, we could not access the server nor make the server boot on startup.

The following step by step process in installing the raspberry was created.

#Difficulties In Installation on Sootsplash When i issued the java build command i encountered this error when my script ran;

/usr/bin/java: 1: /usr/bin/java: Syntax error: word unexpected (expecting ")")

To solve the above i used the open jdk environmen as our installation was based on Oracle Java

It should be noted that each time you write a command which has to alter system files sudo must be used as this is a secured server. This is different from your local server.

When i ran my server it could not bind to port 25565 as another instance was running so i did the following; sudo lsof -n -i

To kiil the process and finally make the server start. sudo fuser -k 25565/tcp

This helped me to restart the server. But during class discussions, we noticed we had to work with firewalls. The iptables proofed that the tcp port 25565 was not listed and had to be added. The following commands were used; We applied this rule; sudo /sbin/iptables -A INPUT -p tcp --dport 25565 -m state --state NEW -j ACCEPT While in class the following command was utilised. sudo iptables -A INPUT -p tcp --dport 25565 -m state --state NEW -j ACCEPT But there was an additional configuration which was issued and I will present it in my next updates.

The current issue we face is the fact that once there is a broken pipe, our server cannot restart. This we have to figure out. Likewise i changed the rc.local to launch the minecraft server from startup if the main server reboots. I have not tested this yet!! I also made installation scripts for Raspberry and Linux platforms as there is a hardware difference.

More updates will be made as i test other platforms and check out errors.

#What needs to be done;

  • Make our Server Known for others to use
  • Give installation instructions or minecraft client software for use by others in both windows and linux platforms.
  • Monitor the server while users are active.
  • Check on how to resolve a crashed session.

#Errors encountered and solutions com.mojang.authlib.GameProfile@362abd5[id=,name=loknji13,properties={},legacy=false] (/73.xx.xxx.xxx:36094) lost connection: Disconnected This means that the users account has been disconnected from the main Mojang server as a result of an idle Minecraft client. The timeout is still to be estimated... The solution is to close the Minecraft client and restart a new session.

Installation Procedure. Install the raspberry pi using the Rasbian version of linux. This permits us to configure our raspberry. We will configure our Raspberry to operate in command line mode. Then we will enable SSH by using the following command to assist us. #sudo raspi-config this command was not used as I deployed on sootsplash.csci2461.com

The hostname of our server is necessary so we use for configurations of our DNS #sudo hostname -I

Now we create a directory where all our installation files and downloads will be hosted. #sudo mkdir /home/minecraft1 now let's download the Minecraft server. We will retrieve using wget. #sudo wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar

In using the spigot version we need java tools to suthe java build tools file to create the server. We will need the latest version available. #sudo java -jar Buildtools.jar --rev latest This command failed when it was launched, saying java; not found so I used the the following #sudo apt-get install git openjdk-8-jre-headless it took 1minutes installing Check the java version with the following command #java -version check the firewall if you are using IP tables to add an exception to iptables rules #sudo iptables -A INPUT -p tcp --dport 25565 -j ACCEPT We will be using tcp port 25565

lets create a minecraft user #sudo adduser mincraft #sudo su - minecraft #mkdir build #cd build #wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar #java -jar BuildTools.jar This will take about 10 minutes The following installation summary was made after the installation [INFO] Reactor Summary: [INFO] [INFO] Spigot-API ......................................... SUCCESS [ 13.257 s] [INFO] Spigot-Parent ...................................... SUCCESS [ 0.261 s] [INFO] Spigot ............................................. SUCCESS [ 57.322 s] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:11 min [INFO] Finished at: 2018-04-12T01:15:36Z [INFO] Final Memory: 30M/454M [INFO] ------------------------------------------------------------------------

We will move the resulting .jar file to a folder #mkdir ../server #cd ../server #mv ../build/spigot-1.*.jar spigot.jar

now let us create a script to boot names wrapper.sh using the following commands #!/bin/bash #cd /home/mincraft/server #java -XX:MaxPermSize=1024M -Xms512M -Xmx1536M -jar spigot.jar

This file permission can be changed according to our diskspace lets the file executable #chmod +x /home/minecraft/server/wrapper.sh

Now let's start spigot #java -Xms512M -Xmx900M -jar spigot.jar

It will say the following; Loading libraries, please wait... [01:27:31 INFO]: Starting minecraft server version 1.12.2 [01:27:31 INFO]: Loading properties [01:27:31 WARN]: server.properties does not exist [01:27:31 INFO]: Generating new properties file [01:27:31 WARN]: Failed to load eula.txt [01:27:31 INFO]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info. [01:27:31 INFO]: Stopping server

We will have to accept the eula agreement by using the following nano eula.txt and editing the line 3 from eula=false to eula=TRUE

now lets exit the minecraft user Using the root user account nano /etc/rc.local and add #su -l minecraft -c "screen -dmS minecraft /home/minecraft/server/wrapper.sh" Add the above before the exit 0

to manually start the service #sudo su -l minecraft -c "screen -dmS minecraft /home/minecraft/server/wrapper.sh"

The following error was noticed; OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=1024M; support was removed in 8.0 Loading libraries, please wait... 2018-04-12 01:59:31,751 main ERROR Cannot access RandomAccessFile java.io.FileNotFoundException: logs/latest.log (Permission denied) java.io.FileNotFoundException: logs/latest.log (Permission denied).

#Installation of a Minecraft Raspberry Server

#Raspberry Pi Model It is recommended we use Raspberry 3 with its 1Gigabyte of RAM and a quad core ARM cpu.n\This version does not need overclocking configurations. We can download the OS for installation on your raspberry usb micro sd here. Using etchwe can make our micro sd card bootable. The Rasbian Stretch version is preferable and you can decide between the Lite or Desktop images.

#Why Raspberry Pi We will use a raspberry Pi for test purposes and to start a small minecraft server for a lan server. The tested environment shall be transferable into a dedicated server provided. This dedicated server shall have its server.properties file reconfigured to accomodate the bigger server on a dedicated Linux hardware with Intel/AMD processors. In addition, since Rasbian is a debian distribution, all configurations and instructions would work on Debian servers.

#Login to your Pi Via using your console Via using ssh: ssh pi@address

#Download Java Minecraft requires Java to run. We will download the latest Oracle Java. We will change to the /opt directory, use wget to download and accept Oracle agreements and then extract contents to the opt folder. The following command will help us;

cd /opt sudo wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-arm32-vfp-hflt.tar.gz sudo tar -zxvf jdk-8u161-linux-arm32-vfp-hflt.tar.gz COnfiguration of Java We will configure the Java environment to permit our our system access the java binary and compiler necessary in building our minecraft server. We will use the following commands;

sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_161/bin/java 1 sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_161/bin/javac 1 We will then set this java version as the default versions. Select the right version option. sudo update-alternatives --config java sudo update-alternatives --config javac We will then check our java version

java -version javac -version Setting Up Minecraft environment Lets update and upgrade our system

sudo apt-get update && sudo apt-get -y upgrade Install git sudo apt-get install git Lets install screen to assist us run the minecraft server console while logged out of pi.

sudo apt-get install screen Installing Minecraft We will install the Spigot Minecraft Server build. lets create a folder cd /home/pi mkdir codeblockers cd codeblockers

We will download the buildtools

wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar Then build our server. This compilation process takes close to an hour on a Pi 3 system. sudo java -jar BuildTools.jar --rev 1.12.2 Configuring the Spigot server Once the compilation is completewe should ensure we are in the codeblockers directory and run the server for the first time.

sudo java -Xms512M -Xmx1008M -jar /home/pi/codeblockers/spigot-1.12.2.jar nogui We will then accept the EULA agreement after the server stops running. sudo nano eula.txt Inside the eula.txt, change the line eula=false to eula=true Let us now change the server properties

sudo nano server.properties The following properties are recommended for a start, but you can change server.properties following its Wiki. #Minecraft server properties spawn-protection=16 generator-settings= force-gamemode=true allow-nether=true gamemode=0 enable-query=false player-idle-timeout=0 difficulty=2 spawn-monsters=true op-permission-level=4 announce-player-achievements=true pvp=true snooper-enabled=true level-type=DEFAULT hardcore=false enable-command-block=false max-players=10 network-compression-threshold=256 resource-pack-sha1= max-world-size=29999984 server-port=25565 debug=false server-ip= spawn-npcs=true allow-flight=false level-name=world view-distance=10 resource-pack= spawn-animals=true white-list=false generate-structures=true online-mode=true max-build-height=256 level-seed= prevent-proxy-connections=false use-native-transport=true motd=My Minecraft Server enable-rcon=false

Now lets rerun our server sudo java -Xms512M -Xmx1008M -jar /home/pi/codeblockers/spigot-1.12.2.jar nogui

#Script to Run server Lets make the minecraft server to run from a script.

mkdir /home/pi/startup cd /home/pi/startup nano minecraft.sh Inside our minecraft.sh, we will add the following scripts. #!/bin/bash cd /home/pi/codeblockers/ && java -Xms512M -Xmx1008M -jar /home/pi/codeblockers/spigot-1.12.2.jar nogui We will save the file and make it executable

chmod u+x minecraft.sh Lets start the server screen <---hit enter at the message that appears. sudo /home/pi/startup/minecraft.sh To exit the screen session hit CTRL AD Configure Minecraft to start on bootup We will edit the /etc/rc.local file

sudo nano /etc/rc.local Insert the following before the last line exit 0 screen -dm -S minecraft /home/pi/startup/minecraft.sh After bootup the following can be run sudo screen -r minecraft Creating Backup This will permit restoring the minecraft server

cd ~ tar -zcvf codeblockers_backup.tar.gz codeblockers We can now copy this zip file to a safe location or server. Restoration should be done regularly considering we have to entertain others and their achievements. This is this area which needs technical support in great details.

Thanks!!!