Gameserver Ports

Your gameserver has its main “port” used to connect to your game. If there are any other ports they are listed here and are based on your “server port”.
Serverport 2302 .. if the query port is “+1” it would be the serverport 2302 + 1 = 2303 .. if the steam port is +2 it would be the serverport 2302 +2 which is 2304
For almost all servers, the QUERY port will be either the same as the serverport or it will be the serverport +1

GameServerDefaut PortQuery PortRcon PortWeb PortOther

Rsync Configuration

To install a game using rsync, the game.xml file must have this line

Install the Rsync service on Ubuntu with
apt-get install rsync
Create /etc/rsyncd.conf and put the following entries:

use chroot = yes
read only = yes
path = /var/www/files/rsync
comment = RSYNC source of game installs
log file = /var/www/html/panel/rsyncd.log
dont compress = *.pk3
refuse options = delete

Change to the rsync games directory, where all current available games folders are located, as listed in the rsyncd.conf (/var/www/files/rsync)
Create a new folder for this game, in order to find out the correct name, you will need to look at the XML file and use the “query name” . I have an easier method using the Game Key which is unique and has the same name as the xml file usually.
For example, the cstrike_linux32.xml will by default be installed into a folder named halflife. My method will install into cstrike_linux32. Its up to you, its a simple edit.

Change to the new game folder, then create a folder for each OS, Linux and Windows, for example: cstrike_linux32/linux and put the files of the game server for each OS inside its respective OS folder.

At some point you will need to install the actual games into the game folders. I create a script that will update all the files at once. This is part of that script that downloads the Terraria server into our Rsync folders. At the bottom of the files I run the script that will update our sizes.list and rsync.list and then copies them to the panel.

cd /var/www/files/rsync/terraria_linux
mv 1353/Linux linux
rm -r 1353
cp serverconfig.txt linux/

cd /var/www/files/rsync

Now lets start the Rsync daemon and then set rsync to start when the system reboots

systemctl start rsync
systemctl enable rsync

Now lets test if the rsync is running , you should get the Name and Desc from the rsync.conf file

rsync -rdt rsync://localhost:873/

Overwrite sizes.list and rsync.list at modules/gamemanager/ with your custom files.
To do this we need to CREATE these two files first. So in your Linux terminal browse to the folder you have your rsync files located (/var/www/files/rsync) and enter these two commands. You MUST run them EVERY TIME you add or update your rsync files.
The first line creates your sizes.list.
The second line creates your rsync.list
These two files MUST be copied into the gamemanager module of your OGP panel.

du -sLlk /| awk '{print $2";"$1}'>sizes.list
ls -d1 */|tr -d />rsync.list

Add your rsync domain or ip, and location, to modules/gamemanager/rsync_sites_local.list|My Local Rsync Server

Automatic Backups of Agents

Create a key on a server

ssh-keygen -t rsa -b 2048

Login to the other server to copy the key


Then connect with rsync We want to PULL the files from remote onto local

rsync -ar --delete -e ssh user@server:/source/ /localbackup/

If servers have backup space, use that. Put these commands into a Crontab to execute daily

On Germany backup Kansas
rsync -ar --delete -e ssh /home/backup/kansas/
On Kansas backup Germany 
rsync -ar --delete -e ssh /home/backup/germany/

Also we need to keep our local ADDONS folder in /var/www/html so we can access the files with a link. Rsync those among like machines by using crontab. Using this method, if we make changes on our master SERVER, kansas it will be replicated

on Germany, backup Kansas
rsync -ar --delete -e ssh /var/www/html/addons/
Repeat on all other like servers so all LINUX servers have identical and all WINDOWS servers have identical and should point to the main repository

Agent Installation

Install Linux Agent

Upgrade server to latest ubuntu 64bit
There can be issues with libc6 on 16.04 and we need newer versions of Java etc so Ubuntu 18 is best

apt-get update  
dpkg --add-architecture i386
apt-get install gcc libxml-parser-perl libpath-class-perl perl-modules screen rsync sudo openjdk-8-jre-headless e2fsprogs unzip subversion libarchive-extract-perl pure-ftpd libarchive-zip-perl libc6 libgcc1 git curl libc6-i386 libgcc1:i386 lib32gcc1 libhttp-daemon-perl php5 php-cgi python apache2 mysql-server phpmyadmin nano libstdc++6:i386 libcurl3-gnutls:i386 libtinfo5:i386 libncurses5:i386 libc6 lib32gcc1 lib32stdc++6 libc6:i386 libtbb2:i386 python-mysqldb

If in the panel, you enable REMOTE QUERY. then php-cgi MUST be installed on the agent server.(it is above)

Manual install Linux agent to use custom name and locations
Agent name should be ‘gameserver’, install into /home/gameserver folder


Easy installer uses ogp-agent as name and puts files in /usr … this is NOT preferred

wget -N "" -O "ogp-agent-latest.deb"

sudo dpkg -i "ogp-agent-latest.deb"

adduser “gameserver” , then usermod -aG sudo “gameserver”

edit /etc/ssh/sshd_config to deny root login with ssh and restart ssh.
Login with gameserver via ssh

If running IPtables to stop intrustions. Will have to add all the ports for each game. Below has the Source games


# Allow all loopback (lo0) traffic and reject traffic
# to localhost that does not originate from lo0.
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -s -j REJECT

# Allow ping.
-A INPUT -p icmp -m state --state NEW --icmp-type 8 -j ACCEPT

