Forums

andy
andy
Offline
Resolved
0 votes
hello all,

I've just recently started playing with ClearOS on an old gaming rig i had no use for anymore. I must say, this OS is comprable to some of the highend boxes i do support for at work, and those cost....A LOT more than this.

My room mate got me playing this game called minecraft which is a very basic indi game but...addicting in it's own right, great for passing the time at work.

I'm not that familiar with the linux text based system so i'm not really sure how i would start running the .jar file...or how to really even get it onto the server in general.

could someone help me out with a step by step to try and run this?

Thanks,
Bainer
Monday, November 22 2010, 05:53 PM
Share this post:
Responses (43)
  • Accepted Answer

    andy
    andy
    Offline
    Monday, October 03 2011, 11:08 AM - #Permalink
    Resolved
    0 votes
    i just used the start script on the MC wiki. I've switched over to running MineOS Crux since it makes it extremely easy to administer multiple servers right from a webpage.
    The reply is currently minimized Show
  • Accepted Answer

    Chris H
    Chris H
    Offline
    Sunday, October 02 2011, 07:37 PM - #Permalink
    Resolved
    0 votes
    In case anyone else wants to auto start a minecraft server... this placed in rc.local started server at boot.

    # Starting Minecraft Server
    echo "Starting Minecraft Server"
    cd /home/minecraft ;
    sudo -u minecraft /home/minecraft/launch.sh start


    This is the start script that the above runs.

    #!/bin/sh
    echo "Starting Minecraft server..."
    echo "Use screen -x minecraft-beta to view the console. Ctrl-A-D to detatch"
    sleep 1
    screen -A -m -d -U -S minecraft-beta java -Xmx1024M -Xms1024M -jar craftbukkit-0.0.1.jar nogui
    The reply is currently minimized Show
  • Accepted Answer

    Chris H
    Chris H
    Offline
    Sunday, October 02 2011, 03:35 AM - #Permalink
    Resolved
    0 votes
    Put this in my init.d and it works to start the server.
    EDIT: Did not auto start upon reboot. From console service minecraft starts the server though. Anyone have any help?

    #!/bin/bash
    # /etc/init.d/minecraft
    # version 0.3.5 2011-09-20 (YYYY-MM-DD)

    ### BEGIN INIT INFO
    # Provides: minecraft
    # Required-Start: $local_fs $remote_fs
    # Required-Stop: $local_fs $remote_fs
    # Should-Start: $network
    # Should-Stop: $network
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: Minecraft server
    # Description: Starts the minecraft server
    ### END INIT INFO

    #Settings
    SERVICE='craftbukkit-0.0.1.jar'
    OPTIONS='nogui'
    USERNAME='minecraft'
    WORLD='world'
    MCPATH='/home/minecraft'
    BACKUPPATH='/minecraft'
    CPU_COUNT=1
    INVOCATION="screen -A -m -d -U -S minecraft-beta java -Xmx1024M -Xms1024M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:ParallelGCThreads=$CPU_COUNT -XX:+AggressiveOpts -jar $SERVICE $OPTIONS"

    ME=`whoami`
    as_user() {
    if [ $ME == $USERNAME ] ; then
    bash -c "$1"
    else
    su - $USERNAME -c "$1"
    fi
    }

    mc_start() {
    if pgrep -u $USERNAME -f $SERVICE > /dev/null
    then
    echo "$SERVICE is already running!"
    else
    echo "Starting $SERVICE..."
    cd $MCPATH
    as_user "cd $MCPATH && screen -dmS minecraft $INVOCATION"
    sleep 7
    if pgrep -u $USERNAME -f $SERVICE > /dev/null
    then
    echo "$SERVICE is now running."
    else
    echo "Error! Could not start $SERVICE!"
    fi
    fi
    }

    mc_saveoff() {
    if pgrep -u $USERNAME -f $SERVICE > /dev/null
    then
    echo "$SERVICE is running... suspending saves"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER BACKUP STARTING. Server going readonly...\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-off\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
    sync
    sleep 10
    else
    echo "$SERVICE is not running. Not suspending saves."
    fi
    }

    mc_saveon() {
    if pgrep -u $USERNAME -f $SERVICE > /dev/null
    then
    echo "$SERVICE is running... re-enabling saves"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-on\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER BACKUP ENDED. Server going read-write...\"\015'"
    else
    echo "$SERVICE is not running. Not resuming saves."
    fi
    }

    mc_stop() {
    if pgrep -u $USERNAME -f $SERVICE > /dev/null
    then
    echo "Stopping $SERVICE"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER SHUTTING DOWN IN 10 SECONDS. Saving map...\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
    sleep 10
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"stop\"\015'"
    sleep 7
    else
    echo "$SERVICE was not running."
    fi
    if pgrep -u $USERNAME -f $SERVICE > /dev/null
    then
    echo "Error! $SERVICE could not be stopped."
    else
    echo "$SERVICE is stopped."
    fi
    }

    mc_update() {
    if pgrep -u $USERNAME -f $SERVICE > /dev/null
    then
    echo "$SERVICE is running! Will not start update."
    else
    MC_SERVER_URL=http://www.minecraft.net/download/minecraft_server.jar?v=`date | sed "s/[^a-zA-Z0-9]/_/g"`
    as_user "cd $MCPATH && wget -q -O $MCPATH/minecraft_server.jar.update $MC_SERVER_URL"
    if [ -f $MCPATH/minecraft_server.jar.update ]
    then
    if `diff $MCPATH/$SERVICE $MCPATH/minecraft_server.jar.update >/dev/null`
    then
    echo "You are already running the latest version of $SERVICE."
    else
    as_user "mv $MCPATH/minecraft_server.jar.update $MCPATH/$SERVICE"
    echo "Minecraft successfully updated."
    fi
    else
    echo "Minecraft update could not be downloaded."
    fi
    fi
    }

    mc_backup() {
    echo "Backing up minecraft world..."
    if [ -d $BACKUPPATH/${WORLD}_`date "+%Y.%m.%d_%H.%M"` ]
    then
    for i in 1 2 3 4 5 6
    do
    if [ -d $BACKUPPATH/${WORLD}_`date "+%Y.%m.%d_%H.%M"`-$i ]
    then
    continue
    else
    as_user "cd $MCPATH && cp -r $WORLD $BACKUPPATH/${WORLD}_`date "+%Y.%m.%d_%H.%M"`-$i"
    break
    fi
    done
    else
    as_user "cd $MCPATH && cp -r $WORLD $BACKUPPATH/${WORLD}_`date "+%Y.%m.%d_%H.%M"`"
    echo "Backed up world"
    fi
    echo "Backing up $SERVICE"
    if [ -f "$BACKUPPATH/minecraft_server_`date "+%Y.%m.%d_%H.%M"`.jar" ]
    then
    for i in 1 2 3 4 5 6
    do
    if [ -f "$BACKUPPATH/minecraft_server_`date "+%Y.%m.%d_%H.%M"`-$i.jar" ]
    then
    continue
    else
    as_user "cd $MCPATH && cp $SERVICE \"$BACKUPPATH/minecraft_server_`date "+%Y.%m.%d_%H.%M"`-$i.jar\""
    break
    fi
    done
    else
    as_user "cd $MCPATH && cp $SERVICE \"$BACKUPPATH/minecraft_server_`date "+%Y.%m.%d_%H.%M"`.jar\""
    fi
    echo "Backup complete"
    }

    mc_command() {
    if [ "$1" ]
    then
    command="$1";
    if pgrep -u $USERNAME -f $SERVICE > /dev/null
    then
    echo "$SERVICE is running... executing command"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"$command\"\015'"
    fi
    else
    echo "Must specify server command"
    fi
    }

    #Start-Stop here
    case "$1" in
    start)
    mc_start
    ;;
    stop)
    mc_stop
    ;;
    restart)
    mc_stop
    mc_start
    ;;
    update)
    mc_stop
    mc_backup
    mc_update
    mc_start
    ;;
    backup)
    mc_saveoff
    mc_backup
    mc_saveon
    ;;
    status)
    if pgrep -u $USERNAME -f $SERVICE > /dev/null
    then
    echo "$SERVICE is running."
    else
    echo "$SERVICE is not running."
    fi
    ;;
    command)
    mc_command "$2"
    ;;

    *)
    echo "Usage: /etc/init.d/minecraft {start|stop|update|backup|status|restart|command \"server command\"}"
    exit 1
    ;;
    esac



    This is in /var/webconfig/api. It shows the service in webconfig but does not show the correct status.(always off) Any idea why?

    "minecraft"     => array("minecraft",         "minecraft",     "no",  "Minecraft Server",        "no",  null),
    The reply is currently minimized Show
  • Accepted Answer

    Chris H
    Chris H
    Offline
    Tuesday, September 06 2011, 04:19 AM - #Permalink
    Resolved
    0 votes
    I have a minecraft server running on my clearOS box and it works well. Has anybody ever got the minecraft server to auto start as a service on boot? I tried once and wound up with minecraft borked and unable to start.
    The reply is currently minimized Show
  • Accepted Answer

    Eli
    Eli
    Offline
    Sunday, March 13 2011, 01:50 AM - #Permalink
    Resolved
    0 votes
    As it did do the trick.. thanks for everyones help.. I will be sure to use the whitelist and make backups from time to time of the minecraft server.. I might just have to get into this game. LoL

    Anyway, thanks for all your help again.. and i'm sure this won't be the last time you guys hear from me
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, March 13 2011, 12:00 AM - #Permalink
    Resolved
    0 votes
    Opening 25565 should do the trick yes ;)

    Speaking of good practice, make sure to use the whitelist function on the minecraft server.
    Unwanted visitors can easily ruin an unprotected server
    The reply is currently minimized Show
  • Accepted Answer

    Eli
    Eli
    Offline
    Saturday, March 12 2011, 02:16 PM - #Permalink
    Resolved
    0 votes
    Andy, I understand not to have root running this, yeah that would be a very big no no.. I still may not know a lot about Linux, but yes I do enough not to make it run as root... Thank you for the warning though.

    I'm still not quite sure if it is available to them yet or not, I am hoping they will be able to connect, I made firewall exceptions to allow minecrafts port to go through, so I don't see any reason why they shouldn't... our ISP doesn't block any ports from coming in. Hopefully I will know today if they can get in or not.. I'll throw up another post when I know something..

    Thanks!
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Saturday, March 12 2011, 09:30 AM - #Permalink
    Resolved
    0 votes
    Eli, you don't want to be running this on your ROOT user, big no no for security, just create yourself a new user on your clear server and save/run your MC server on that user.

    remember root is the be all end all of your server so you don't want people connecting to something running in that user (especially if you plan on making the server available to your brother's buddies which would mean they need your DynDNS IP)
    The reply is currently minimized Show
  • Accepted Answer

    Friday, March 11 2011, 05:17 PM - #Permalink
    Resolved
    0 votes
    np ;)


    Just a sidenote, you may want to take frequent backups of your minecraft server.. The HDD in my gateway/webserver/mcserver stopped working after a power outage today, and I were navive enough to have most of the backups on the same hdd..
    Oh well, lesson learned!
    The reply is currently minimized Show
  • Accepted Answer

    Eli
    Eli
    Offline
    Thursday, March 10 2011, 06:29 AM - #Permalink
    Resolved
    0 votes
    I got it working tonight.. I looked back over your tutorial and I couldn't even tell you what I did differently this time around, but its up and running. I'm trying to have people from outside the network connect but no one has gotten back to me yet. I will keep you updated. Thank you for the tutorial.. and for that startup script!
    The reply is currently minimized Show
  • Accepted Answer

    Eli
    Eli
    Offline
    Wednesday, March 09 2011, 11:27 PM - #Permalink
    Resolved
    0 votes
    Thanks, yeah I noticed I had the wrong file that I was trying to use.. I ran into some other problems though, but at this point I'm just going to start over and try and follow your tutorial more closely. It doesn't seem as if it should be that hard to make.. I'll keep you updated

    Thanks again!
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, March 09 2011, 10:08 AM - #Permalink
    Resolved
    0 votes
    Hi!

    The "guide" I wrote is kinda outdated but I think it should work :)

    If anything, I would guess by the errormessage and your description that you are trying to launch the minecraft client, not the server executable. Check out the minecraft download page again and make sure you select the minecraft server.jar ( I think its on the bottom of the page)

    Other than that, I highly recommend that you launch and manage the minecraft server through ssh/putty, if you don't already do so. It'll make your life easier! :D

    ClearOS is very much suited for minecraft and other gameservers, I currently run 4 mc servers, 1 counterstrike server, 1 counterstrike source server and 1 Far Cry2 server on ClearOS boxes :)
    The reply is currently minimized Show
  • Accepted Answer

    Eli
    Eli
    Offline
    Monday, March 07 2011, 04:24 AM - #Permalink
    Resolved
    0 votes
    Hello, I'm trying to setup a minecraft server for my brother, he plays a lot and thought it would be cool if I could do something like that, I told him I would give it a try. I have been following your tutorial and I ran into some trouble actually.. I'm not sure if this is because files have updated since you wrote this or what.

    Anyway, I made it to step 8 which included making start.sh excutable. I was able to do that, however when running ./start.sh I get the output as follows:

    ls[root@system minecraft]# ./start.sh
    Exception in thread "main" java.awt.HeadlessException:
    No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173)
    at java.awt.Window.<init>(Window.java:437)
    at java.awt.Frame.<init>(Frame.java:419)
    at net.minecraft.LauncherFrame.<init>(LauncherFrame.java:27)
    at net.minecraft.LauncherFrame.main(LauncherFrame.java:158)
    at net.minecraft.MinecraftLauncher.main(MinecraftLauncher.java:13)
    [root@system minecraft]#

    and then when I go to refresh the page in WinSCP there is nothing new in the folder.. all that is there is the minecraft.jar and the start.sh files

    If you could provide me with some insight on what may be going on that would be great.. Thanks for your help!

    And to follow up on the thread, yes I am interested in making it available to the internet to join, yes the clearos box I am running is my gateway. If you need any other information from me just ask.. I am not the greatest linux guru in the world.. but I generally know what you're talking about if you need to ask something. Anyway, if anyone can help me it would be greatly appreciated!

    ~Eli
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Friday, February 04 2011, 11:04 AM - #Permalink
    Resolved
    0 votes
    Christer Jonassen wrote:

    If you at somepoint have to restart the clear os machine or anything like that, all you need to do is to login again (with the user created in step 5) and write "./launch.sh"


    i was tearing apart your instructions for me, that's the only part that didn't make sense, we did the ./start.sh but never got to the launch script to keep it running :P

    got it working now, YAYYYYYY
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, February 03 2011, 10:10 AM - #Permalink
    Resolved
    0 votes
    ;)

    As of now, I launch Minecraft like this:

    1. Connect to the machine via ssh/putty

    2. navigate to the minecraft folder

    3. Start the launch script:
    ./launch.sh



    The script currently looks like this (Haven't got around to the fancy one):

    #!/bin/sh
    echo "Starting Minecraft server..."
    echo "Use screen -x minecraft-beta to view the console. Ctrl-A-D to detatch"
    sleep 1
    screen -A -m -d -U -S minecraft-beta java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui


    So whenever I want to access the minecraft console, I type "screen -x minecraft-beta", and when I'm done with it, I press Ctrl+A+D to detach from it (and it will continue to run in the background of course)

    Btw, If you don't have screen installed, you can just do a "yum install screen" when logged in as root ;)
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Thursday, February 03 2011, 08:34 AM - #Permalink
    Resolved
    0 votes
    ahhhh indeed i don't! looks like i missed a step :P
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, February 02 2011, 09:20 PM - #Permalink
    Resolved
    0 votes
    Do you launch minecraft in the background(screen etc), or do you plainly start it with the "java ..." command?

    If you run it directly in the ssh session, it will quit when you disconnect in putty
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Friday, January 28 2011, 08:14 AM - #Permalink
    Resolved
    0 votes
    any idea why the server shuts down when i drop my ssh connection to the server? i have to log into it using putty at work and keep the connection open or the MC server stops running :'(
    The reply is currently minimized Show
  • Accepted Answer

    Scott
    Scott
    Offline
    Thursday, January 27 2011, 08:34 AM - #Permalink
    Resolved
    0 votes
    andy wrote:
    so if i create the file, put it into my MC stuff on the server and start it up, it'll just update and reboot the server every day?


    If you run the script from the link I posted above, you can set a cron job (easiest in webmin) to run the update command of the script once a day (this is what i do), it will then gracefully shutdown the server, backup to a dir of your choice, download the latest, and then restart the server. All this is of course reliant on you editing the script with your own paths and user details.
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Thursday, January 27 2011, 08:08 AM - #Permalink
    Resolved
    0 votes
    so if i create the file, put it into my MC stuff on the server and start it up, it'll just update and reboot the server every day?

    what type of file do i save it as too? .exe?
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 19 2011, 08:32 AM - #Permalink
    Resolved
    0 votes
    I haven't had many stability issues, but there were times when MC hogged the CPU so it would lag.
    Although sometimes on one of my servers in particular, the console would be spammed with more and more "Can't keep up" messages until MC just terminated. This didn't affect the OS though.

    Also sometimes, I can not write stuff into the screen minecraft console, don't know if anyone else has experienced this..
    I can write stuff, but when I press enter, I just get a line break, without response from the minecraft server...
    The reply is currently minimized Show
  • Accepted Answer

    Scott
    Scott
    Offline
    Tuesday, January 18 2011, 12:56 PM - #Permalink
    Resolved
    0 votes
    Not had a single stability issue yet, though I have the above script set to update and relaunch the game daily.
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Tuesday, January 18 2011, 11:07 AM - #Permalink
    Resolved
    0 votes
    i ended up running the server on my gamer rig for the time being, the 2 TB drives i got were GARBAGE so i've got the 2 old IDE ones in there till they send me new drives that will hopefully work(looking at the reviews on new egg, it's doubtful).

    my buddy gave me his old junker laptop so i'll probably end up putting clear on there and running the server on it since the screen is about to snap off at any minute, that's later down the road though.

    need to see if i can get the media server setup here still too, wouldn't mind setting up the thing as the wireless access point too so i can get that pile linksys out of the way.

    rambling :woohoo: have you guys notice if the server side has gotten more stable since they moved it into beta? when i had it on my clear box, every once in a while it would toss a random java error on there when i would try to connect with a client. the error locked up the MC and the server in general so it took everything down.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, January 15 2011, 03:30 PM - #Permalink
    Resolved
    0 votes
    Glad to help! :)

    Thanks for the link, that script looks promising!
    The reply is currently minimized Show
  • Accepted Answer

    Scott
    Scott
    Offline
    Thursday, January 13 2011, 10:31 PM - #Permalink
    Resolved
    0 votes
    Thank you for the guide.

    FYI, there is a handy Start Up script with update features on the wiki. http://www.minecraftwiki.net/wiki/Server_startup_script
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Friday, December 03 2010, 08:26 AM - #Permalink
    Resolved
    0 votes
    i definitely understand why you have the MC server on the other machines instead of your main, MC server crashes...whole network goes down...ran into that issue a few times at this point, i didn't really care because i was at work screwing with stuff, but my roomies weren't all that happy with me since it's finals week and i kept rebooting the server :P
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Wednesday, December 01 2010, 01:47 PM - #Permalink
    Resolved
    0 votes
    i got most of my stuff setup at this point, server is going again, the gig nic cards are in, spare ram popped in, old radeon card is in... i still just can't seem to connect to the server from the outside world.

    ....woops, forgot the linksys infront of the server is still blocking that port :P
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Wednesday, December 01 2010, 08:31 AM - #Permalink
    Resolved
    0 votes
    ha! awsome...geekgasm :P i've got a team meeting this weekend for my paintball team....apparently we have to go downstate...5/6 hour drive for some reason, so no real time to setup the network and server with work and that meeting...barf
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, November 30 2010, 03:24 PM - #Permalink
    Resolved
    0 votes
    Have fun! ;)
    I'll be geeking it up myself soon too, since me and a couple of friends are hosting a LAN Party this weekend. There'll be Clear OS everywhere :P
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Tuesday, November 30 2010, 11:17 AM - #Permalink
    Resolved
    0 votes
    very gnarly, i setup logmein on my gamer rig so i could tinker with it while i'm at work :P. it'll be nice to just be able to get it all setup once i get the new hard drives i ordered.

    2 1TB sata 3.0's for this bad boy, also need to update clear to 5.2 sp1 once i get them as well. so much to do with is thing...god it's fun :P

    TO DO:
    install new hd's
    set raid
    install my radeon all-in-wonder for media server
    install dual gig nics(got a gig switch because it was on sale :P)
    install spare gig ram stick(been running on 2 for no real reason)
    install 5.1(my 5.2 cd didn't work all that grand so i just left 5.1 on til i got the ambition to update)
    update to 5.2
    install minecraft
    install mythtv?maybe?

    wish me luck! :P
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, November 30 2010, 10:34 AM - #Permalink
    Resolved
    0 votes
    Glad that you have made it this far :cheer:


    ./start.sh
    [INFO] Starting minecraft server version 0.2.5_02
    [INFO] loading properties
    [INFO] startong minecraft server on x.x.x.x:25565
    [WARNING] ****FAILED TO BIND TO PORT!
    [WARNING] The exception was: java.net.BindException: Cannot assign requested address
    [WARNING] Perhaps the server is already running on that port?


    You put your public IP as "server-ip"? As far as I know, it's not supposed to be there

    Mine looks like this (excluded server-port for security reasons):


    level-name=world
    hellworld=false
    admin-slot=true
    spawn-monsters=true
    public=false
    online-mode=true
    spawn-animals=true
    pvp=true
    max-players=20
    server-name=CjNet Minecraft
    server-ip=
    grow-trees=true
    motd=CJNET


    As you can see, I have left the server-ip field blank (and I'm running this on my gateway as well)

    If not, you might be running a minecraft server already, you can check this by running


    ps aux | grep minecraft_server


    The output will be something like this:

    username 5186 1.3 3.9 1175888 126912 pts/1 Ssl+ 11:06 0:16 java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui


    All you need to do if you are running this on your gateway is to log on the webinterface and goto "Incoming" on firewall and set e.g. port 25565 to be open
    As you know, people would only need you public IP to access the server if you run it on a default port, so if you want to be a litte more secure, you can set a different port in the server.properties.


    EDIT: I realised now that the stuff with "ps aux" and such is not really relevant when you don't run it in the background, but oh well, i'll leave it in for future reference
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Monday, November 29 2010, 04:35 PM - #Permalink
    Resolved
    0 votes
    i'm a dee dee dee and dl'ed the client instead of the server!!!! it's up and running on the lan side now.

    i've got my D DNS ip and have the port allowed on the incoming firewall but it doesn't seem to be able to start on that ip it's giving me a this error when i put my dynamic ip in as the "server-ip=x.x.x.x"


    ./start.sh
    [INFO] Starting minecraft server version 0.2.5_02
    [INFO] loading properties
    [INFO] startong minecraft server on x.x.x.x:25565
    [WARNING] ****FAILED TO BIND TO PORT!
    [WARNING] The exception was: java.net.BindException: Cannot assign requested address
    [WARNING] Perhaps the server is already running on that port?


    i'd rather not give out my public ip for obvious security reasons :P
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Monday, November 29 2010, 04:04 PM - #Permalink
    Resolved
    0 votes
    every time i try to start the server up, it keeps popping me an error


    chmod +x start.sh
    ./start.sh
    Exception in the thead "main" java.awt.HeadlessException:
    No X11 DISPLAY variable was set, but this program performed an operation which requires it.
    at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173)
    at java.awt.Window<init>(Window.java:437
    at net.minecraft.LauncherFrame<init>(LauncherFrame.java:17)
    at net.minecraft.LauncherFrame.main(LauncherFrame.java:137)
    at net.minecraft.MinecraftLauncher.main(MincraftLauncher.java:13)
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Sunday, November 28 2010, 10:43 PM - #Permalink
    Resolved
    0 votes
    awsome!!!!!!! TY, i've got tmrw off so i'll start cranking on it then.

    my network, it is my gateway, handling my dhcp and such i have my D DNS setup
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, November 27 2010, 04:38 PM - #Permalink
    Resolved
    1 votes
    Alrighty, I'l try to keep it as simple as possible :)
    (This post is quite big, but that's because I have tried to break it down as much as possible)


    1.
    Hook up a screen/kb/mouse to the clear os machine

    2.
    If you selected "Graphical console" during the clear os installation, you will probably see the login page for the admin web interface. In this case press "Exit console" or equiviallent.

    3.
    Then you should be greeted with a red "Administrator password" box. Press "Alt-F2". This should take you to another login shell where you need to login. Use "root" as username and the password you specified during the Clear OS installation.

    4.
    Now that you are logged in, there are a few tasks we need to do in order to set up a minecraft server: Install java, and enable the option to let ordinary users have login shell access
    Install java by typing "yum install java" Then press "y" when it asks for confirmation.

    To enable the shell access option for ordinary users, enter the following command:

    nano /etc/system/webconfig

    In nano, the text editor, add this line at the end:

    allow_shell = 1


    It should look something like this:

    template = standard-5.1
    allow_user = 1
    allow_subadmins = 1
    allow_shell = 1


    After adding that line, press "Ctrl-O" and enter to save, then press "Ctrl-X" to exit

    The last thing we need to do is to restart the admin web interface to apply the change we made. Write this and press enter:

    service webconfig restart

    Then write
    exit
    and press enter

    5.
    Leave the clear os machine for now and go to another machine on you network where you can access the web interface of the clear os machine.
    You can access it by opening a web browser and go to
    https:// <ipaddress of the server>:81
    Login as root
    Navigate to Directory->Users
    Click the "add" button.
    Fill out whatever you want in the fields, but remember whatever you set as username and password. At the very bottom of the add user page, there is should be a selector for "login shell". Choose "/bin/tcsh" and then press "add"

    6.
    Now download WinSCP and the minecraft_server.jar file from here. WinSCP is used for transfering files to the server, but it's also handy for editing text files on the server. Install WinSCP (you may want to select "Explorer like interface during setup)


    7.
    Start WinSCP.
    In WinSCP, select "New"
    In the "Host name" field, enter the IP address of your server
    Then fill inn the username and password of the user you created in the previous step.
    Then click "Login"
    You probably get a warning about "The server host key was not found in the cache...", This is normal for first time login. Click Yes to proceed.
    Now, find the minecraft_server.jar file you downloaded, and drag-n-drop it into the WinSCP window.
    Click "Copy" on the window that pops up.

    Afterwards, right click in the main area of WinSCP and select "New"->"File..."
    Name the file "start.sh" and click "OK"
    Now WinSCP opens a notepad-like text editor for the file you created.
    Copy and paste the following into the editor:

    #!/bin/sh
    java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

    Afterwards, save the file by clicking the save icon and close the editor window.
    The "start.sh" file is what we'll use to start the minecraft server

    8.
    Now return to the clear os machine and log in with the username/pw you created in step 5
    Type the following commands followed by enter:

    chmod +x start.sh

    and

    ./start.sh


    The first time we launch a minecraft server, it creates a lot of files and then it quits.
    Leave the clearos machine for now and return to the machine running WinSCP

    9.
    Now back in WinSCP, press "F5" to refresh, and you'll see the new files that have been created by the minecraft server.
    The most important one here is the one called "server.properties"
    Right-click it, and select edit.
    Here you can change settings for the minecraft-server. If you want to know more about the settings, you can read about them here. You don't have to change anything here if you don't want to.
    Close the editor and choose to edit the file called "ops.txt"
    Usernames in this file gain operator rights
    You would probably want to add your minecraft username here. Save the file afterwards.
    Take note of the other files created by the minecraft-server, such as banned-ips.txt and banned-players.txt. These restrict access to the server. The "server.log" file is useful for monitoring the server and troubleshooting if anything goes wrong.

    10.
    Now you should be all set :cheer:
    Return to the clear os machine and execute the command

    ./start.sh

    again. Unless you get any errors, the minecraft server should be ready for use, and you can now connect to it by typing in the IP address of the server in the "Multiplayer" screen in Minecraft ;)

    If you at somepoint have to restart the clear os machine or anything like that, all you need to do is to login again (with the user created in step 5) and write "./launch.sh"

    Hope this didn't get too advanced, but I don't think there were any unnecessary steps.
    Just ask if you should get stuck, and I'll try to help :)

    (As of now, your minecraft server would only be available from within the local network. If you want to able to connect from the outside of the network(internet), I need to know more about your network configuration (i.e. is the clear os machine the gateway? does it have a proper public IP on one of the interfaces?)
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Saturday, November 27 2010, 12:14 PM - #Permalink
    Resolved
    0 votes
    could we do baby steps? just get the bugger on the server and running?
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, November 25 2010, 03:23 PM - #Permalink
    Resolved
    0 votes
    You shouldn't hate on SSH, its brilliant! :cheer:

    First a quick overview of my setup and how it works:


    2 ClearOS machines, each hosting a minecraft world.
    These are behind my gateway(which is also ClearOS).
    Since I only have one public IP, I use NAT/Portforwarding to the machines running minecraft.
    This way people can connect to both of the servers from the internet (by specifing the port when they connect to it)

    The minecraft server & data is stored in a folder in my home directory on the two machines. (Note that I don't run minecraft with root priveliges, as this is not recommended)

    I've set up Windows filesharing and FTP on both of them, so I can easilly access the Minecraft config files and data from another computer (Mac/Windows/whatever). This is useful if you wish to make mapoverviews like the one I linked to earlier and it's also convenient whenever you need to update the minecraft_server.jar file itself (which happens quite frequently)

    99% of the time, I access these machines remotely through SSH, so therefore I have to make sure that the minecraft server contiunues to run, even if i close the SSH session. To accomplish this, I use a brilliant utility called GNU Screen. This way the minecraft server runs in a seperate "window", that I can view whenever I need to, and for the rest of the time it runs in the background.

    To make my life easier, I've made a script that does both the minecraft server launch and the screen thing automatically, so I don't have to remember that command each time I want to start/restart the minecraft server

    This might sound complex, but that's not the case really :)

    So say if I want to check my minecraft server now, all I do is:
    1 Open putty (windows) or ssh (Mac/Linux) on my machine
    2 Log on with the username and password for that particular machine
    3 Write "screen -x minecraft-alpha"
    4 And as simple as that, I'm in the minecraft console, where I can look for errors, check how many players are logged in, etc.
    5 When I'm done, I simply press "Ctrl A+D", and the minecraft console contiunes to run in the background, so I can safely quit ssh/putty without stopping the minecraft server.


    So.. do you want to run a similar setup? If not, I can always help you out to get it running without using ssh or screen, but in the long run, doing it without ssh/screen would be less flexible and probably require more effort ;)
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Thursday, November 25 2010, 02:21 AM - #Permalink
    Resolved
    0 votes
    as far as command lines go...not really in linux, should probably learn it since i do support for units that have linux kernels on the backend...i'll just pretend i don't know what i'm talking about so they still send me to CO for training! HELLOOOOO FRESH POWDER!

    putty-i've dabbled lightly
    ssh-been taught to hate it LOL


    i can very easily hook a screen kb&mouse up, would only take about 10 mins.

    really just need the steps after...get to the command line :P

    **unless it would be easier to putty in...then i can do it that way as well**
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, November 24 2010, 04:33 PM - #Permalink
    Resolved
    0 votes
    Yeah, finding a suitable tutorial is often easier said than done :)
    Thankfully, I could use the tricks I've learned from running CS/CSS/TF2/FarCry2 on Linux.

    First things first, are you familiar with:
    -The linux terminal/command line? (Stuff like making folders, installing via yum, editing text etc.)
    -Do you know how to use putty/ssh to connect to your server?
    -Sharing folders over the network and how to access them?

    Oh, and what OS do you have on the machine you are administering the Clear OS machine from?


    p.s. love the mario!

    Can't go wrong with Mario from SMB3 :cheer:
    I got the "recipe" from the minecraftforums :)
    The reply is currently minimized Show
  • Accepted Answer

    andy
    andy
    Offline
    Wednesday, November 24 2010, 04:18 PM - #Permalink
    Resolved
    0 votes
    indeed sir, i do! it's running on a headless asus a7n8 deluxe w/ socket a 2.1ghz athlon &3 gigs of kingston ddr ram.

    all it's handling at the moment is firewall and dhcp, I've been working too much to really get anything else fired up and working since the roomies don't appreciate me taking it down to fix whatever i broke :P

    i tried looking up any kind of guide online but a linux pc and a linux server are 2 completely different monsters!

    any help would be awsome man, thanks so much!

    p.s. love the mario!
    The reply is currently minimized Show
Your Reply