WARNING: Game servers take lots of resources. Ensure you have the proper resources to run a server. Usage of one of x10's Dedicated VPSes is EXTREMELY recomended
Welcome to my tutorial! Here I'll teach you how to install different game servers on your VPS running CentOS. If you need any help or have any questions, just post them to this thread!
Installing and setting up a Minecraft server
The first thing you will need to do is install Java on to your server. Log in to your SSH as the "root" user. And enter this command into your SSH:
Code:
yum install \*java-1.6\*
Once you do that, you will want to create a folder for the minecraft server files. Let's just drop them into the /srv folder. First make a a folder into the /srv directory:
Code:
mkdir /srv/minecraft
Switch to the directory:
Code:
cd /srv/minecraft
Now you will need to download the minecraft server java file:
Code:
wget http://www.minecraft.net/download/minecraft_server.jar
The rest is pretty straight forward. Create a linux user and give it access to the folder.
Code:
/usr/sbin/useradd -d /srv/minecraft -s /bin/bash -c "Minecraft Server" minecraft; chown minecraft /srv/minecraft; passwd minecraft
Now you can sign in to your server's ssh as the user "minecraft" with the password you selected earlier. Once you sign in, you will automatically go to the /srv/minecraft directory we set up before. Run this command and you should be good to go:
Code:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
Installing and setting up SRCDS for source games
So you want to install a server for one of the popular source games? Let's start up the installation then! Let's make the default srcds folder:
Code:
mkdir /srv/srcds
Install "ncompress" a dependencies for hldsupdatetool:
Code:
yum install ncompress
Make the "srcds" user and assign it to the srcds folder:
Code:
/usr/sbin/useradd -d /srv/srcds -s /bin/bash -c "SRCDS" srcds; chown srcds /srv/srcds; passwd srcds
Now log in to the "srcds" account on your ssh, once you get in run this command:
Code:
wget http://storefront.steampowered.com/download/hldsupdatetool.bin; chmod u+x hldsupdatetool.bin; ./hldsupdatetool.bin
Follow the instructions and once it tells you that it finished extracting steam.tar.Z enter this command:
Code:
./steam
Once that command is finished installing the steam linux files (which you may need to install the previous command a few times) you'll want to install one of the games. Here is a list of the games you can install, and the command to install them:
Click here for the list of game names
Code:
./steam -command update -game "<game id>" -dir /srv/srcds
Once you're done with this, you can run the game using these command:
Code:
cd orangebox
./srcds_run -console -game <game id> -port 27015 +maxplayers <amount of player> +map <map name>
Thanks for reading! Let me know if you have any trouble!