15.09.2013, 18:50
(
Last edited by Aldo.; 16/09/2013 at 08:44 AM.
)
http://opengamepanel.org
For support visit the OGP Forum!
Permission to post this by OGP Developer Tyger
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
Code:
sudo apt-get install ia32-libs
Install repository 'Extra Packages for Enterprise Linux'
Centos 5:
Code:
wget http://dl.fedoraproject.org/pub/epel/5/i...8100557rpm -Uvh epel-release-5-4.noarch.rpm rm -f epel-release-5-4.noarch.rpm
Code:
wget http://dl.fedoraproject.org/pub/epel/6/i...8100557rpm -Uvh epel-release-6-8.noarch.rpm rm -f epel-release-6-8.noarch.rpm
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
Code:
yum -y install sudo libstdc++.i686 zlib.i686 ncurses-libs.i686 compat-readline5.i686 sqlite.i686
Code:
rm -f /var/lock/subsys/ogp_agent
Code:
chkconfig --levels 235 ogp_agent on
Code:
sudo yum install perl-XML-Parser perl-Path-Class perl-Archive-Extract screen perl-ExtUtils-MakeMaker ncompress
Code:
sudo zypper install perl-Path-Class screen
For the Perl XMLRPC stuff (for the agent) All you have to do is
Code:
emerge dev-perl/frontier-rpc
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
Code:
sudo adduser wanted_username
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
After the installation you can start the agent to the background
Code:
sudo /etc/init.d/ogp_agent start
Code:
cd /home/<username>/OGP perl ./ogp_agent.pl --log-stdout
* 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
WebUI
Prerequisites for WebUI
Ubuntu
Install the mysql server
Code:
sudo apt-get install mysql-server
Code:
sudo apt-get install php5 php5-gd php5-xmlrpc php5-curl php5-mysql php-pear php5-json curl
Code:
sudo apt-get install apache2
Code:
sudo apt-get install lighttpd
Code:
sudo /etc/init.d/apache2 restart
Code:
sudo apt-get install php5-cgi sudo lighttpd-enable-mod fastcgi sudo /etc/init.d/lighttpd restart
Install repository 'Extra Packages for Enterprise Linux'
Centos 5:
Code:
wget http://dl.fedoraproject.org/pub/epel/5/i...8100557rpm -Uvh epel-release-5-4.noarch.rpm rm -f epel-release-5-4.noarch.rpm
Code:
wget http://dl.fedoraproject.org/pub/epel/6/i...8100557rpm -Uvh epel-release-6-8.noarch.rpm rm -f epel-release-6-8.noarch.rpm
Code:
yum -y install httpd php php-xmlrpc php-xml php-mysql php-gd mysql-server php-pear curl pecl install json
Code:
chkconfig --levels 235 httpd on chkconfig --levels 235 mysqld on
Code:
sed -i 's|SELINUX=enforcing|SELINUX=disabled|' /etc/selinux/config setenforce 0
Code:
service iptables save service iptables stop chkconfig iptables off
Code:
service mysqld restart service httpd restart
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
Install WebUI
Code:
svn co svn://svn.code.sf.net/p/hldstart/code/trunk/upload/ upload
Code:
mv upload ~/public_html/ogp
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
Code:
yum install wine fluxbox vnc-server
Type:
Code:
vncpasswd
Code:
vncserver -geometry 800x600 -depth 24
Code:
vncserver -kill :1
Code:
nano ~/.vnc/xstartup
Code:
#!/bin/sh fluxbox &
Code:
sudo nano /etc/init.d/ogp_vnc
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
then make it executable:
Code:
sudo chmod +x /etc/init.d/ogp_vnc
Ubuntu/Debian
Code:
sudo update-rc.d ogp_vnc defaults
Code:
sudo chkconfig ogp_vnc on
Code:
sudo /etc/init.d/ogp_vnc start