Installation Notes

DieFeM

Please read these instructions carefully as you do not need to execute every command that is in this page.

Installing the agent to a remote server. For this you need to have computer with some Linux distribution installed. You also need to have either remote (e.g., SSH) or local terminal connection to this machine.

Table of Contents

Prerequisites for agent

Debian/Ubuntu

sudo apt-get install libxml-parser-perl libpath-class-perl perl-modules screen pure-ftpd rsync sudo e2fsprogs subversion unzip
# The next package, the Perl module "Archive Extract", is already bundled  
# under the package "perl-modules" in some distributions, for example on Debian 7.
# If you see "E: Unable to locate package libarchive-extract-perl" it probably means
# that you don't need to install it.
sudo apt-get install libarchive-extract-perl
# On some Debian based distributions you would need to install libarchive-zip-perl:
sudo apt-get install libarchive-zip-perl

For 64bit server install ia32-libs in order to run steam

sudo dpkg --add-architecture i386 # ONLY DEBIAN 7
sudo apt-get update 
sudo apt-get install ia32-libs

CentOS

  • Install repository 'Extra Packages for Enterprise Linux'

CentOS 5

wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
rm -f epel-release-5-4.noarch.rpm

CentOS 6

wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
rm -f epel-release-6-8.noarch.rpm

CentOS 7

wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -Uvh epel-release-7-5.noarch.rpm
rm -f epel-release-7-5.noarch.rpm
  • Install Packages

All CentOS

yum -y install sudo perl-ExtUtils-MakeMaker perl-IO-Compress-Bzip2 perl-XML-Parser perl-Path-Class perl-Archive-Tar perl-Archive-Zip perl-Archive-Extract perl-HTTP-Daemon perl-LWP-Protocol-https screen ncompress pure-ftpd rsync subversion unzip

To run the new Steam client, steamcmd, and some games on the minimal distribution of CentOS 6.x 64bit you will need the next packages

yum -y install sudo libstdc++.i686 zlib.i686 ncurses-libs.i686 compat-readline5.i686 sqlite.i686

Note that you will get a subsystem lock error, this can be fixed by removing the lock and add ogp to startup:

rm -f /var/lock/subsys/ogp_agent

chkconfig --levels 235 ogp_agent on

Fedora 13

sudo yum install perl-XML-Parser perl-Path-Class perl-Archive-Extract screen perl-ExtUtils-MakeMaker ncompress

Gentoo

emerge dev-perl/frontier-rpc

OpenSUSE 11.3

sudo zypper install perl-Path-Class screen

Agent Installation

First you need to download the agent with subversion:

svn co svn://svn.code.sf.net/p/hldstart/svn/trunk/agent/ agent
cd agent

Create a user for the agent, only if you do not want to use an existing user account for this. The user can be added in most of the linux systems with following command. #####

sudo adduser wanted_username

Start the actual installation, for this you need to have rights to run sudo or you can also run this command as root user.

_ NOTE: Installation can be done also as non-root user (running the command below without sudo), but then you are not able to install the init script and agent will not be able to start when your Linux machine boots. _

(chmod if needed)

sudo bash ./install.sh

_ Follow on screen instructions.
During the installation you should not need to change any other information than your username (username must be a regular user, not root) and encryption key. Rest of the settings should be required only for advanced setups. _

After the installation you can start the agent to the background

cd /etc/init.d
sudo ./ogp_agent start

or as a cmdline app

su - <username>
cd OGP
perl ./ogp_agent.pl --log-stdout

After you confirm that the agent starts up fine, i.e., you should see agent started line, you can stop the agent by pressing ctrl+c. After this you can set the agent to start during the boot:

Startup script

CentOS 5/6

Run following command as root:

chkconfig ogp_agent on

Ubuntu/Debian

Run following command as root:

update-rc.d ogp_agent defaults 30
  • OpenSUSE 11.3

Run following command as root:

chkconfig --add ogp_agent

NOTES

If you get following error when the steam package is being extracted by the agent:

sh: uncompress: command

You can fix the problem by creating a symbolic link from gzip to uncompress as root:

ln -s /bin/gzip /bin/uncompress

NOTE: The location of gzip might vary depending on the distribution so check the location with the following command:

which gzip

PureFTPd Settings

PureDB /etc/pure-ftpd/pureftpd.pdb
BrokenClientsCompatibility yes
NoAnonymous yes
PAMAuthentication no
CreateHomeDir yes

NOTE: To be able to manage the ftp users and firewall settings the agent user should be in the sudoers list, usually '/etc/sudoers'.


Prerequisites for WebUI

Ubuntu

Install the mysql server:

sudo apt-get install mysql-server

Install PHP and required php extensions:

sudo apt-get install php5 php5-gd php5-xmlrpc php5-curl php5-mysql php-pear curl

Install Apache 2:

sudo apt-get install apache2

Or install lighttpd:

sudo apt-get install lighttpd

If you are using Apache 2

sudo /etc/init.d/apache2 restart

... or if you are using lighttpd:

sudo apt-get install php5-cgi
sudo lighttpd-enable-mod fastcgi
sudo /etc/init.d/lighttpd restart 

CentOS

Install repository 'Extra Packages for Enterprise Linux'

CentOS 5

wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
rm -f epel-release-5-4.noarch.rpm

CentOS 6

wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
rpm -Uvh epel-release-6-7.noarch.rpm
rm -f epel-release-6-7.noarch.rpm

CentOS 7

wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -Uvh epel-release-7-5.noarch.rpm
rm -f epel-release-7-5.noarch.rpm

All CentOS (5, 6, 7)

yum -y install httpd php php-xmlrpc php-xml php-mysql php-gd mysql-server php-pear php-mbstring curl

