[Tool/Web/Other] Open Game Panel
#1


http://opengamepanel.org
For support visit the OGP Forum!
Permission to post this by OGP Developer Tyger
OGP is a game server control panel. It uses a web interface (PHP/MySQL) that controls an agent (Perl) running on the servers hosting your games. It is used to start/stop/monitor game server instances. More features like a config file editor are coming soon.

It allows users to administer a game server without having shell access. Panel admins can lock down various features to users, like limit which IPs or ports can be used for each game.

Games can be assigned a specific cpu priority (with nice) and on multi cpu boxes, a game can be assigned to a specific CPU, allowing admins to balance servers across CPU cores.

Games are started as the user who owns them. So the agent will see that a given Counter-Strike server is owned by user 'greg'. It will launch the game server as 'greg'. That way, if greg were to SSH or FTP to the server to collect log files or edit a config etc...the files will still be owned by him, and he'll have access to all the files. This is also useful if admins enforce some kind of user based qutoa policy like disk quota or ulimit settings in Linux/Unix.

Game installations can be cloned from the panel, making it easy to provision new game servers from base templates.

Steam based games can be installed or updated using the steam client from the web interface.

If the server is rebooted, the agent will restart the game servers that were running when the reboot occured.

Open Game Panel is designed around the idea that many different people can use the panel to control many different servers. It can be used for gaming clans, Game Hosting Companies, and individual users alike.


OGP Agent
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.

Prerequisites for Agent

Debian/Ubuntu
Code:
sudo apt-get install libxml-parser-perl libpath-class-perl libarchive-any-perl screen pure-ftpd pure-ftpd-common rsync sudo e2fsprogs
*** For 64bit server install ia32-libs in order to run steam****
Code:
sudo apt-get install ia32-libs
CentOS
Install repository 'Extra Packages for Enterprise Linux'
Centos 5:

Code:
wget http://dl.fedoraproject.org/pub/epel/5/i...8151239rpm -Uvh epel-release-5-4.noarch.rpm
rm -f epel-release-5-4.noarch.rpm
Centos 6:
Code:
wget http://dl.fedoraproject.org/pub/epel/6/i...8151239rpm -Uvh epel-release-6-8.noarch.rpm
rm -f epel-release-6-8.noarch.rpm
Install Packages:
Code:
yum -y install sudo perl-ExtUtils-MakeMaker perl-XML-Parser perl-Path-Class perl-Archive-Tar perl-Archive-Zip perl-Archive-Extract screen ncompress pure-ftpd rsync
*** 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 ****
Code:
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:
Code:
rm -f /var/lock/subsys/ogp_agent
Code:
chkconfig --levels 235 ogp_agent on
Fedora 13
Code:
sudo yum install perl-XML-Parser perl-Path-Class perl-Archive-Extract screen perl-ExtUtils-MakeMaker ncompress
OpenSUSE 11.3
Code:
sudo zypper install perl-Path-Class screen
Gentoo
For the Perl XMLRPC stuff (for the agent) All you have to do is
Code:
emerge dev-perl/frontier-rpc
Agent Installation
First you need to download the agent with subversion.
Code:
svn co svn://svn.code.sf.net/p/hldstart/code/trunk/agent/ agent
cd agent
Next you need to 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.
Code:
sudo adduser wanted_username
Next you need to 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.

Code:
# (chmod if needed)
sudo bash ./install.sh
Now you need to follow the 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

Code:
sudo /etc/init.d/ogp_agent start
or as a cmdline app
Code:
cd /home/<username>/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:

* CentOS 5 * Run following command as root: chkconfig ogp_agent on

* Debian 5 * Run following command as root: $ update-rc.d ogp_agent defaults

* OpenSUSE 11.3 * Run following command as root: $ chkconfig --add ogp_agent

On ... (Instructios for other systems still to be done.)

*** 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:

$ sudo 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
Code:
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'.
WebUI
Prerequisites for WebUI
Ubuntu
Install the mysql server
Code:
sudo apt-get install mysql-server
Install PHP and required php extensions
Code:
sudo apt-get install php5 php5-gd php5-xmlrpc php5-curl php5-mysql php-pear php5-json curl
Install Apache 2
Code:
sudo apt-get install apache2
Or install lighttpd
Code:
sudo apt-get install lighttpd
If you are using Apache 2
Code:
sudo /etc/init.d/apache2 restart
... or if you are using lighttpd:
Code:
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:

