Altitude Game: Forums  

Go Back   Altitude Game: Forums > Altitude Support > Dedicated Server

Dedicated Server Discuss technical issues related to hosting your own servers.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-06-2009, 01:29 AM
nesnl nesnl is offline
Super Moderator
 
Join Date: Jan 2009
Posts: 1,503
Default VPS (Virtual Private Server) Guide

Here is my guide to setting up an Altitude Server (or multiple servers) on a VPS (Virtual Private Server). I don't really know all the intricate details about all of this stuff, so if anyone has anything to add or amend (or just flat out tell me I am wrong) then please do so. I will gladly amend the post to make it as accurate as possible. Also, Lam/Karl feel free just to edit it if you notice something that is wrong or if you want to include something else.

First, a VPS is something that costs money. So if you want to set up an Altitude Server using this method, unless you have access to a free VPS, it is going to cost a monthly fee. These fees can range from as little as a few dollars a month to some that are very expensive. Obviously, there is going to be different quality services. So just because you find a VPS service for 1.99/month doesn't mean that it is going to be the most reliable nor the best option and just because something costs 50.00/ month doesn't mean it is going to fit your needs the best. There are tons of VPS companies out there and a wide variety of options and locations. I recommend just searching on Google and then looking for reviews of various companies. There are VPS companies all over the world as well, so consider where the servers are located when selecting one as it will impact the ping the players have to the server.

A VPS can have many different operating systems, but I recommend using on that uses Linux as it is very easy to use. However, I am sure that a VPS that utilizes Windows will work as well.

Here is a link to a post that Karl made about different VPS companies he has dealt with. It is by no means a comprehensive list of VPS companies and if you are serious about this I would recommend doing some research before signing up for any specific company.

http://altitudegame.com/forums/showp...88&postcount=2

Next, you will need to know how to access your VPS host and be able to upload files, change server configurations, start and stop your servers, etc. To do this you will need two types of programs. You will need a terminal program in order to connect to the server using a SSH (Secure Shell). You will also need an SFTP (Secure File Transfer Protocol) program in order to transfer your files. Here is some links to programs that are free and can be used for these purposes.

Windows:

SSH - Putty - http://www.chiark.greenend.org.uk/~sgtatham/putty/
STFP - WinSCP - http://winscp.net/eng/index.php

Mac:

SSH - Terminal (this comes installed on a Mac and is located in the /Applications/Utilities folder)
SFTP - Cyberduck - http://cyberduck.ch/

Once you sign up for a VPS host you will either pick or be assigned a username and password. Both those, along with the VPS IP address, will be needed in order to connect to the server with the SSH program as well as the SFTP program.

Using the SFTP program should be fairly simple as most are drag and drop. Simple set up your program with the correct IP, Username and Password and then connect. Now, you will need a copy of Altitude to put on the server, but it needs to be one that runs on that specific operating system. That means if you have a Linux VPS then you need to get a copy of Altitude for Linux. Visit: http://altitudegame.com/download.html and make sure you get the correct copy of the game. If you download the Linux version of Altitude it is going to be Altitude.sh. Now drag and drop that file into your VPS using the SFTP program.

Next, using your terminal program you are going to connect to your VPS. This is done by typing: ssh username@xxx.xxx.xxx.xxx (where the xs are the ip address of your server and username is your specific username). You will be prompted for your password. Enter this and you are now logged into your VPS. Next, assuming you are using a Linux VPS, and are looking to install the Altitude Game (and have already transferred the installer onto the server using the SFTP program), type:

Code:
./Altitude.sh -c
This will then install Altitude onto the VPS using the downloaded installer you just transfered onto it.

You should be able to refresh your SFTP session and see the full game inside a folder named "Altitude" on your server. This is similar to the one that is installed on your own computer. This is also where you will need to transfer all your maps that you want the server to run by placing them into the "Maps" folder.

Now that Altitude is installed on the VPS you are going to learn how to start and stop your servers as well as specify what servers to run. First, open the Server Configurator program which is located in the Altitude folder on your LOCAL machine. Using this program is fairly simple and it allows you to add as many servers as you want to run at the same time. The quality of the VPS service you choose will dictate how many servers you can run at the same time and how many bots you can have in each server. Bots currently take up a lot of memory to run, so it is probably best to keep them to a minimum if used at all. Once you have set up all the servers you want in the Server Configurator then Exit and Save the file. On your local machine will be a new file: /Altitude/servers/launcher_config.xml. This file contains all the information about the servers you are going to run. Copy this file onto your VPS using the SFTP program by dragging and dropping it into the servers folder. Anytime you want to update the servers config file, open the server configurator on your local machine and make any changes you want and then overwrite the file on your VPS by dragging and dropping it into the servers folder using your SFTP program. To run the servers with the new file you must then stop your servers and restart them.