Note that in CentOS 7 must install mariadb-server instead of mysql-server

Add services to system startup:

chkconfig --levels 235 httpd on
chkconfig --levels 235 mysqld on

_ WARNING, At CentOS 7 you must use: _

systemctl enable mariadb.service

_ instead of chkconfig --levels 235 mysqld on _

Disable Selinux

sed -i 's|SELINUX=enforcing|SELINUX=disabled|' /etc/selinux/config
setenforce 0

Disable Firewall

service iptables save
service iptables stop
chkconfig iptables off

WARNING , In CentOS 7 disable firewall with:

systemctl stop firewalld 
systemctl disable firewalld

Restart Web Services

service mysqld restart
service httpd restart

Gentoo

simplexml sockets php mysql xmlrpc pcre

Then run emerge php. If it's already installed, emerge it again to pickup the new use flags.

WebUI Installation

Get WebUI Files:

svn co svn://svn.code.sf.net/p/hldstart/svn/trunk/upload/ upload

Next you need to move the pages to the directory from which your http server finds the pages, e.g.,

mv upload ~/public_html/ogp

After this you can start the installation process by opening the install.php with your web browser.


Running Windows® based game servers on Linux™ using WINE.

In order to run windows applications on linux you will need to install wine, That windows aplications should need a desktop environment, so it is a server, we will need a light weight windows manager, so fluxbox is a good one, also we will need a way to access this desktop, so we will use a vnc server.

Needed packages

Ubuntu

sudo apt-get install wine fluxbox vnc4server

Fedora / CentOS / Red-Hat

yum install wine fluxbox vnc-server

Setup VNC password and Fluxbox

After installing the needed packages you should setup a password for your VNC server. It will prompt asking for a password for VNC login on the current account, so log into the OGP user account before set the VNC password.

If your agent user is ogp_agent do:

sudo su - ogp_agent

Type:

vncpasswd

Before start to use this VNC server we need to setup it to start fluxbox when the server starts, We will start the server a first time, so it will create the default config files:

vncserver -geometry 800x600 -depth 24

and stop it

vncserver -kill :1

You need to edit the file ~/.vnc/xstartup. Can edit with any other text editor:

nano ~/.vnc/xstartup

and add 'fluxbox &' at the end of that file.
You must replace any other window manager if any (usually "x-window-manager &" by default).

Now you can go back to your administrator account or root:

exit

Create a startup script

Now we need create a service to start and stop VNC on startup and shuting down respectively. So we need a new file in to /etc/init.d/ called ogp_vnc

sudo nano /etc/init.d/ogp_vnc

And copy this lines into /etc/init.d/ogp_vnc file:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
#!/bin/sh
#
#   Startup/shutdown script for the VNC server.
#
#   Linux chkconfig stuff:
#
#   chkconfig: 2345 88 10
#   description: Startup/shutdown script for the OGP Agent
#
### BEGIN INIT INFO
# Provides:          ogp_vnc
# Required-Start:    $network $local_fs
# Required-Stop:     $local_fs $network
# Should-Start:      $local_fs $network 
# Should-Stop:       $local_fs $network 
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start and stop the VNC server for OGP Agent
# Description:       Start and stop the VNC server for OGP Agent
### END INIT INFO
#
set -e
set -u
${DEBIAN_SCRIPT_DEBUG:+ set -v -x}

agent_user=ogp_agent
service=ogp_vnc.service

# Source function library.
if [ -f /etc/rc.d/init.d/functions ] ; then
    . /etc/rc.d/init.d/functions
elif [ -f /etc/init.d/functions ] ; then
    . /etc/init.d/functions
elif [ -f /lib/lsb/init-functions ] ; then
    . /lib/lsb/init-functions
fi

start() {
    # start daemon
    echo -n "Starting OGP Agent WINE VNC: "
    su -c "vncserver :1 -geometry 800x600 -depth 24 >/dev/null 2>&1" $agent_user
    RETVAL=$?
    if [ $RETVAL -eq 0 ]; then
       touch /var/lock/$service
       echo success
    else
       echo fail
    fi
    return $RETVAL
}

stop() {
    # stop daemon
    echo -n "Stopping OGP Agent WINE VNC: "
    su -c "vncserver -kill :1 >/dev/null 2>&1" $agent_user
    RETVAL=$?
    if [ $RETVAL -eq 0 ]; then 
       rm -f /var/lock/$service
       echo success
    else
       echo fail
    fi
    return $RETVAL
}

case "$1" in
    start)
    start
    RETVAL=$?
    ;;
    stop)
    stop
    RETVAL=$?
    ;;
    restart)
    stop
    sleep 1
    start
    RETVAL=$?
    ;;
    condrestart)
    if [ -f /var/lock/$service ]; then
       stop
       RETVAL=$?
       if [ $RETVAL -eq 0 ]; then
          start
          RETVAL=$?
       fi
    fi
    ;;
    status)
    status $service
    RETVAL=0
    ;;
    *)
    echo "Usage: $service {start|stop|restart|condrestart|status}"
    RETVAL=1
    ;;
esac

exit $RETVAL

You need to change in agent_user=agent with your agent user.

then make it executable:

sudo chmod +x /etc/init.d/ogp_vnc

Run the script at system boot

Ubuntu / Debian

sudo update-rc.d ogp_vnc defaults

Fedora / CentOS/ Red-Hat

sudo chkconfig ogp_vnc on

Now you can start your service

sudo /etc/init.d/ogp_vnc start

To connect to your vnc server you should use xx.xx.xx.xx:1 and your vnc password.(Where xx:xx:xx:xx is your ogp agent ip).


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks