Getting Started with Server

From RAGE Multiplayer Wiki
Revision as of 14:14, 12 November 2017 by Adam (talk | contribs) (Created page with "__TOC__ == Introduction == This short tutorial will show you how to run a RageMP server on Linux distributions. By default, RageMP makes use of port 22005 UDP for server acc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

This short tutorial will show you how to run a RageMP server on Linux distributions.

By default, RageMP makes use of port 22005 UDP for server access so make sure that it is unblocked before starting your server

Installing GCC 6

Debian, Ubuntu, and derivatives

Ubuntu 16.04

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-6 g++-6

Setting up the server

Debian, Ubuntu, and derivatives

# Downloading server
cd /tmp
wget https://cdn.rage.mp/lin/server
mkdir ~/ragemp_server
mv server ~/ragemp_server
cd ~/ragemp_server 
chmod +x server
./server

# Firewall commands (iptables only) (dont forget to save the rule after adding it)
iptables -A INPUT -p udp --dport 22005 -j ACCEPT

CentOS 7, Fedora 19 (and later), and derivatives

# Downloading server
cd /tmp
wget https://cdn.rage.mp/lin/server
mkdir ~/ragemp_server
mv server ~/ragemp_server
cd ~/ragemp_server 
chmod +x server
./server

# Firewall commands (iptables only) (dont forget to save the rule after adding it)
iptables -A INPUT -p udp --dport 22005 -j ACCEPT

Using screen for running the server in background

Setting up

Debian, Ubuntu and derivatives

sudo apt-get install screen

CentOS 6.x/7.x

yum install screen

Starting the server

screen -dmS RAGEMPSERVER -L bash -c 'cd ~/ragemp_server && ./server' &

# Parameter explanation
# screen -dmS = starts a separate shell without directly opening an interface towards it (detached mode). The S param defines a session name for the newly created session, so that it is easier to manage in the future.
# screen -L = basically logs whatever error that is shown by the server through the separate shell into a file for easier reference in the future.
# !IMPORTANT!
# Log output will be saved as screenlog._number_ in the server directory.
# &: IS IMPORTANT IF YOU WANT TO TERMINATE THE PROCESS GRACEFULLY

Stopping the server

RECOMMENDED:

kill $(ps h --ppid $(screen -ls | grep RAGEMPSERVER | cut -d. -f1) -o pid)

NOT RECOMMENDED: It does not shut down the server gracefully

screen -S RAGEMPSERVER -X quit

Troubleshooting