Build an original Minecraft server in centos 7
Build the original Minecraft server on centos 7 and directly go to the topic:
① Install jdk-1.8.0
[Plain] view plaincopy
- Yuminstall-yjava-1.8.0 *
② Create the mc directory
[Plain] view plaincopy
- Mkdir/tmp/minecraft
③ Download the compressed package (minecraft_server.1.7.10.jar) and library file (libraries) of the mc server, and move it to the/tmp/minecraft directory.
④ Run the following command to start the server
[Html] view plaincopy
- Java-Xmx2048M-Xms1024M-jarminecraft_server.jarnogui //-Xms for minimum memory usage,-Xmx for maximum memory usage, nogui for command line enabling
⑤ Failed to load eula.txt during the first running
[Plain] view plaincopy
- [16:36:36] [Serverthread/INFO]: Loadingproperties
- [16:36:36] [Serverthread/WARN]: server. propertiesdoesnotexist
- [16:36:36] [Serverthread/INFO]: Generatingnewpropertiesfile
- [16:36:36] [Serverthread/WARN]: Failedtoloadeula.txt
- [16:36:36] [Serverthread/INFO]: YouneedtoagreetotheEULAinordertoruntheserver.Gotoeula.txt formoreinfo.
Modify eula.txt, server. properties
[Html] view plaincopy
- Eula.txt
- Eula = false
- Change to eula = true
[Plain] view plaincopy
- Server. properties
- Online-mode = true
- Change to online-mode = false // other options can be modified as per your preference
7. Disable SELinux and firewalld (too easy to set, close directly)
[Plain] view plaincopy
- Vi/etc/selinux/config
- SELINUX = enforcing
- Change
- SELINUX = disabled
[Plain] view plaincopy
- Systemctldisablefirewalld
- Systemctlstopfirewalld
The supervisor can start the server by running the command again (you don't need to open a long string of commands every time you write the running script ).
Java-Xmx2048M-Xms1024M-jar minecraft_server.jar nogui