Server Setup (Linux, Oracle Cloud): Difference between revisions

m
add bit more detail
m (revision date.)
m (add bit more detail)
 
(3 intermediate revisions by 3 users not shown)
Line 4:
* '''Latest Revision:''' February 2023, GTNH version 2.2.3.
 
Oracle Cloud is an attractive option as it offers a lot of space and processing power for no monthly fee. There are limitations; see [[#Warnings|Warnings]], below. The general overview for a Linux server is getto asecure serverhosting. Get SSH access to the server. Set up an instance. Download the [[Server_Setup#Server_Files|server files]] and Java 17+. Unzip the server pack and run ''startserver.sh''. The instructions below are specific for Oracle Cloud but may help with generic Linux installs.
</div>
 
Line 14:
</div>
 
=== IntroductioIntroduction n===
<div align="justify">
This Linux setup uses an Oracle [https://blogs.oracle.com/developers/post/how-to-set-up-and-run-a-really-powerful-free-minecraft-server-in-the-cloud blogpost] about how to set up a server on their platform.
Line 35:
</div>
 
=== Set upUp an instanceInstance ===
==== Create an instanceInstance ====
<div align="justify">
This step is taken from the Oracle's [https://blogs.oracle.com/developers/post/how-to-set-up-and-run-a-really-powerful-free-minecraft-server-in-the-cloud manual], so check it out if you need more info. A concise version of it is given in this guide.
Line 67:
</div>
 
==== Set upUp Network networkRules rules====
<div align="justify">
When your Instance Details turns green and Running, click on the Subnet link in the Primary VNIC section. Then in Security Lists click on the only one that is there, the default one, then click on Add Ingress Rules.
Line 82:
</div>
 
==== Tweak the instanceInstance ====
<div align="justify">
In order to connect to the instance, you need a "shell" program. If you're on Windows, this guide suggests to install [https://git-scm.com/downloads Git Bash] for that.
Line 135:
</div>
 
=== Set up a GTNH serverServer ===
<div align="justify">
1. Download the server zip from here: http://downloads.gtnewhorizons.com/ServerPacks/
Line 191:
===Install a mod for backups===
<div align="justify">
The recommended mod for backups is server utilities.
Two mods are needed to back up your server: FTB-Utilities and FTB-Library.
*FTB-UtilitiesThe download is located here: https://github.com/GTNewHorizons/FTB-UtilitiesServerUtilities/releases/latest/
*FTB-Library is located here: https://github.com/GTNewHorizons/FTB-Library/releases/latest
 
Below is an example of how the process can go. Check if it's the most recent version of the mods before proceeding.
Line 201 ⟶ 200:
Below are the examples of both ways. Please use the <code>scp</code> option only if the <code>wget</code> one fails:
 
* Using <code>wget</code> (you can get the link by right-clicking on correct jar and choosing "Copy link adress" ): <syntaxhighlight lang="shell">
cd server_directory/mods
wget $(curl -s https://api.github.com/repos/GTNewHorizons/FTB-UtilitiesServerUtilities/releases/latest | grep browser_download_url | tail download/2.0.11/ServerUtilities-n 1 | cut -d '"' -f 4)2.0.11.jar
wget $(curl -s https://api.github.com/repos/GTNewHorizons/FTB-Library/releases/latest | grep browser_download_url | tail -n 1 | cut -d '"' -f 4)
</syntaxhighlight>
 
* Using <code>scp</code> : <syntaxhighlight lang="shell">
scp -i path_to_private_SSH_key path_to_FTBUtilities_on_your_computerpath_to_ServerUtils_on_your_computer opc@instance_ip:server_folder/mods/FTBUtilities_full_nameServerUtilities_full_name.jar
scp -i path_to_private_SSH_key path_to_FTBLib_on_your_computer opc@instance_ip:server_folder/mods/FTBLib_full_name.jar
</syntaxhighlight>
 
Line 215 ⟶ 212:
 
<syntaxhighlight lang="output">
scp -i ~/.ssh/ssh-key-2022-09-07.key ~/Downloads/FTBUtilitiesServerUtilities-1.7.10-12.0.18.7-GTNH11.jar opc@144.24.170.228:~/minecraft-server/mods/FTBUtilitiesServerUtilities-1.7.10-12.0.18.7-GTNH11.jar
 
scp -i ~/.ssh/ssh-key-2022-09-07.key ~/Downloads/FTBLib-1.7.10-1.0.18.5-GTNH.jar opc@144.24.170.228:~/minecraft-server/mods/FTBLib-1.7.10-1.0.18.5-GTNH.jar
</syntaxhighlight>
* scp is the command that stands for "secure copy",
*-i is the flag that says to use the file to identify youself, like we did with ssh,
*~/.ssh/ssh-key-2022-09-07.key is the example of the path to the key, ~ is the shortcut for you user folder,
*~/Downloads/FTBLibServerUtilities-{version}.jar is the location of the mod jar on your computer,
*opc@144.24.170.228:~/minecraft-server/mods/FTBLibServerUtilities-{Minecraft version}-{version}-GTNH.jar is the location of the resulting file on the server.
 
Now you can launch your server again to check if the backup works.
Line 228 ⟶ 225:
A backup should be visible in the log immediately after the server is done loading.
 
The default frequency of the backups is once every two hours. To make the backups more frequent, open the config file that is created after the server is launched for the first time with the backup mods. The following steps use <code>vim</code> as the default text editor to edit <code>config.json</code> , you may use other text editor such as <code>nano</code> . A more detailed description of config can be found at [[ServerUtilities]].
 
<syntaxhighlight lang="bash">
cd your_instance/serverutilities/
cd server_folder/local/ftbu
vim configserverutilities.jsoncfg
</syntaxhighlight>
 
Line 240 ⟶ 237:
#<code>backup_timer</code> default is 2.0, If you want to make a backup every 30 minutes, change the value from 2.0 to 0.5.
#<code>backups_to_keep</code> Change to keep more backups. When the number reaches the specified maximum, the oldest backup is deleted.
# <code>Folderbackup_folder_path</code> specify the path of the backups. The default works too.
#To exit vim and save the changes, press <code>:</code> then type <code>wq</code> and press <code>ENTER</code> , wq which means Write and Quit.
#If you get an error on writing changes into the file, check the file permissions. Although if the error is about that you can't write into the file and that's your default user, that likely means that you launched the server as root before, which can lead to many complications later, so please don't launch a server as root.
Line 257 ⟶ 254:
 
To start a backup manually, send the following command when you're on the server: <syntaxhighlight lang="text">
/admin backup start
</syntaxhighlight>
 
Line 265 ⟶ 262:
===Run the server===
<div align="justify">
So, you can launch the server, but when you leave the ssh connection, the server closes. That happens because together your ssh connection keeps things running.
 
To make the server run without you being connected to the ssh, one of the solutions is to use the "screen" command.
Line 293 ⟶ 290:
There are more options that you can use with this command, such as multiple named screens. You can check [https://linuxize.com/post/how-to-use-linux-screen/ this] manual for the instructions. or run the command <code>man screen</code>.
</div>
 
===Improvements===
====More space====
12

edits