» Wolffiles Gameserver Panel

This very easy server panel scriptpack


uses
-php (if safe mode is on, add the directory where you place the server-scripts to your safe mode execution path)
-sudo (to run the scripts)
-screen (to keep the gameservers running)
The webserver needs to be on the same machine as the gameserver!

Basics

The panel.php is secured by a piss easy password protection!

How to install:

SERVERSCRIPTS

To use the panel without big changes, the gameserver to controle need to be in on directory for example
/gameserver
/gameserver/ET1
/gameserver/ET2
/gameserver/BLABLA
in this case
place the scripts (etserver1.sh, checkrunning.sh) in /gameserver
Edit the etserver1.sh to your needings

MAINDIR=/gameserver/
SUBDIR="ET1"
PORT=27960
GAMEBIN=etded.x86

make the sh-scripts executable (chmod +x *.sh)
now try in console in a ./etserver1.sh start , the server you configured should start.
a ./etserver1.sh stop should bring him down

SUDO

You need sudo to use this panel.
If sudo is installed, check the username the webserver is running on (#ps aux will help. OpenSuse use wwwrun , Debian www-data, but look by yourself!)

Now edit the sudoers - file by typing in your console

visudo

Use the "INS" Button to go to edit mode and add the lines
www-data ALL= NOPASSWD: /gameserver/etserver1.sh
www-data ALL= NOPASSWD: /gameserver/checkrunning.sh

to your sudo-file, replace "www-data" with the username your webserver use and change the script-paths (/gameserver/....) to your enviroment

Save the file by
ESC
:wq

PANEL

Edit the panel.php to fit you needings. 5 Server are configured yet.
1. Change the password!
2. Change $srvcount = 5; to your needings (if you want to control more than 5 server, you need to add controllines for them... more later
3. Change $scriptdir = "/gameserver/"; to the directory where you placed the scripts

Each server is configured by a few lines: I`ll explain this on server No 1

$srvlbl[1] -> "Label which is shown for this server on control-panel"
$srvfld[1]="ET1" ->Subfolder (in which the gameserver is located)
$btnlon[1]="Start ET Server 1"; (Button label)
$btnloff[1]="Stopp ET Server 1"; (Button label)
$cmdon[1]="etserver1.sh start"; (Script and parameter to start this server)
$cmdoff[1]="etserver1.sh stop"; (Script and parameter to stop this server)

Change the lines you need. If you, for example only need 2 server, just edit the [1] and [2] lines and set $srvcount to 2

If you need more than 5 server, you need to create new lines according the existing ones.

Save the php-file and place it on your webserver. Place it not in the document root of the webserver (not http://abc.ag/panel.php), use a subfolder of a subfolder (http://abc.ag/you/have/to/leave/panel.php) :)

When you open the php file with you browser, nothing but a login field is shown, enter the password you set, and login.

If nothing went wrong, you should be able to start and stop the configured server

Have Fun