# Allow SSH connections.
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Allow the Steam client.
-A INPUT -p udp -m udp --sport 27000:27030 --dport 1025:65355 -j ACCEPT
-A INPUT -p udp -m udp --sport 4380 --dport 1025:65355 -j ACCEPT

# Allow inbound traffic from established connections.
# This includes ICMP error returns.

# Log what was incoming but denied (optional but useful).
-A INPUT -m limit --limit 3/min -j LOG --log-prefix "iptables_INPUT_denied: " --log-level 7
-A FORWARD -m limit --limit 3/min -j LOG --log-prefix "iptables_FORWARD_denied: " --log-level 7

# Reject all other inbound.



# Provides:          ogp_agent
# Required-Start:    $all
# Required-Stop:     $all
# Should-Start:      $all
# Should-Stop:       $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start and stop the OGP Agent
# Description:       Start and stop the OGP Agent


# main()

if [ "X`whoami`" != "Xroot" ]
        exit 1

start() {
        if [ -e "$agent_dir/" ]
                pid=$(cat $agent_dir/
                out=$(kill -0 $pid > /dev/null 2>&1)
                if [ $? == 0 ]
                        exit 1

        # Lets the agent user to use sudo to enable FTP accounts and use renice and taskset.
        if [ "$( groups $agent_user | grep "\bsudo\b" )" == "" ]
                if [ "$( egrep -i "^sudo" /etc/group )" == "" ]
                        groupadd sudo >/dev/null 2>&1
                usermod -aG sudo $agent_user >/dev/null 2>&1

        user_id=$(id -u $agent_user)
        group_id=$(id -g $agent_user)
        out=$(chown -Rf $user_id:$group_id $agent_dir >/dev/null 2>&1)

        # Lets the agent user to attach screens.
        if [ "$(groups $agent_user|grep -o "\stty\s")" == "" ]
                usermod -aG tty $agent_user >/dev/null 2>&1

        out=$(chmod g+rw /dev/pts/* >/dev/null 2>&1)
        out=$(chmod g+rw /dev/tty* >/dev/null 2>&1)

        # Check the FTP status
        if [ -f "/etc/init.d/pure-ftpd" ] && [ -d "/etc/pure-ftpd/conf" ]
                echo no > /etc/pure-ftpd/conf/PAMAuthentication
                echo no > /etc/pure-ftpd/conf/UnixAuthentication
                echo yes > /etc/pure-ftpd/conf/CreateHomeDir

                if [ ! -f /etc/pure-ftpd/pureftpd.passwd ]
                        touch /etc/pure-ftpd/pureftpd.passwd

                if [ ! -f /etc/pureftpd.passwd ]
                        ln -s /etc/pure-ftpd/pureftpd.passwd /etc/pureftpd.passwd

                if [ ! -f /etc/pure-ftpd/auth/50pure ]
                        ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/50pure

                if [ ! -f /etc/pureftpd.pdb ]
                        ln -s /etc/pure-ftpd/pureftpd.pdb /etc/pureftpd.pdb
                out=$(pure-pw mkdb >/dev/null 2>&1)
                out=$(service pure-ftpd force-reload >/dev/null 2>&1)

        cd $agent_dir
        out=$(su -c "screen -d -m -t ogp_agent -c ogp_screenrc -S ogp_agent ./ogp_agent_run -pidfile" $agent_user >/dev/null 2>&1)
        exit 0

stop() {
        if [ -e "$agent_dir/" ]
                pid=$(cat $agent_dir/
                kill -0 $pid > /dev/null 2>&1
                if [ $? == 0 ]
                        kill $pid >/dev/null 2>&1
                        exit $?
                exit 1
        exit 0

case "${1:-''}" in
        sleep 1
        echo "Usage: service ogp_agent start|stop|restart"
        exit 1

Install Windows Agent

Filezilla issues:
Rightclick on the Filezilla Server service, and choose “Properties”, find the section called “Logon” , after that change the password for that password you use to login with cygwin.
When installing the Agent select same custom options as Linux.

Task Manager may be configured to stop running agent after 3 days.

Remove the Agent

First stop the agent via: sudo service ogp_agent stop (or sudo /etc/init.d/ogp_agent stop) You’ll need to remove the ‘lock’ on protected files: sudo chattr -iR /home/ogp_agent/OGP_User_Files/* Next you can delete the OGP user: sudo userdel -rf ogp_agent (which will also remove all the game-server files)

As for the agent files: sudo rm -rf /usr/share/ogp_agent

You’ll need to remove the start up scripts also.

sudo update-rc.d -f ogp_agent remove sudo rm /etc/init.d/ogp_agent

After that, you can try ‘sudo locate ogp_’ (after sudo updatedb, and if the locate package is installed) to see if everything is removed. Some helpful pages on installing game servers.

OGP Panel

Panel Installation

Website Panel:
this server should be a linux machine running Apache2, MySQL, phpMyadmin, and Rsync

Prepare the Linux server by installing this software.

sudo apt-get install apache2 curl subversion php7.0 php7.0-gd php7.0-zip libapache2-mod-php7.0 php7.0-curl php7.0-mysql php7.0-xmlrpc php-pear phpmyadmin mysql-server php7.0-mbstring php-gettext git php-bcmath rsync nano

Create your Database by browsing to the phpmyadmin page. Login with your root account and create a “local user” with all privileges to the Database.

Download the panel files,
unzip, copy to your /var/www/html folder and install by browsing to the websites install.php file.
You will need your Database information to continue: DB name, User name, User password