################################################################### Basic Requirements for cpgsd ################################################################### gcc perl 5+ Net::SSLeay perl module IO::Socket::SSL perl module Versions 0.4.0 and later, cPGS uses a server/client mechanism. This allows cPGS to control gameservers running on remote machines (without cpanel installed) so as to elliminate any overhead of running cPanel itself on the same server the gameservers will run on. Every game of every user has a unique configuration for the remote server. Note that if you wish, you may run the cpgsd daemon on the local machine alongside cPanel, in which case you will use the loopback IP 127.0.0.1 for all user's connections. Things you need to do: 1) Run the `install` script provided in the cPGS gzipped tarball on the cPanel server(s). 2) On any remote gameserver machines, run the cpgsd_install script. If only using the cPanel machine, run this script on there as well as the `install` script. 3) On any remote gameserver machines, set up the config file (/var/cpanel/cpgsd.cfg) (this applies to the cPanel machine if only one server is used) Values are: secret: the shared secret key/pass you will use between servers. Be sure this value is the same on any servers involved in cPGS root: the base directory for cpgsd files (/var/cpanel/ by default) allowedips: comma delimited list of IP addresses that are allowed to talk to the daemon server sslpem: the SSL PEM file to use. This can be generated by the cpgsd_install script globalconf: location of the global config file that holds the locations of each gameserver file port: port that cpgsd listens on. do not change if at all possible. (2092 by default) 4) Start up the cpgsd.pl daemon on any gameserver boxes. For example: /var/cpanel/cpgsd.pl This will log data to /var/log/cpgsd.log . You can change the log file by editing /var/cpanel/cpgsd.cfg and setting the logfile= variable. 5) Log into WHM on the cPanel machine and begin configuring the users you want to allow to run gameservers. The "core config" option is where you will enter the IP address of the remote gameserver box for that user and the particular gameserver you select. A user can have an UT2004 server running on 1.2.3.4, while having a HLDS server running on 5.6.7.8, for example. IPs (that the user's server will be allowed to bind to on the gameserver machine) and Ports for each user/game should be self explanitory. Note that from 0.6.0+, it is now possible to run multiple types of the same type of game under one account. For example, "userabc" can run a CS:S server on 1.2.3.4:27015 , another CS:S server on 1.2.3.4:27025, a CS 1.6 server on 1.2.3.4:27018 and an ArmyOps server on 3.4.5.6:7617 . 6) Log into the user's cPanel account and configure the gameserver, start it up and, assuming all is well, play :) *notes* --> if you do not have the perl module IO::Socket::SSL , you will need to install it on all servers involved ( perl -MCPAN -e'install IO::Socket::SSL' ) --> if you do not have `wget` installed on the remote cpgsd.pl servers, you will need to in order to download and install gameserver packages from WHM ################################################################### Username Mapping ################################################################### This is a very basic feature that allows "UserA" on the cPanel server to control gameservers on remote servers as whatever user you designate. For example, "drdoom" on the cPanel server could control CS:S on 1.2.3.4 as the user "malcom", Call of Duty on 1.2.3.4 as "mickey", and Savage on 5.6.7.8 as "janky". Remote usernames may be configured in WHM with each user/game. ################################################################### Automatic restart on reboot ################################################################### *NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE* In version 0.4.0, this is disabled and will need to be rewritten to run on the remote gameserver machines. *NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE**NOTE* When a client starts any of the gameservers, it adds the server name into /var/cpanel/gameserv.restart and the command line used to /var/cpanel/gameserv_saved/$user_$game_$installnum The actual restart script, /usr/local/cpanel/bin/cpgs_chk , reads through all the users with gameservers installed and reads the ".restart" file. If the restart script can find the command line it needs to restart the gameserver, it will drop privileges to the user and try to start it. Currently the script does no checking to see if the server is running already or not, so it is advised not to run it unless it's directly after a reboot. Currently this script is not added to the init system since it has not been thoroughly tested. It is suggested you add it to the rc.local, local.start, etc file (depends on the distro) to have it run after the server reboots if manually running it is not feasible. ################################################################### Unique command lines per user/game ################################################################### If the admin has declared a custom command line (looks for existence of /var/cpanel/gameserv_saved/$user_$game_$installnum_useuniq), then client's starting their game server will always use the custom command line, regardless of what the client changes it to. This is mainly useful to allow special mods that are not yet supported by cPGS directly and should only be used by those who understand what they are doing. ################################################################### Instructions for creating server installation files. ################################################################### If you do not need or know how to create a custom gameserver package, then you may prefer to use the existing packages available from a mirror site. Please see http://cpgs.cpanel.net/ for a list of mirrors. Each server's installation is somewhat different. The way the installer is set up allows for the main server admin to create a default game server environment that will be applied to all new accounts, including patches, additional maps and other mods. The format for this is as follows: -Savage- Install from CD, by default into /usr/local/games/Savage/. To create a default installation file, you would simply tar/gzip it up and place it into the 3rdparty directory: cd /usr/local/games tar cjvf Savage.cpgs Savage mv Savage.cpgs /home/gameserver_files/ *note that you can install the game on any linux machine and transfer the install file to other servers. -UT2004- Install from CD, by default into /usr/local/games/ut2004/. Apply the same method as the Savage server: cd /usr/local/games tar cjvf ut2004.cpgs ut2004 mv ut2004.cpgs /home/gameserver_files/ -Half-Life- Create a "Steam" account from http://www.steampowered.com/ and download the gameserver. You will probably need to update the steam client. After that you can download the various mods. currently support Half-Life mods are: Counter-Strike, Day of Defeat, Team Fortress Classic, Death Match Classic. Once you have these mods downloaded, you can package the directory: cd /path/to/gamserver tar cjvf hlds.cpgs hlds_l mv hlds.cpgs /home/gameserver_files/ Alternately you can have clients create their own "Steam" accounts and install to $HOME/.gameservers/hlds_l/ . Currently all support mods should be installed. WHM controls in future versions will provide control over which mods are allowed. Clients can always install other mods and run them from the shell (if given shell access and permissions) if they desire. -Half-Life 2- The exact same as Half-Life with it's own mods. cd /path/to/gameserver tar cjvf hl2.cpgs hl2 mv hl2.cpgs /home/gameserver_files/ ################################################################### From within WHM you should find at the very bottom of the menu on the left a link to the gameserver control where you can control how many players and which type of servers are allowed. Clients can admin the servers they have access to from the GameServers link in the "x", "x2" and "gs" themes. The "gs" theme only provides cPGS support for strictly gameserver-only accounts. https://server.com:2083/ For all questions, suggestions, and bug reports, please email darren@cpanel.net