Skip to content

Master Install Guide

Ryan G edited this page Sep 20, 2013 · 2 revisions

This will walk you through setting up your GamePanelX Master installation.

Table of Contents

Requirements

  • Linux: Modern Linux server. CentOS and Debian/Ubuntu have been tested the most. We recommend a VPS or a Dedicated Server so you have root access.
  • PHP Settings (php.ini): Set all time limits (set_time_limit etc) to over 120 seconds or set them to 0/unlimited. Some Steam processes can take a long time; you don't want your scripts timing out in the middle of something. You will also need the "exec" or "shell_exec" functions available if using "Local" mode for your Network Servers.

A guide specific to CentOS is available here: Full CentOS Guide

Install

Dependencies

Ensure you have the Posix functions setup with your PHP install and other requires libs for Steam. These package names may differ on Debian/Ubuntu with apt-get.

CentOS/RedHat

 sudo yum install php-mysql php-bcmath php-posix php-common glibc.i686 libstdc++.i686 libgcc.i686 unzip wget

Debian/Ubuntu

 sudo apt-get install php5-mysql php5-common libc6 libstdc++6

Make sure the "uncompress" command is available for Steam

 if [ ! -f /usr/bin/uncompress ]; then sudo ln -s /usr/bin/gunzip /usr/bin/uncompress; fi

SELinux

Make sure SELinux is disabled to ensure things are not interrupted.

CentOS:

 sudo sed -i 's/SELINUX=enabled/SELINUX=disabled/g' /etc/selinux/config
 sudo setenforce 0
 sudo selinuxenabled 0

Ubuntu:

Note that SELinux is not installed or enabled by default on Ubuntu, so you don't need to run the above commands.

Set Permissions