In order to start your servers you will need to run a shell script. Open a text document and copy and paste this into the text file and save it as: start_servers.sh (the important part is the sh, you can name it whatever you want otherwise):

Code:
#!/bin/bash
PRGDIR=`dirname "$0"`
cd ${PRGDIR}/altitude
./server_launcher > /dev/null 2>&1 &
ps ax --width=1000 | grep "[D]em.launch.path=launch-server-launcher.xml" | awk '{printf $1}' > server_launcher.pid
echo >> server_launcher.pid
exit 0
Now, drag and drop this file using your SFTP program into the same directory that the "Altitude" folder is located (note: not in the Altitude directory but along side it). To run the servers you are going to do the commands you did to install the Altitude game. Go to your SSH terminal and type:

Code:
./start_servers.sh
This will now run the script that will start your servers.

In order to stop your servers you will need to do it in the SSH terminal as well. Note that you will need to stop your servers every time you update the server config file. Once you are logged in using the SSH terminal type: ps ux (which means Process Status for all process owned by a specific user). This will then show a list of all the currently running processes. Assuming you are running servers you will see it on a list. The list will look something like this:

Code:
[username@vpsip ~]$ ps ux
USER ----- PID  %CPU  %MEM  VSZ  RSS TTY  STAT  START  TIME  COMMAND
username 1364 0.0 0.1 9888 1664 ? S 22:38 0:00 sshd: username@pts/0
username 1365 0.0 0.1 3612 1504 pts/0 Ss+ 22:38 0:00 -bash
username 10118 0.0 0.1 3560 1252 ? S 22:17 0:00 /bin/sh ./server_launcher
username 10129 1.2 9.7 284700 102740 ? Sl 22:17 0:31 /home/username/altitude/jre/bin/java -server -Dinstall4j.jvmDir=/home/username/altitude/jre -Dexe4j.moduleName=/home/username/altitude/server_launcher -Xms64M -Xmx128M -Djava.library.path=native -Dem.launch.path
username 26281 0.0 0.1 9888 1656 ? S 22:58 0:00 sshd: username@pts/1
username 26283 0.0 0.1 3608 1484 pts/1 Ss 22:58 0:00 -bash
username 28226 0.0 0.0 2432 916 pts/1 R+ 23:00 0:00 ps ux
The important column is the one that has the heading "PID" (which stands for Process Identification). You are going to use that PID to stop your servers. The process that is your server is the one that says "/home/username/altitude/jre/bin/java..." So you look at that line and then look at its PID. Then in the SSH terminal type:

Code:
kill <PID>
(where <PID> is the number from the list that ps ux gave you). Note that this number changes each time you launch the servers. So it might be 1023 one time and then 23789 the next time (or any number. In the example given the number is 10129. So you would type: kill 10129). So each time you want to stop the servers you need to type ps ux first and then get the correct PID number.

This pretty much covers the basics of setting up and running Altitude servers using a VPS service provider. I am sure someone with more knowledge on the subject could be more in depth, but this is all I know. Again, if you see errors or things that should be added, please let me know.

-Maimer

Last edited by nesnl; 11-06-2009 at 06:25 PM.
Reply With Quote
  #2  
Old 11-06-2009, 07:44 AM
argonide argonide is offline
Senior Member
 
Join Date: Jul 2008
Posts: 178
Default

Thanks maimer, I was wondering how to install altitude without a gui. Here's a lazier shell script for your troubles: (not tested as is but it was from something else so it should work)

Code:
#! /bin/sh

case "$1" in
       start)
               cd <path to altitude dir>
               ./server_launcher > /dev/null 2>&1 &
               echo $! > /var/run/altitude.pid
                ;;
       stop)
                pid=`cat /var/run/altitude.pid`
                kill $pid
               ;;       
        restart)
               pid=`cat /var/run/altitude.pid`
               kill $pid
               cd <path to altitude dir>
               ./server_launcher > /dev/null 2>&1 &
               echo $! > /var/run/altitude.pid
               ;;
esac
exit 0
Reply With Quote
  #3  
Old 12-09-2009, 08:13 PM
judas judas is offline
Junior Member
 
Join Date: Dec 2009
Posts: 4
Default

This guide helped me a lot. I didn't get that start script to work though.
The thing is i installed altitute to "/altitude"

So when i want to start the server i fire up putty in ssh and enter

"/altitude/server_launcher"

This works fine but when i exit putty, the server also closes as the "console" exits. Is there a way i can run my server_launcher as a service?

I didnt install like the install said in /opt ect and didnt use symlinks (because I dont know what they are).

I havent used linux for ages so im no good with any console commands
Reply With Quote
  #4  
Old 12-11-2009, 02:49 PM
Logisticz Logisticz is offline
Junior Member
 
Join Date: Dec 2009
Posts: 3
Default

Thanks alot for that well written guide - i have only one major problem

I have an VPS without any GUI interface, so i cant start the server tool in any way

and we, from blacksun-gaming.de clan want to setup several servers and maybe go into the league...

can anyone help me with that issue? i would really appreciate it.

thanks alot in advance
Gretingzzzzzzzzzz
Logi
Reply With Quote
  #5  
Old 12-11-2009, 02:55 PM
nesnl nesnl is offline
Super Moderator
 
Join Date: Jan 2009
Posts: 1,503
Default

Logisticz,

Assuming your VPS uses linux, the instructions on how to launch the server launcher are explained in this guide. Look at the part written about the shell script and hopefully it will make sense. If not, tell me what you are having a problem with and hopefully someone can help you.
Reply With Quote
  #6  
Old 12-11-2009, 06:25 PM
Logisticz Logisticz is offline
Junior Member
 
Join Date: Dec 2009
Posts: 3
Default

Quote:
Originally Posted by nesnl View Post
Logisticz,

Assuming your VPS uses linux, the instructions on how to launch the server launcher are explained in this guide. Look at the part written about the shell script and hopefully it will make sense. If not, tell me what you are having a problem with and hopefully someone can help you.
shame on me - i hestiated when i read it

thanks alot mate!
works fine as its meant to be
Reply With Quote
  #7  
Old 12-17-2009, 07:30 PM
mutra mutra is offline
Banned
 
Join Date: Dec 2009
Posts: 58
Default

Could you provide more help with the Terminal way of setting up a VPS?

Thanks the rest was a lot of help, I just think it would be easier to do it through Terminal. ( I have a mac)
Reply With Quote
  #8  
Old 01-04-2010, 12:31 PM
Swiftee Swiftee is offline
Junior Member
 
Join Date: Dec 2009
Posts: 6
Default

I was wondering how much bandwidth a 18 slot busy server would roughly use on a VPS, Most have 500-1000mb bandwidth limit.
Reply With Quote
  #9  
Old 01-04-2010, 06:48 PM
Karl Karl is offline
Administrator
 
Join Date: May 2008
Posts: 1,206
Default

2-3KB/s for each user.

So (i think i did this correctly):
3KB/s * 18 * 2629743seconds/month=
(3 (KB / s)) * 18 * (2 629 743 s) = 135.427591 gigabytes/month

so assuming all 18 slots were always occupied you would need 135GB/month of bandwidth... but it would most like be something like 18 slots are occupied 25% or less of the time so you really only need like 30GB/month of bandwidth.
Reply With Quote
  #10  
Old 01-04-2010, 07:36 PM
Swiftee Swiftee is offline
Junior Member
 
Join Date: Dec 2009
Posts: 6
Default

ah thats really good then
Reply With Quote
  #11  
Old 01-31-2010, 04:49 PM
gren00b gren00b is offline
Member
 
Join Date: Jan 2010
Location: Minnesota
Posts: 53
Default

I was looking at vpslink.com, for like $6.62 per month they offer:
2.5 GB of Disk Space
100GB Bandwith
64MB of RAM

I'm planning to use primarily with my friends or if I get into a clan, so I don't think it'll ever exceed 100GB, and obviously Altitude isn't more than 2.5GB, but my concern is with the RAM--does an Altitude server need more than that or will that be enough?

Edit: I just read another thread and it appears as though 64MB will not be nearly enough.

Last edited by gren00b; 01-31-2010 at 04:55 PM.
Reply With Quote
  #12  
Old 01-31-2010, 06:20 PM
Varonth Varonth is offline
Member
 
Join Date: Dec 2009
Posts: 66
Default

I would also like to mention that theres no need to upload the altitude installer via SFTP.

Code:
wget http://installer.altitudegame.com/0.0.1/altitude.sh
will do the same thing, just a way faster, and without blocking your internet connection.
Wget will download the file from the given source..

Last edited by Varonth; 01-31-2010 at 06:25 PM.
Reply With Quote
  #13  
Old 02-04-2010, 09:27 PM
TRUEPAiN TRUEPAiN is offline
Senior Member
 
Join Date: Dec 2009
Location: Bay Area
Posts: 452
Default

If anyone does get a vps. Be sure it has close to 512 Mbs of ram. You need about 256 to execute the installer. Then running a server it pushes a little above 300. 1 gb would probably be ideal. Dedicated servers would be better but vps does the job just fine I suppose.
Reply With Quote
  #14  
Old 02-13-2010, 07:16 PM
phong phong is offline
Senior Member
 
