How to setup a trick'd out CraftBukkit server (1.3.1-R2.0)

Discussion in 'Bukkit Help' started by LHammonds, Sep 11, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    LHammonds

    This tutorial will describe how to setup a tricked-out CraftBukkit server.

    It will initially be created on a Windows 7 PC and then moved to an Ubuntu Server where it will remain as a production server running almost completely automated.

    Goals:
    • Done - Install and configure a local CraftBukkit server on Windows
    • Done - Install, configure and test plugins
    • Done - Move CraftBukkit to an Ubuntu Server (Linux)
    • Done - Setup server maintenance scripts
    Donations

    If you have the means and will to donate, please support Mojang 1st by buying a copy of Minecraft if you have not done so already, then to the authors of your favorite plugins. If by then you still want to send some my way, I would be grateful. Here is my link: PayPal for LHammonds

    Prerequisites

    • Minecraft 1.3.1 ($30 USD) (also works with 1.3.2 client)
    • Ubuntu Server 12.04.1 LTS, 64-bit (free)
    • Javaversion 1.7u7 (free)
      • Java 7 for Linux x64 = jre-7u7-linux-x64.bin
      • Java 7 for Windows x86 = jre-7u7-windows-i586.exe
      • Java 7 for Windows x64 = jre-7u7-windows-x64.exe
    • CraftBukkit 1.3.1-R2.0 (free)
    • CraftBukkit plugins (free)
    For CraftBukkit servers, I like to select plugins that do not have any client-side requirements. Simply install on the server and everyone immediately enjoys the new content added to the server.

    I will describe how to 1st setup the server on Windows and then transfer it to Ubuntu, however, all of this can be done starting with Ubuntu but I find it easier starting off with a pre-built installation (since my desktop is Windows)

    Also note that whenever I say "download the latest version" of a plugin, I am talking about the latest one for the specific CraftBukkit (CB) version you are using. If you are using CB 1.3.1, be sure to only get the plugin version that was made for CB 1.3.1. Newer versions of plugins might work but they also might not. Same goes for the other way around. If a plugin was made for an earlier version of CB, it may or may not work with the newer version of CB. But no matter what, always check the server.log for errors and make sure the plugin works in the game before claiming success and trying to install another. Several plugins in this tutorial were made for much older versions of CraftBukkit but through testing, have been verified to still work with newer versions.

    Install a local CraftBukkit server on Windows

    These steps were documented on a Windows 7, 64-bit PC with Java 7 Update 7 (both 64-bit and 32-bit versions)

    1. Download the latest recommended build (version) of CraftBukkit (1.3.1-R2.0 at the time of this writing)
    2. Make a folder on your computer. Example: E:\CraftBukkit
    3. Copy the CraftBukkit jar file into this folder. Example: E:\CraftBukkit\craftbukkit-1.3.1-R2.0.jar
    4. Rename the jar file to "craftbukkit.jar" to keep things simple.
    5. Create a text file called E:\CraftBukkit\startcb.txt and copy the following text into it:

    Show Code for startcb.bat (open)

    Code:
    @ECHO OFF
    SET RAM2USE=2048
    CD /D E:\CraftBukkit
     
    REM ** Look for a version of Java 7 that matches the OS (32-bit for 32-bit, 64-bit for 64-bit) **
    IF EXIST "%ProgramFiles%\Java\jre7\bin\java.exe" GOTO JAVA7DEFAULT
     
    REM ** Look for 32-bit version of Java 7 on 64-bit OS **
    IF EXIST "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" GOTO JAVA732BIT
     
    REM ** Look for a version of Java 6 that matches the OS (32-bit for 32-bit, 64-bit for 64-bit) **
    IF EXIST "%ProgramFiles%\Java\jre6\bin\java.exe" GOTO JAVA6DEFAULT
     
    REM ** Look for 32-bit version of Java 6 on 64-bit OS **
    IF EXIST "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" GOTO JAVA632BIT
     
    :JAVA7DEFAULT
    REM ** This will execute if run on a 32-bit OS with a 32-bit version of Java 7 **
    REM ** This will execute if run on a 64-bit OS with a 64-bit version of Java 7 **
    "%ProgramFiles%\Java\jre7\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
    GOTO DONE
     
    :JAVA732BIT
    REM ** This will execute if run on a 64-bit OS with only a 32-bit version of Java 7 **
    "%ProgramFiles(x86)%\Java\jre7\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
    GOTO DONE
     
    :JAVA6DEFAULT
    REM ** This will execute if run on a 32-bit OS with a 32-bit version of Java 6 **
    REM ** This will execute if run on a 64-bit OS with a 64-bit version of Java 6 **
    "%ProgramFiles%\Java\jre6\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
    GOTO DONE
     
    :JAVA632BIT
    REM ** This will execute if run on a 64-bit OS with only a 32-bit version of Java 6 **
    "%ProgramFiles(x86)%\Java\jre6\bin\java.exe" -Xmx%RAM2USE%M -Xms%RAM2USE%M -jar craftbukkit.jar
    GOTO DONE
     
    :DONE
    REM ** This will pause the screen so you can see any error messages after stopping the CraftBukkit server. **
    PAUSE

    NOTE #1: You might need to adjust the amount of memory used on the 2nd line (1024 = 1 GB RAM minimum).
    NOTE #2: You might need to adjust the server folder on the 3rd line to reflect your system. For this example, I have it installed on drive E:
    NOTE #3: This batch script will choose the newer Java installed as well as picking the 64-bit version if present.

    6. Save and close the text file. Rename the file to "startcb.bat" (you might need to disable hidden filename extensions to make this work)
    7. Double-click "startcb.bat" and if things go well, CraftBukkit will start in black DOS window and go through the initial startup and generate the initial files and sub-folders. Depending on your security, you may need to give permission to let the processes run (e.g. Comodo will ask about 4 questions before letting it run)
    8. Once the server has finished loading, type "stop" at the server console to gracefully stop CraftBukkit. Get used to what it normally says when shutting down properly...it can be handy to know. Then press any key to close the window (this is that "pause" command at the end of the script)

    Configure the CraftBukkit Server

    At this point, we now have a default CraftBukkit server. Let's configure some of the basic settings. (Make sure the server is not running)

    Use a text editor to edit Server.Properties

    Notice the following line:

    Code:
    server-port=25565
    This is the default port the server will use to communicate to Minecraft clients. Make sure your firewall will allow traffic on this port.

    If you change this port to anything else, your Minecraft clients will need to add the port as part of the server IP when defining your server. Example: If you change it to 25500 and your IP is 192.168.1.100, your other PCs will need to add 192.168.1.100:25500 as the server address.

    If you plan to host this server on a private network which does not have or want Internet access, you need to change the following line from true to false:

    Code:
    online-mode=true
    The above is great for LAN parties and homes where young kids can play on local servers without being exposed to the big bad Internet...however, if you plan to run a public Internet server, it is a bad idea to by-pass the login authentication for many reasons.

    If you know how many people will be connecting to the server, be sure to set that amount on the following line (typically, it is a good idea to set it one higher than your expected maximum)

    Code:
    max-players=20
    It is also a good idea to set a good description for your server by using the following line:

    Code:
    motd=A Minecraft Server
    I have mine set to the following:

    Code:
    motd=CraftBukkit 1.3.1 R2.0 Build 2340
    Save and close Server.Properties

    Double-Click startcb.bat to start the CraftBukkit server with your new settings.

    Once it loads up, give yourself admin rights on the server by typing op YourMinecraftName at the server console. This adds your name to the following file: E:\CraftBukkit\ops.txt

    Start your Minecraft client and click Multiplayer from the main screen. Click the "Add server" button. Give the server a name and type in the IP address of the server (if on your PC, simply use "localhost" or something like "localhost:25500" if using a custom port number and then click Done.

    If the client sees the server, you should see your server with your custom description (e.g. CraftBukkit 1.3.1 R2.0 Build 2340) as well as the amount of currently logged in players and maximum amount of players (e.g. 0/20).

    If you get connected, see if you can survive the 1st night. :D Disconnect when you are satisfied that it works good enough.
     
  2. Offline

    Necrodoom

    how is this a "tricked out" server? i dont get the point of this. mainly looks like extremely lengthy preset server pack.
     
  3. Offline

    LHammonds

    Then please go away. Its not for you.
     
  4. Offline

    Necrodoom

    how nice.

    im talking about the plugin part, not the configuring of bukkit it self.
     
  5. Offline

    SnowGears

    I like it. Keep up the good work!
     
  6. Offline

    LHammonds

    Still working out the details. I keep re-writing the automation scripts. I also found out a way to avoid needing a "shutdown" mod for the server, commands can be sent straight to the console via crontab!
     
  7. Offline

    LHammonds

    If you are eager for the work-in-progress version of this thread, take a look at my forums for a sneak peek...however, it is still a bit rough around the edges. It takes time to iron out documentation of this size. ;-) Just thought I'd pop this out there in case I don't make it through surgery today. hehehe.
     
  8. Offline

    LHammonds

    Ubuntu Server Installation

    High-level overview

    This section will cover installation of a dedicated Ubuntu server. The server will be installed inside a virtual machine vSphere 4.1 running on ESXi 4.1 servers. Notes will also be supplied for doing the same thing for Oracle's VirtualBox on a Windows 7 PC. Although there are some VMware-specific and VirtualBox-specific steps, they are very few and the majority of this documentation will work for other Virtual Machines or even directly installed onto a physical machine (e.g. bare-metal install).

    Custom scripts will also be covered to help automate tasks such as backing up, rebooting and starting CraftBukkit.

    This is considered an advanced installation, however, it is written click-for-click so that someone relatively new to Linux would be able to follow.

    If you are not looking to setup the server for long-term use or just wanting to test it out, you could just install with the defaults and select "Guided - use entire disk" when asked about partitions and then place a checkmark beside "OpenSSH Server" and skip my notes on installing the server and jump straight down to the configuration section and installing Java/CraftBukkit.

    Tools utilized in this process

    Assumptions

    This documentation will need to make use of some very-specific information that will most-likely be different for each person / location. This variable data will be noted in this section and highlighted in red throughout the document as a reminder that you should plug-in your own value rather than actually using these "place-holder" values.

    Under no circumstance should you use the actual values listed below. They are place-holders for the real thing. This is just a checklist template you need to have answered before you start the install process.

    Wherever you see RED in this document, you need to substitute it for what you will be using.

    • Ubuntu Server name: srv-mc
    • Ubuntu Server IP address: 192.168.107.2
    • Ubuntu Server IP subnet mask: 255.255.255.0
    • Ubuntu Server IP gateway: 192.168.107.1
    • Internal DNS Server 1: 192.168.107.212 (you might not have one)
    • Internal DNS Server 2: 192.168.107.213 (you might not have one)
    • External DNS Server 1: 8.8.8.4 (check with your provider for your DNS server)
    • External DNS Server 2: 8.8.8.5 (check with your provider for your DNS server)
    • Ubuntu Admin ID: administrator
    • Ubuntu Admin Password: myadminpass
    • CraftBukkit ID: craftbukkit
    • CraftBukkit Password: mycbpass
    • Gmail Account: [email protected]
    • GMail Password: mygmailpass
    It is also assumed that the reader knows how to use the VI editor. If not, you will need to beef up your skill set or use a different editor in place of it such as nano.
     
  9. Offline

    KoolKrafter

    This is actually a really good guide for newcomers.
     
  10. Offline

    Jade

    Locked necro.
     
Thread Status:
Not open for further replies.

Share This Page