Author Topic: Open Game Panel - Supports VC:MP & Is Free!  (Read 9449 times)

0 Members and 1 Guest are viewing this topic.

Offline Aldo

  • Wiseguy
  • **
  • Posts: 52
    • View Profile
Open Game Panel - Supports VC:MP & Is Free!
« on: September 15, 2013, 09:56:49 pm »

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: [Select]
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: [Select]
sudo apt-get install ia32-libs
CentOS
Install repository 'Extra Packages for Enterprise Linux'
Centos 5:

Code: [Select]
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:
Code: [Select]
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
Install Packages:
Code: [Select]
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: [Select]
yum -y install sudo libstdc++.i686 zlib.i686 ncurses-libs.i686 compat-readline5.i686 sqlite.i686Note that you will get a subsystem lock error, this can be fixed by removing the lock and add ogp to startup:
Code: [Select]
rm -f /var/lock/subsys/ogp_agent
Code: [Select]
chkconfig --levels 235 ogp_agent onFedora 13
Code: [Select]
sudo yum install perl-XML-Parser perl-Path-Class perl-Archive-Extract screen perl-ExtUtils-MakeMaker ncompressOpenSUSE 11.3
Code: [Select]
sudo zypper install perl-Path-Class screenGentoo
For the Perl XMLRPC stuff (for the agent) All you have to do is
Code: [Select]
emerge dev-perl/frontier-rpcAgent Installation
First you need to download the agent with subversion.
Code: [Select]
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: [Select]
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: [Select]
# (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: [Select]
sudo /etc/init.d/ogp_agent startor as a cmdline app
Code: [Select]
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: [Select]
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: [Select]
sudo apt-get install mysql-serverInstall PHP and required php extensions
Code: [Select]
sudo apt-get install php5 php5-gd php5-xmlrpc php5-curl php5-mysql php-pear php5-json curlInstall Apache 2
Code: [Select]
sudo apt-get install apache2Or install lighttpd
Code: [Select]
sudo apt-get install lighttpdIf you are using Apache 2
Code: [Select]
sudo /etc/init.d/apache2 restart... or if you are using lighttpd:
Code: [Select]
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: [Select]
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:
Code: [Select]
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
Install Packages:
Code: [Select]
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: [Select]
chkconfig --levels 235 httpd on
chkconfig --levels 235 mysqld on
Disable Selinux:
Code: [Select]
sed -i 's|SELINUX=enforcing|SELINUX=disabled|' /etc/selinux/config
setenforce 0
Disable Firewall:
Code: [Select]
service iptables save
service iptables stop
chkconfig iptables off
Restart Web Services:
Code: [Select]
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: [Select]
simplexml sockets php mysql xmlrpc pcreThen run emerge php. If it's already installed, emerge it again to pickup the new use flags.
Install WebUI
Code: [Select]
svn co svn://svn.code.sf.net/p/hldstart/code/trunk/upload/ uploadNext you need to move the pages to the directory from which your http server finds the pages, e.g.,
Code: [Select]
mv upload ~/public_html/ogpAfter 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: [Select]
sudo apt-get install wine fluxbox vnc4serverFedora tested [RH/Centos should work]
Code: [Select]
yum install wine fluxbox vnc-serverAfter 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: [Select]
vncpasswdBefore 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: [Select]
vncserver -geometry 800x600 -depth 24and stop it
Code: [Select]
vncserver -kill :1You need to edit the file ~/.vnc/xstartup. Can edit with any other text editor:
Code: [Select]
nano ~/.vnc/xstartupand add 'fuxbox &' at the end of that file, if it exist, you should replace any other window manager:
Code: [Select]
#!/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: [Select]
sudo nano /etc/init.d/ogp_vncAnd copy this lines into /etc/init.d/ogp_vnc file:
Code: [Select]
#!/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: [Select]
sudo chmod +x /etc/init.d/ogp_vncand add it as a startup service:
Ubuntu/Debian
Code: [Select]
sudo update-rc.d ogp_vnc defaultsFedora/Centos/RH
Code: [Select]
sudo chkconfig ogp_vnc onNow you can start your service
Code: [Select]
sudo /etc/init.d/ogp_vnc startTo 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).
« Last Edit: September 15, 2013, 10:02:08 pm by Aldo »