Join Date: Jul 2009
Location: Chicago
Posts: 372
Default

I find it's easier to just run altitude in it's own screen session. Helpful for debugging and such.
Reply With Quote
  #15  
Old 04-09-2010, 09:21 PM
York York is offline
Senior Member
 
Join Date: Dec 2009
Posts: 2,070
Default

Quote:
Originally Posted by nesnl View Post
Code:
./Altitude.sh -c
This will then install Altitude onto the VPS using the downloaded installer you just transfered onto it.
and i i didnt use linux?
Reply With Quote
  #16  
Old 04-09-2010, 09:54 PM
York York is offline
Senior Member
 
Join Date: Dec 2009
Posts: 2,070
Default

-bash: ./start_servers.sh: Permission denied



what is that?!?!?!
Reply With Quote
  #17  
Old 04-09-2010, 10:26 PM
nobodyhome nobodyhome is offline
Senior Member
 
Join Date: Apr 2009
Posts: 1,088
Default

try typing:

chmod u+x ./start_servers.sh

basically i think that in unix files are not "runnable" (executable) by default, and the above command changes it for that file.
Reply With Quote
  #18  
Old 04-09-2010, 11:10 PM
York York is offline
Senior Member
 
Join Date: Dec 2009
Posts: 2,070
Default

I put my entire altitude folder into my SFTP.
I put my launcher_config.xml into my SFTP.
I put my start_server.sh into my SFTP.

I am now lost.
Reply With Quote
  #19  
Old 04-10-2010, 08:41 AM
TRUEPAiN TRUEPAiN is offline
Senior Member
 
Join Date: Dec 2009
Location: Bay Area
Posts: 452
Default

You're using putty right?

I think the command is..

Code:
wget http://installer.altitudegame.com/0.0.1/altitude.sh
wget will download a file into whatever directory you're in or viewing..

after that execute the installer

then setup your configs, upload your maps, etc.

After that execute the server_launcher, let it update, then check the server list for your IP.

If it doesn't work, post a log and the forum peeps can help you with their helpfulness.

^_^


<3

Last edited by TRUEPAiN; 04-10-2010 at 08:46 AM.
Reply With Quote
  #20  
Old 04-10-2010, 09:23 AM
nesnl nesnl is offline
Super Moderator
 
Join Date: Jan 2009
Posts: 1,503
Default

Quote:
Originally Posted by York View Post
I put my entire altitude folder into my SFTP.
I put my launcher_config.xml into my SFTP.
I put my start_server.sh into my SFTP.

I am now lost.
It sounds like you might be trying to move an already installed version of Altitude (for maybe windows or mac) and then putting it on a Linux machine. Just get the linux installer and then install it fresh on the machine.
Reply With Quote
  #21  
Old 04-10-2010, 12:53 PM
York York is offline
Senior Member
 
Join Date: Dec 2009
Posts: 2,070
Default



Yea it was already installed onto my computer. I just dragged my folder over.

So re-download Alitude as Linux, Altitude.sh.

Then drag just that over?

Also, I am using Cyberduck and Terminal.

Then run the download command?
Reply With Quote
  #22  
Old 04-10-2010, 03:16 PM
nesnl nesnl is offline
Super Moderator
 
Join Date: Jan 2009
Posts: 1,503
Default

Quote:
Originally Posted by York View Post


Yea it was already installed onto my computer. I just dragged my folder over.

So re-download Alitude as Linux, Altitude.sh.

Then drag just that over?

Also, I am using Cyberduck and Terminal.

Then run the download command?
Well you don't need to run the download command if you already downloaded the linux installer and copied it over using your SFTP. All you need to do is install it once you copy over the installer, which is outlined in this guide.
Reply With Quote
  #23  
Old 04-10-2010, 04:39 PM
York York is offline
Senior Member
 
Join Date: Dec 2009
Posts: 2,070
Default

I will take a screen shot of what I have in the SFTP
Reply With Quote
  #24  
Old 08-05-2010, 11:57 PM
ofna01 ofna01 is offline
Member
 
Join Date: Feb 2010
Posts: 35
Default

Hey,guys,im trying to put up a server,but it keeps saying my server is behind a firewall.i looked at the page for this,did what it said,and it still displays the same message.Any ideas?
Reply With Quote
  #25  
Old 09-14-2010, 02:46 AM
Cider Cider is offline
Junior Member
 
Join Date: Sep 2010
Posts: 4
Default

Thanks for this guide, worked like a charm.
Reply With Quote
  #26  
Old 11-14-2012, 02:51 PM
Jordonak Jordonak is offline
Junior Member
 
Join Date: Nov 2012
Posts: 1
Default

Thanks for the advice, helped me a lot of your advice!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:56 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
2008 Nimbly Games LLC