CentOS/Fedora/RedHat:

 cd /var/www/html/GamePanelX-Master-3.0.11
 if [ -f configuration.new.php ]; then sudo mv configuration.new.php configuration.php; fi 
 sudo chown apache: . -R
 sudo chmod ug+rw configuration.php _SERVERS/*
 sudo chmod ug+x _SERVERS/scripts/*

Debian/Ubuntu:

 cd /var/www/GamePanelX-Master-3.0.11
 if [ -f configuration.new.php ]; then sudo mv configuration.new.php configuration.php; fi 
 sudo chown www-data: configuration.php uploads plugins _SERVERS includes/SSH includes/GameQv2 -R
 sudo chmod ug+rw configuration.php _SERVERS/*
 sudo chmod ug+x _SERVERS/scripts/*

Note: On some Cpanel servers or servers with SuExec enabled, the username in the above example should be your site account's username.

Note: You do not need the PHP Pecl SSH2 extension. The SSH2 library used by GPX is a Pure-PHP SSH implementation called PHPSecLib. No external plugins are needed for this.

Check PHP

You will want to check your PHP installation to make usre the following values are set and raised fairly high.

The path to your PHP config pay differ distro to distro.

php.ini:

 file_uploads = On
 upload_max_filesize = 20M
 max_file_uploads = 20
 post_max_size = 20M
 max_execution_time = 120
 max_input_time = 120
 memory_limit = 128M

If you are on a VPS, pay special attention to the "memory_limit = 128M" value. This sometimes is set fairly low for a VPS, so make sure it's high. If set too low, the scripts could fail.

Visit URL /install

Note: Make sure you have created a new database and granted permissions on it to a MySQL user. How to do this is outside the scope of this tutorial (Google provides many tutorials).

Next, visit yoursite.com/gamepanelx/install/. Here you will enter typical database information and your first admin user info, and begin the install process. This should take less than 30 seconds if you have your database info handy.

If you need help setting up your first database, see this guide http://gamepanelx.com/wikiv3/index.php?title=CentOS_Install#Setup_MySQLHere

When the installation is completed, you must delete or rename the /install directory.

Admin Login

Now you will login for the first time. Visit yoursite.com/gamepanelx/admin/. Visiting your site without /admin at the end will give you a client/user login, which you do not want. Enter your admin username and password, and login.

Create a Network Server

As of Master 3.0.10 there is already a default local network server created for you. Use this, or delete it and create your own.

To begin, you will want to create a Network Server. This tells GamePanelX what IP Addresses it can use and what SSH information it needs (if not using the Local option).

  1. Click Create Network Server at the bottom left of the page.
  2. IP Address: Enter the main IP Address of the server.
  3. Local Server: If you are only running GPX on 1 physical server, set this to Yes. Otherwise, choose no if you have more than 1 physical server you will be using. If you chose No, then proceed with filling out all the "Login" fields with your Normal User you created during the Remote Server installation (e.g. "gpx"). Do not set this to root.
  4. Press Save when done.

Local Network Servers

This "Local" mode of network servers is when the game panel runs commands locally on the server using PHP's internal functions. It does not SSH when using this method. This method exists to allow people to get up and running with gamepanelx quickly, however it is highly recommended to move to a Remote Network Server, as you gain security and features by doing so.

Remote Network Servers

This is the "Remote" package for gamepanelx. It does not need to be physically remote, this method just means the panel uses SSH to run the server scripts. It is highly recommended to install Remote Server. By doing this you gain security, features, and the option to have an FTP Server.

If you have installed the Remote scripts, you must delete any Local Network Servers, and then create a new network server, with type set to "remote".

Create a Game Template

Templates are archives of a completed gameserver installation, with all server files. These are extracted when you create a new gameserver. FYI, templates are GZipped tar archives (.tar.gz files).

Steam-Based games such as the Counter-Strike series, Team Fortress, etc, can be installed automatically and without any files provided from you. For other non-steam games, you will need to provide a file path for the installer to use for the archive.

  1. Click Game Setups on the top left panel.
  2. Choose the game you want to make a Template of, such as "Counter-Strike: Source".
  3. Click the "Server Templates" tab, and click "Create Template".
  4. Network: Choose the network server that you created in the beginning.
  5. File Path: Leave this empty, since we will be using the automatic Steam Installer. If you want to specify a directory for this template to use, press "Browse" to look through your server for your directory. When you have found the directory you want, press "Click to use this folder for this template".
  6. Default: Set this to Yes.
  7. Description: Enter "My new css template" or something of the sort.
  8. Click Create Template when ready.
The template will now begin it's process in the background. You will be redirected back to this game's templates page where you can wait for it to complete. Or, come back later. The time it takes to finish creating your Template will vary from 5 minutes to 15 minutes, depending on how fast your server can create a GZipped file.

Steam-based templates

If you are choosing a Steam-based game, leave the "File Path" field blank. Once you start the template, the system will automatically fetch the steam installer for you, and begin installation.

Because this has to contact the Steam servers, as of Master v3.0.7 and Remote 3.0.10 the beginning template process can be delayed between 10-20 seconds. As of these versions, the installer waits to make sure Steam starts correctly, and will give you error output on screen if there are any issues. If no issues arise, and you see "Success", your steam installation should be on its way just fine.

Please see Steam Games Guide for full info on requirements for Steam games.

Create a server user

Next you will create your first user. This is just a GamePanelX user account that will own their own gameserver. This has nothing to do with the Linux system user you may have created on your Remote server.

  1. Click Add User on the left panel.
  2. Enter a username such as "myuser123", enter a password, and an email address for this user.
  3. Press Save.
Note: If you plan to create your own Remote Network server, you should delete the "example" user account and create a new account before creating game servers.

Create a Game Server

Since you have a Network Server, Game Template, and User Account, you can now create your first Game Server.

  1. Owner: Choose the user account you just created.
  2. Server: You will see a list of only templates which are completed and ready for use. If your template is completed already, choose your template you just created.
  3. Network: Choose the network server you created in the beginning.
  4. Port: This should be automatically filled out for you based on the defaults of the server. Feel free to enter your own.
  5. Description: Enter whatever you want, such as "My first server"
  6. Press Create Server.
You can now wait for your new Game Server to be installed. Again, this time will vary from 5 minutes to 15 minutes, depending on how fast your server can extract a GZipped file.

Server Management

Once your server is ready, you can proceed to manage it: Server Management Guide

Troubleshooting

If you have odd issues, or are finding that templates are never creating, etc, check if your server has any security patches or plugins, such as Suhosin. Most of GamePanelX is tested on an Apache/PHP/MySQL setup that is compiled from source (./configure, make, make install) with no package managers.

Logs

Logs are stored independently for each purpose. Templates have their own log, server creations have their own log, steam games have their own log, etc. Log file locations:

Local Network Servers: <docroot/gpx></docroot/gpx>/_SERVERS/logs/

Remote Network Servers: /usr/local/gpx/logs/

Log Files:

<caption>Log Files</caption>
Templates logs/templates.log
Server Creation logs/servers.log
Steam Games (initial startup and connection to the Steam network, not for actual game installations) logs/steam.log
Steam Games (actual log for template creation, specific to the gameserver being installed, includes installation progress percentage) tmp/steam_X.log (where X is the Template ID)

Steam

See Steam Games Guide

PHP Settings

Your PHP memory limit must be set high (128M+) for things to work properly. If on a VPS, this is generally set fairly low, so double check this. See the php.ini info above: Check PHP Settings

GamePanelX has a simple on/off switch to view debugging information. Many pages with important information have debugging output that is very useful.

Debugging

To turn on debugging, simply set $settings['debug'] to true in the "/configuration.php" PHP page, like this:

  $settings['debug']        = true;

You can set it back to false when you are done.