Code:
wget http://dl.fedoraproject.org/pub/epel/5/i...8151239rpm -Uvh epel-release-5-4.noarch.rpm
rm -f epel-release-5-4.noarch.rpm
Centos 6:
Code:
wget http://dl.fedoraproject.org/pub/epel/6/i...8151239rpm -Uvh epel-release-6-8.noarch.rpm
rm -f epel-release-6-8.noarch.rpm
Install Packages:
Code:
yum -y install httpd php php-xmlrpc php-xml php-mysql php-gd mysql-server php-pear curl
pecl install json
Add services to system startup:
Code:
chkconfig --levels 235 httpd on
chkconfig --levels 235 mysqld on
Disable Selinux:
Code:
sed -i 's|SELINUX=enforcing|SELINUX=disabled|' /etc/selinux/config
setenforce 0
Disable Firewall:
Code:
service iptables save
service iptables stop
chkconfig iptables off
Restart Web Services:
Code:
service mysqld restart
service httpd restart
Gentoo
For XMLRPC stuff for PHP, you need to make sure you have the following USE flags added in /etc/make.conf:
Code:
simplexml sockets php mysql xmlrpc pcre
Then run emerge php. If it's already installed, emerge it again to pickup the new use flags.
Install WebUI
Code:
svn co svn://svn.code.sf.net/p/hldstart/code/trunk/upload/ upload
Next you need to move the pages to the directory from which your http server finds the pages, e.g.,
Code:
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 tested [Debian should work]
Code:
sudo apt-get install wine fluxbox vnc4server
Fedora tested [RH/Centos should work]
Code:
yum install wine fluxbox vnc-server
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.
Type:
Code:
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:
Code:
vncserver -geometry 800x600 -depth 24
and stop it
Code:
vncserver -kill :1
You need to edit the file ~/.vnc/xstartup. Can edit with any other text editor:
Code:
nano ~/.vnc/xstartup
and add 'fuxbox &' at the end of that file, if it exist, you should replace any other window manager:
Code:
#!/bin/sh
fluxbox &
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
Code:
sudo nano /etc/init.d/ogp_vnc
And copy this lines into /etc/init.d/ogp_vnc file:
Code:
#!/bin/sh

#
#   Startup/shutdown script for the VNC server.
#
#   Linux chkconfig stuff:
#
#   chkconfig: 2345 88 10
#   description: Startup/shutdown script for the OGP Agent

agent_user=ogp_agent
service=ogp_vnc

# 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
fi

start() {
    # start daemon
    echo -n "Starting OGP Agent WINE VNC: "
    su -c "vncserver -geometry 800x600 -depth 24" $agent_user &> /dev/null &
    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" $agent_user &> /dev/null &
    RETVAL=$?
    [ $RETVAL -eq 0 ] && rm -f /var/lock/$service
    echo success
    return $RETVAL
}

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

exit $RETVAL
You need to change in agent_user=agent with your user for ogp_agent.
then make it executable:
Code:
sudo chmod +x /etc/init.d/ogp_vnc
and add it as a startup service:
Ubuntu/Debian
Code:
sudo update-rc.d ogp_vnc defaults
Fedora/Centos/RH
Code:
sudo chkconfig ogp_vnc on
Now you can start your service
Code:
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 xxxxx is your ogp agent ip).
Reply
#2

Wrong place bro

EDIT: Sorry my bad, havent been on this forum for a LOOONG time
Reply
#3

Quote:
Originally Posted by damiantof7
View Post
Wrong place bro

EDIT: Sorry my bad, havent been on this forum for a LOOONG time
It's cool man
Reply
#4

Its not working with me if you can help me post your skype or ******** here
Reply
#5

Quote:
Originally Posted by KhaledElkhourashi
View Post
Its not working with me if you can help me post your skype or ******** here
Read it carefully. It works like a charm.
Reply
#6

How can I install SAMP on it? would you like to add a tutorial about how to setup the SAMp server on it? coz what you gave us is the only way to install the panel, without connecting it with the game
Reply
#7

I'm trying it right now, not bad.
Reply
#8

Quote:
Originally Posted by KhaledElkhourashi
View Post
Its not working with me if you can help me post your skype or ******** here
What ever if not working for you post it on the OGP forum to get help from the developers.

Quote:
Originally Posted by Naruto_Emilio
View Post
How can I install SAMP on it? would you like to add a tutorial about how to setup the SAMp server on it? coz what you gave us is the only way to install the panel, without connecting it with the game
If I find the time I will do one for SAMP and Teamspeak but people are busy IRL
Reply
#9

Nice OGP Tutorial +1
Reply
#10

Nice
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)