This topic was published by DevynCJohnson and viewed 1129 times since "". The last page revision was "".
- Topics - 444
There are many kinds of servers, but one type that some people may not know how to setup are game servers. Linux is suitable to be a game server, but how would one be setup? Setting up Linux game servers is easy. However, each game must be setup differently, but there is a general way of doing so.
First, select a suitable computer. Nothing high-quality is required. A standard desktop/laptop will work. Then, select a distro that works for your system (http://www.linux.org/threads/which-distro-is-right-for-me.4834/). For easy game setup, a Debian system is better because many PPAs and ready made *.deb files are available. Also, Debian-based distros are easier for most people to setup. In general, I recommend Xubuntu or Lubuntu because they are lightweight distros based on Ubuntu. However, if you are an experienced Linux user that wants optimal performance, use a Slackware-based system such as Slackware itself. Slackware is a powerful and lightweight system, more so than most Debian-based systems. What ever you decide to use, it must have a GUI. I say this because most game servers cannot be setup via command-line.
Every game is different, but they follow a pattern. I will discuss a few different game servers. That should then give a general idea on how others would be setup.
Minetest is an open-source game based on Minecraft. Minetest can be installed via
sudo apt-add install minetest. Open Minetest and click the "Advanced" tab. Click "Create World" and select a name for your world. Also, select "Minetest" to be the game type. Once done, click "Create". Use the check boxes to setup the desired features. On the top of the screen, make your username and password. Also, enter your IP address and the port number you wish people to use. If you do not know your IP address, then go to Google and type "what is my ip". This is the IP address your ISP gave you. If the server is meant to be a local server (127.0.0.1), then leave that field blank. Once done, click "Start Game / Connect". Give people your IP address and allow them to login.
To login, go to the "Multiplayer" tab and enter in the address and port of the desired server. Next, make your username and password (do not forget them).
This server is meant for a small group of people. This game does not support large public games like Minetest can support.
To install 0AD, use this command (with Root privileges) -
add-apt-repository ppa:wfg/0ad && apt-get update && apt-get install 0ad. This will add the 0AD repository and install 0AD.
NOTE: 0AD is in the standard repositories, but the one that we are adding contains the newest stable versions before the standard repositories.
To setup a server, click "Multiplayer -> Host Game". Then, enter in your name, not the server's name. The server does not use a name. Instead, it will use your IP address. Next, give the desired players your IP address. Generally, users have some way of passing out the IP address ahead of time. If you do not know your IP address, then go to Google and type "what is my ip". This is the IP address your ISP gave you. Next, after the players have logged in, setup the game as you would if you were playing a local game against the computer. Then, enjoy yourself and beat the other players.
To log in to a 0AD server after receiving the IP address, on the main menu, click "Multiplayer -> Join Game". Then, enter the IP address and make yourself a username. The admin will then set up the game. Then, enjoy the game.
Alien Arena Server
To install Alien Arena, use this command on Debian systems (with Root privileges) - "apt-get install alien-arena".
To setup an Alien Arena server, on the main menu, click "Host Server". Setup the options as desired. Make a suitable hostname that is easy to remember. Click begin and enjoy.
To join a server, on the main menu, click "Join Server" and select the desired hostname. Remember, you must already have a username and character made. Once you have successfully joined and started a game, kill the other players and win the game.
Other Servers are Similar
One you understand how to setup these servers, then others are easy to figure out. For example, an OpenArena server is setup mostly the same as an Alien Arena server. In general, find a "multiplayer" or "server" button and answer the questions and setup the desired options.
Users cannot access the server -
1. This may be a firewall issue. To fix this, make the firewall allow UDP and TCP traffic on the port you are using. This can be done with this command in a terminal (with Root privileges) -
iptables -A INPUT -p all --dport YOUR_PORT -j ACCEPT; iptables -A OUTPUT -p all --dport YOUR_PORT -j ACCEPT; iptables-save
Replace "YOUR_PORT" with the port number for your server. The iptables command is used to manage firewalls which are networking software used to control traffic by allowing/disallowing incoming or outgoing messages. In the mentioned command, "-A INPUT" means add a rule for incoming traffic and "OUTPUT" refers to outgoing traffic. "-p all" means all protocols. "--dport YOUR_PORT" means the port you specify. "-j ACCEPT" means allow what ever it is you specified. If you were to reboot the system, these setting would be lost, so the "iptables-save" command is used to save the changes you have made.
2. Make sure the game is still running on your system. Did it crash or did you close it?
3. Make sure you gave out the correct IP address and port number.
4. Have the clients use the same firewall commands you used.