Difference between revisions of "Run your own virtual server"

From OBEY wiki
Jump to: navigation, search
Line 6: Line 6:
  
 
== Step 1) Register on a service ==
 
== Step 1) Register on a service ==
Make an account on [https://www.digitalocean.com/?refcode=76917c2bb42e DigitalOcean.com] '''<-- use this link to register, you will start with $10 in credit'''
+
Make an account on [https://www.digitalocean.com/?refcode=76917c2bb42e DigitalOcean.com] '''<-- follow this link to register, you will start with $10 in credit!'''
  
 
You will need to register a credit card to start an account (this protects them from anyone running 100 servers 24/7 for no reason).
 
You will need to register a credit card to start an account (this protects them from anyone running 100 servers 24/7 for no reason).
Line 13: Line 13:
 
== Step 2) Create a new droplet. ==
 
== Step 2) Create a new droplet. ==
  
[[File:VirtualServerHowTo1.jpeg]]
+
[[File:VirtualServerHowTo1.jpeg]]</br>
 
- Select at least 2 CPU for a decent multiplayer server.
 
- Select at least 2 CPU for a decent multiplayer server.
  
Line 28: Line 28:
 
- Go to Access Tab, and click on Console Access
 
- Go to Access Tab, and click on Console Access
  
[[File:virtualServerHowTo2.jpg]]
+
[[File:virtualServerHowTo2.jpg]]<br>
 
+
 
when you see the black screen type '''root'''  and press enter
 
when you see the black screen type '''root'''  and press enter
 
then check your email to type the password you got there... and set a new one as prompted
 
then check your email to type the password you got there... and set a new one as prompted
  
[[File:virtualServerHowTo3.jpg]]
+
[[File:virtualServerHowTo3.jpg]]<br>
  
 +
'''sudo apt-get install unzip''' //install zip/unzip functionality with this
  
- install zip/unzip functionality like this:
+
'''adduser userName''' //make a new user (not good practice to do everything as root).
'''sudo apt-get install unzip'''
+
 
+
 
+
Then make a new user (not good practice to do everything as root). Add one like this:
+
'''adduser userName'''
+
 
it will ask you for details about the user, but you can leave the options blank by pressing <enter>.  Then...
 
it will ask you for details about the user, but you can leave the options blank by pressing <enter>.  Then...
'''logout'''  
+
'''logout'''
and then log back in now as the user you just created (as will be good practice from now on)
+
 
+
  
 +
''and then log back in now as the user you just created (as will be good practice from now on)''
  
 
'''mkdir OBEY21r0'''  //let's make a folder in the new user's home dir to contain the build we want to use
 
'''mkdir OBEY21r0'''  //let's make a folder in the new user's home dir to contain the build we want to use
Line 58: Line 52:
 
'''rm OBEY21r0_headless_lin.zip'''  //(optional) if you want to delete the zip we downloaded, we don't need it anymore
 
'''rm OBEY21r0_headless_lin.zip'''  //(optional) if you want to delete the zip we downloaded, we don't need it anymore
  
 +
''Use nano text editor to configure your game...''
  
Then, use nano text editor to configure your game...
 
 
'''nano serverSettings.txt'''  //use ctrl + o (and press enter) to SAVE and ctrl + x to EXIT
 
'''nano serverSettings.txt'''  //use ctrl + o (and press enter) to SAVE and ctrl + x to EXIT
  
  
 +
== start a server ==
 +
''Then, from the directory where you have unzipped the build...''
  
== start a server ==
 
 
 
'''sh RUN_SERVER.sh'''  
 
'''sh RUN_SERVER.sh'''  
 
   
 
   
 
[[File:virtualServerHowTo4.jpg]]
 
[[File:virtualServerHowTo4.jpg]]
 +
''When you see this screen your server is now running!''
  
  
 
== HOW TO RUN SERVERS FOR MERE CENTS!!! ==
 
== HOW TO RUN SERVERS FOR MERE CENTS!!! ==
  
Now digitalocean.com charges us 3 cents an hour to run our server (running it constantly will come to $20 a month).  
+
Now digitalocean.com charges us 3 cents an hour to run our server (running it constantly will come to $20 a month).<br>
Every bunny knows that's a LOT of money (thats like 2 dropships!).
+
Every bunny knows that's a LOT of money (thats like 2 dropships!).<br><br>
  
