OS X Minecraft server setup: Difference between revisions

From munkjensen.net/wiki
mNo edit summary
 
(32 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Preface. ==
__NOTOC__== Preface. ==
 
<blockquote>
This page will describe how i run my Minecraft servers.
This page will describe how i run my Minecraft servers. All scripts i use will soon be available at my [https://bitbucket.org/fmjensen/yams BitBucket repo]. I just need to finish up the last few details before releasing my first version ;-)


Some of my inspiration was found at [http://www.electricmonk.nl/log/2011/07/22/minecraft-server-optimization/ electricmonk.nl] and [http://minecraft.gamepedia.com/Tutorials/Create_a_Mac_OS_X_startup_daemon minecraft.gamepedia.com].
</blockquote>
== The guide to YAMS. ==
== The guide to YAMS. ==
<blockquote>
<blockquote>
=== Install [http://www.macports.org Macports]. ===
=== User with limited privileges. ===
 
<div class="toccolours mw-collapsible mw-collapsed">
This way of creating a new user for your Minecraft Server IS complicated... but necessary if you want to run your Minecraft Server as secure as possible.<br />
<strike>The login to GUI, makes it possible to run scheduled tasks using OS X launchd / launchctl</strike> <-- bug ??
<div class="mw-collapsible-content">
# Follow the guide here [http://minecraft.gamepedia.com/Tutorials/Create_a_Mac_OS_X_startup_daemon#The_hard_.28and_correct.29_way like this], until you reach <code>"append Groups/_minecraft GroupMembership _minecraft"</code>
# Execute the dscl command <code>&nbsp;passwd /Users/_minecraft "YourTemporaryPassword"</code>
# Continue following the guide, but ONLY until you reach "''You might want something like this to prevent the user from showing up in the login dropdown:''".
# Log out of OS X
# Log in as "_minecraft", using "YourTemporaryPassword" from step 2. Skip everything related to the first userlogin on the GUI.
# Log out.
# Log in as your normal user.
# Continue the user creation from "You might want something like this to prevent the user from showing up in the login dropdown:"
# STOP completely when you reach "Creating the user home". The rest is covered here after :-)


Installation is neatly described at the [http://www.macports.org/install.php Macports install] page.


=== Install [http://tmux.github.io tmux]. ===
Finish up by deleting the following obsolete files and folders.


Use macPorts for the install process. It can be done like this at the time of writing they page.
# <code>cd ../_minecraft/</code >
* <code>&nbsp;sudo port install tmux&nbsp;</code>
# <code>sudo rm -R Desktop Documents Downloads Movies Music Pictures</code ></div>
* type in your password, and you should get something similar to this:
</div>
<blockquote><pre>Password:
 
---> Computing dependencies for tmux
=== YAMS... ===
--->  Dependencies to be installed: libevent
 
--->  Fetching archive for libevent
{| class="mw-collapsible mw-collapsed wikitable"
--->  Attempting to fetch libevent-2.0.22_1.darwin_15.x86_64.tbz2 from http://lil.fr.packages.macports.org/libevent
! Action || Terminal command
--->  Attempting to fetch libevent-2.0.22_1.darwin_15.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/libevent
|-
---> Attempting to fetch libevent-2.0.22_1.darwin_15.x86_64.tbz2 from http://nue.de.packages.macports.org/macports/packages/libevent
| Change to the new user : || <code> sudo su - _minecraft </code>
---> Fetching distfiles for libevent
|-
---> Attempting to fetch libevent-2.0.22-stable.tar.gz from http://skylink.dl.sourceforge.net/levent/libevent/libevent-2.0
| Download the sourcecode like this : || <code>curl -kLOs <nowiki>https://bitbucket.org/fmjensen/yams</nowiki></code>
---> Verifying checksums for libevent                                             
|-
---> Extracting libevent
| unzip the scripts : || <code>unzip yams-<version>.zip</code>
--->  Applying patches to libevent
|-
---> Configuring libevent
| Change to the directory containing the scripts : || <code>cd yams-<version></code>
---> Building libevent
|-
---> Staging libevent into destroot
| "Update" your server || <code>./admin_update_server</code>
---> Installing libevent @2.0.22_1
|-
--->  Activating libevent @2.0.22_1
| READ the output from the script you just ran, || and ACT upon the information ;-)
---> Cleaning libevent
|}
---> Fetching archive for tmux
---> Attempting to fetch tmux-2.1_0.darwin_15.x86_64.tbz2 from http://lil.fr.packages.macports.org/tmux
--->  Attempting to fetch tmux-2.1_0.darwin_15.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/tmux
--->  Attempting to fetch tmux-2.1_0.darwin_15.x86_64.tbz2 from http://nue.de.packages.macports.org/macports/packages/tmux
---> Fetching distfiles for tmux
---> Attempting to fetch tmux-2.1.tar.gz from http://lil.fr.distfiles.macports.org/tmux
---> Verifying checksums for tmux
--->  Extracting tmux
---> Configuring tmux
--->  Building tmux
--->  Staging tmux into destroot
--->  Installing tmux @2.1_0
--->  Activating tmux @2.1_0


If you want integration with system pasteboard consider installing port tmux-pasteboard as well


--->  Cleaning tmux
--->  Updating database of binaries
--->  Scanning binaries for linking errors             
--->  No broken files found.</pre>
</blockquote>
</blockquote>


=== User with limited privileges. ===
== About the YAMS scripts and files. ==
<blockquote>
<div class="toccolours mw-collapsible mw-collapsed">
This part contains a description of all files in the zip file you downloaded.
<div class="mw-collapsible-content">
=== admin_accept_eula ===
 
This script
 
=== admin_chk_version ===
 
This script
 
=== admin_ejectramdisk ===
 
This script
 
=== admin_launch_on_ramdisk ===
 
This script
 
=== admin_quit_read_command-fifo ===
 
This script
 
=== admin_read_command-fifo ===
 
This script
 
=== admin_stop_on_ramdisk ===
 
This script will stop the server gracefully if the following conditions are met:
 
* Server is running on RAM disk
 
=== admin_update_server ===
 
This script can update the server if the following requirements are met:
 
* Server must not be running.
* RAM disk must be ejected. See admin_eject_ramdisk
 
=== admin_wipe_everything ===
 
This script
 
=== backup_exclude_list
 
This file
 
=== backup_ramdisk ===
 
This script
 
=== cmd_list ===
 
This script
 
=== cmd_raw ===
 
This script
 
=== cmd_say ===
 
This script


# Do it [http://minecraft.gamepedia.com/Tutorials/Create_a_Mac_OS_X_startup_daemon#The_hard_.28and_correct.29_way like this], but After <code>"append Groups/_minecraft GroupMembership _minecraft" </code> <br />execute the ddcl command <code>&nbsp;passed /Users/_minecraft "YourTemporaryPassword"</code>
=== cmd_showhelp ===
# Exit dscl
# Stop following the guide when you get to "''You might want something like this to prevent the user from showing up in the login dropdown:''".
# Log out of OS X
# Log in as "_minecraft". Skip everything related to the first userlogin on the GUI.
# Log out.
# Log in as your normal user.
# Continue the user creation from "You might want something like this to prevent the user from showing up in the login dropdown:"
# STOP completely when you reach "Creating the user home". The rest is covered here after :-)


cd ../_minecraft/
This script
sudo rm -R Desktop Documents Downloads Movies Music Pictures


=== BitBucket scripts for running a Minecraft server. ===
=== cmd_whitelist-add ===


# Change to the new user : <code> sudo su - _minecraft </code>
This script
TBD


https://[email protected]/fmjensen/vanilla-minecraft.git
=== cmd_whitelist-delete ===


=== About the server update script. ===
This script  


This script can update the server, IF it is not running... and since you have not downloaded any jar-files yet, i don't think it is running ;-)
=== cmd_whitelist-list ===


You will need to manually obtain the following files:
This script
* bin/blah... (link to file)
* eula.txt must contain three lines like:
<blockquote><pre>By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).
#Fri Apr 1 12:12:12 UTC 2015
eula=true</pre></blockquote>


# Make sure you are logged in as the ''_minecraft'' user, and you are in the correct folder.
=== cmd_xp2player ===


TBD
This script


=== Edit configuration files. ===
=== net.minecraft.ramdisk.server.backup


XXX
This file


=== Test if the server behaves and works as expected.. ===
=== server-icon.png


# Change to the new user
This file
TBD


=== XXX. ===
=== server.properties


XXX
This file
</div>
</div>
</blockquote>
</blockquote>
== Personalize your server. ==
TBD


[[Category:Apple]]
[[Category:Apple]]
[[Category:Minecraft]]
[[Category:Minecraft]]

Latest revision as of 12:53, 8 November 2015

Preface.

This page will describe how i run my Minecraft servers. All scripts i use will soon be available at my BitBucket repo. I just need to finish up the last few details before releasing my first version ;-)

Some of my inspiration was found at electricmonk.nl and minecraft.gamepedia.com.

The guide to YAMS.

User with limited privileges.

This way of creating a new user for your Minecraft Server IS complicated... but necessary if you want to run your Minecraft Server as secure as possible.
The login to GUI, makes it possible to run scheduled tasks using OS X launchd / launchctl <-- bug ??

  1. Follow the guide here like this, until you reach "append Groups/_minecraft GroupMembership _minecraft"
  2. Execute the dscl command  passwd /Users/_minecraft "YourTemporaryPassword"
  3. Continue following the guide, but ONLY until you reach "You might want something like this to prevent the user from showing up in the login dropdown:".
  4. Log out of OS X
  5. Log in as "_minecraft", using "YourTemporaryPassword" from step 2. Skip everything related to the first userlogin on the GUI.
  6. Log out.
  7. Log in as your normal user.
  8. Continue the user creation from "You might want something like this to prevent the user from showing up in the login dropdown:"
  9. STOP completely when you reach "Creating the user home". The rest is covered here after :-)


Finish up by deleting the following obsolete files and folders.

  1. cd ../_minecraft/
  2. sudo rm -R Desktop Documents Downloads Movies Music Pictures

YAMS...

Action Terminal command
Change to the new user : sudo su - _minecraft
Download the sourcecode like this : curl -kLOs https://bitbucket.org/fmjensen/yams
unzip the scripts : unzip yams-<version>.zip
Change to the directory containing the scripts : cd yams-<version>
"Update" your server : ./admin_update_server
READ the output from the script you just ran, and ACT upon the information ;-)


About the YAMS scripts and files.

This part contains a description of all files in the zip file you downloaded.

admin_accept_eula

This script

admin_chk_version

This script

admin_ejectramdisk

This script

admin_launch_on_ramdisk

This script

admin_quit_read_command-fifo

This script

admin_read_command-fifo

This script

admin_stop_on_ramdisk

This script will stop the server gracefully if the following conditions are met:

  • Server is running on RAM disk

admin_update_server

This script can update the server if the following requirements are met:

  • Server must not be running.
  • RAM disk must be ejected. See admin_eject_ramdisk

admin_wipe_everything

This script

=== backup_exclude_list

This file

backup_ramdisk

This script

cmd_list

This script

cmd_raw

This script

cmd_say

This script

cmd_showhelp

This script

cmd_whitelist-add

This script

cmd_whitelist-delete

This script

cmd_whitelist-list

This script

cmd_xp2player

This script

=== net.minecraft.ramdisk.server.backup

This file

=== server-icon.png

This file

=== server.properties

This file

Personalize your server.

TBD