So to keep costs ultra low we just run the server when we want it.
+
So to keep costs ultra low we just run the server when we want it.<br>
digitalocean.com will charge us as long as we have a droplet (even if it's shut down), so we can delete our droplets to save money.  Now if we do that right now we will lose all our settings, so in order to not have to go through the setup again we create a snapshot.
+
digitalocean.com will charge us as long as we have a droplet (even if it's shut down), so we can delete our droplets to save money.<br>  
 +
Now if we do that right now we will lose all our settings, so in order to not have to go through the setup again we create a snapshot.
  
 +
'''logout'''<br> 
 +
''and then log back in as 'root'''<br>
 +
'''poweroff'''  //shut down the server
  
'''logout'''  and then log back in as 'root'
+
<center>
'''poweroff'''  //shuts down the server
+
Then save a snapshot as shown (name it whatever you want)<br>
 +
...it might take 1 or 2 minutes to save.<br>
 +
[[File:virtualServerHowTo5.jpg]]<br><br>
  
Then save a snapshot as shown (name it whatever you want)
+
Then we can delete our droplet to not be charged any cents!<br>
...it might take 1 or 2 minutes to save.
+
[[File:virtualServerHowTo6.jpg]]<br><br>
 
+
[[File:virtualServerHowTo5.jpg]]
+
 
+
 
+
Then we can delete our droplet to not be charged any cents!
+
[[File:virtualServerHowTo6.jpg]]
+
 
+
When it is time to start the server again.. start a new droplet,  but this time use your snapshot!
+
[[File:virtualServerHowTo7.jpg]]
+
  
 +
When it is time to start the server again.. start a new droplet,  but this time use your snapshot!<br>
 +
[[File:virtualServerHowTo7.jpg]]<br>
 +
</center>
  
 
you can even run a bunch at once, now (at 3 cents per hour)
 
you can even run a bunch at once, now (at 3 cents per hour)
  
 
+
''then log in''
then log in
+
'''cd OBEY21r0'''
cd OBEY21r0
+
'''sh RUN_SERVER.sh'''   //KILL BUNNIES
sh RUN_SERVER.sh    //KILL BUNNIES
+
  
  
Line 112: Line 106:
 
'''rm fileName'''  will delete fileName
 
'''rm fileName'''  will delete fileName
  
'''<nowiki>rm -r someDir/*</nowiki>'''  will delete everything in that directory recursively (be careful!)
+
'''<nowiki>rm -r someDir/*</nowiki>'''  will delete everything inside someDir recursively (be careful!)
  
 
'''pwd''' shows you where you are
 
'''pwd''' shows you where you are

Revision as of 05:47, 13 February 2015

Are you a lazy bum that has no money? Me too! :D Did you know you can run a virtual OBEY server for about as much money as you find on a sidewalk ?

Perfect... here's how!


Step 1) Register on a service

Make an account on DigitalOcean.com <-- follow this link to register, you will start with $10 in credit!

You will need to register a credit card to start an account (this protects them from anyone running 100 servers 24/7 for no reason).


Step 2) Create a new droplet.

VirtualServerHowTo1.jpeg</br> - Select at least 2 CPU for a decent multiplayer server.

- Select a region closest to where you want the best ping to occur

- Select Ubuntu (other distros probably work just fine too, but I haven't tested them)

- click "Create Droplet"


Step 3) Set up the server

- Go to Access Tab, and click on Console Access

VirtualServerHowTo2.jpg
when you see the black screen type root and press enter then check your email to type the password you got there... and set a new one as prompted

VirtualServerHowTo3.jpg

sudo apt-get install unzip //install zip/unzip functionality with this

adduser userName //make a new user (not good practice to do everything as root). it will ask you for details about the user, but you can leave the options blank by pressing <enter>. Then... logout

and then log back in now as the user you just created (as will be good practice from now on)

mkdir OBEY21r0 //let's make a folder in the new user's home dir to contain the build we want to use

cd OBEY21r0 //navigate to the directory

wget http://www.obeygame.com/build/OBEY21r0_headless_lin.zip //download OBEY into it

unzip OBEY21r0_headless_lin.zip //and unzip it

rm OBEY21r0_headless_lin.zip //(optional) if you want to delete the zip we downloaded, we don't need it anymore

Use nano text editor to configure your game...

nano serverSettings.txt //use ctrl + o (and press enter) to SAVE and ctrl + x to EXIT


start a server

Then, from the directory where you have unzipped the build...

sh RUN_SERVER.sh

VirtualServerHowTo4.jpg When you see this screen your server is now running!


HOW TO RUN SERVERS FOR MERE CENTS!!!

Now digitalocean.com charges us 3 cents an hour to run our server (running it constantly will come to $20 a month).
Every bunny knows that's a LOT of money (thats like 2 dropships!).

So to keep costs ultra low we just run the server when we want it.
digitalocean.com will charge us as long as we have a droplet (even if it's shut down), so we can delete our droplets to save money.
Now if we do that right now we will lose all our settings, so in order to not have to go through the setup again we create a snapshot.

logout
and then log back in as 'root'
poweroff //shut down the server

Then save a snapshot as shown (name it whatever you want)
...it might take 1 or 2 minutes to save.
VirtualServerHowTo5.jpg

Then we can delete our droplet to not be charged any cents!
VirtualServerHowTo6.jpg

When it is time to start the server again.. start a new droplet, but this time use your snapshot!
VirtualServerHowTo7.jpg

you can even run a bunch at once, now (at 3 cents per hour)

then log in cd OBEY21r0 sh RUN_SERVER.sh //KILL BUNNIES



TIPS:

if you make a mistake use the command rm to delete stuff. For example:

rm fileName will delete fileName

rm -r someDir/* will delete everything inside someDir recursively (be careful!)

pwd shows you where you are

ls shows you the contents of where you are

If you are on Windows, check out PuTTy to log in, it's better than using the interface on the website, because you can copy/paste and it won't use bandwidth.

NOTE: if you get an error that looks like "OBEY.x86 not found" when you try to run the server, it means you are are running a 32bit app on a 64bit os or visa versa


You can add the new user to the 'super user' group so he can run admin tasks on the server instead of having to log in as root:

gpasswd -a userName sudo