How to install a Counter Strike server under SME Server 5.0 (HowTo v1.0)

Author: Pierrick Brossin<pbrossin@gmx.net>

Note: Another HowTo is comming with more stuff like PB and "howto launch multiple cs server"
But the HD of my Linux server crashed so I have to wait to continue this HowTo.

What is Counter-Strike ?
Counter-Strike is a modification (MOD) to the excellent game, Half-Life. It modifies the multiplayer aspects of Half-Life to bring to it a more team-oriented gameplay. Counter-Strike provides the player with an experience that a trained counter-terrorist unit or terrorist unit experiences.
The MOD is team-based featuring one team playing the role of the terrorist and the other team playing the role of the counter-terrorist. Each side has access to different guns and equipment, as well as different abilities. Maps have different goals such as: hostage rescue, assassination, bomb defusion, Terrorist escape, etc.

Why:
Some people asked me to do an Howto about this.
As I'm a big fan of Counter Strike I had to do this...

Steps:
Basically, we are going to install :

  • Counter Strike server 1.3
  • Admin Mod 2.50.07 (and its "Database Enabled" add-on)
  • phpMyAdmin 2.2.0

And then I'll show you how to go through the counter strike configuration part.

Warning: Do this at your OWN RISK !! I wont help you if you crash your system. Don't even try to send me any mails.
I will only answer mails with question about Counter-Strike, Admin Mod or PunkBuster.

Note: The installation was made through SSH

Downloads:
OK, the first step is to download those files in a fresh direc
tory on your e-smith box.
I advice you to download them from your server. It will prevent to move such big files after having download them.

ftp://ftp.joystick.fr/jeux/half-life/serveur/halflifeserveurv3108.tar.gz
http://www.redphive.org/files/cs_13_full.tar.gz
http://www.adminmod.org/downloads/halflife-admin-2.50.07.tgz
http://www.adminmod.org/downloads/halflife-admin-mysql-2.50.07.zip
http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.2.0-php.tar.gz

Note: Sorry for the HL server, I didnt find any other link.

Lets start the installation:

Info: Please note that i'm describing the way I installed it on my system. So if you think it's strange just do it as you want

[root@e-smith /root]# mkdir /tmp/cs

[root@e-smith /root]# cd /tmp/cs

[root@e-smith cs]# wget ftp://ftp.joystick.fr/jeux/half-life/serveur/halflifeserveurv3108.tar.gz

[root@e-smith cs]# wget http://www.redphive.org/files/cs_13_full.tar.gz

[root@e-smith cs]# wget http://www.adminmod.org/downloads/halflife-admin-2.50.07.tgz

[root@e-smith cs]# wget http://www.adminmod.org/downloads/halflife-admin-mysql-2.50.07.zip

[root@e-smith cs]# wget http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.2.0-php.tar.gz

[root@e-smith cs]# tar -xzf halflifeserveurv3108.tar.gz

[root@e-smith cs]# tar -xzf cs_13_full.tar.gz

[root@e-smith cs]# tar -xzf halflife-admin-2.50.07.tgz

[root@e-smith cs]# unzip -q halflife-admin-mysql-2.50.07.zip

[root@e-smith cs]# tar -xzf phpMyAdmin-2.2.0-php.tar.gz

[root@e-smith cs]# mkdir sources

[root@e-smith cs]# mv *z* sources

[root@e-smith cs]# chown root * -R

[root@e-smith cs]# chgrp root * -R

[root@e-smith cs]# mkdir /games

[root@e-smith cs]# mkdir /games/half-life

Note: Some people told me to put it in /half-life but I think it's cleaner like that.

[root@e-smith cs]# mv hlds_l/* /games/half-life/

[root@e-smith cs]# rm hlds_l -Rf

[root@e-smith cs]# mv cstrike /games/half-life/

[root@e-smith cs]# mv Admin /games/half-life/

[root@e-smith cs]# rm -f /games/half-life/Admin/dlls/admin_MM_i386.so

[root@e-smith cs]# cp AdminMySQL/admin_MM_i386.so /games/half-life/Admin/dlls/

[root@e-smith cs]# rm AdminMySQL -Rf

[root@e-smith cs]# cd /games/half-life/Admin/

[root@e-smith Admin]# ./install_admin cstrike

 

Installation of Admin Mod for CStrike :


Adminmod Installation Script
Version 2.50.07

This script will install Adminmod version 2.50.07 on your
system. It will ask you for the directory that you installed
the Half-Life server in. To accept defaults just press Return.
After the binaries are installed you should read the docu-
mentation and configure Adminmod before you use it for the
first time.

Shall I proceed with the installation? (y/n) [y] Press ENTER

Please enter the directory where your HL server is installed,
or hit Return to accept the default.
[/games/half-life]: Press ENTER

Looks like you have cstrike installed in /games/half-life.
I can now install the Admin Mod files. Proceed? (y/n) [y] Press ENTER

Installing binaries and config files ...

Editing your liblist.gam file ...

The Adminmod files have now been installed. It looks like you
install this version of Adminmod for the first time. You will
have to edit your server.cfg file in the directory /games/half-life/cstrike.
I can now add the necessary lines to your server.cfg file.
Edit the file afterwards to configure it to your needs.

Shall I add the Adminmod lines to your server.cfg file? (y/n) [y] Press ENTER

Conratulations, Adminmod is now installed.
To configure it you should now edit your server.cfg file and create
users.ini, maps.ini, ips.ini, models.ini and wordlist files as needed.
Follow the instructions in the documentation and check for more infor-
mation at the Adminmod website http://www.adminmod.org.

Enjoy!

Note: You know something easier than this ?!

Lets continue the installation:

Info: OK we are now going to modify some stuff in MySQL so Admin Mod can work with it !

But I'm gonna work with phpMyAdmin for 2 reasons : it's easier to manager and to modify stuff !

Create an IBay with e-smith-manager. Name it phpmyadmin and protect it with password.

[root@e-smith Admin]# cd /tmp/cs/

[root@e-smith cs]# mv phpMyAdmin-2.2.0/* /home/e-smith/files/ibays/phpmyadmin/html/

[root@e-smith cs]# rm phpMyAdmin-2.2.0 -Rf

[root@e-smith cs]# cd /home/e-smith/files/ibays/phpmyadmin/html

[root@e-smith html]# cat /root/.my.cnf

#------------------------------------------------------------
# DO NOT MODIFY THIS FILE! It is updated automatically by the
# e-smith server and gateway software. Instead, modify the source
# template in the /etc/e-smith/templates directory. For more
# information, see http://www.e-smith.org.
#
# copyright (C) 1999-2001 e-smith, inc.
#------------------------------------------------------------

[client]
password=COPY THIS PASSWORD WITH YOUR MOUSE CURSOR


#------------------------------------------------------------
# TEMPLATE END
#------------------------------------------------------------

[root@e-smith html]# mcedit config.inc.php

Note: You are now in MCEDIT. You have to look for "$cfgServers[1]['password'] = 'PASSWORD1'; // MySQL password (only needed with basic auth)
Then press the button "i" (without quotation mark) and then right click with your mouse where
PASSWORD1 is so your password is gonna be written between the ''.
Press "ESC" then ":x" (without quotation mark)
The file is saved with the password !

phpMyAdmin is now accessible from => http://servername/phpMyAdmin/
Launch your favorite browser (on a client) and type this url.
If this is your first use of MySQL you can delete the "test" database.
Create a database called "adminmod" and execute the following lines one by one :

CREATE TABLE users( nick VARCHAR(30) PRIMARY KEY NOT NULL, pass VARCHAR(20), access INTEGER UNSIGNED );
CREATE TABLE models( nick VARCHAR(20) PRIMARY KEY NOT NULL, pass VARCHAR(20) );
CREATE TABLE ips( ip VARCHAR(15) );
CREATE TABLE words ( word VARCHAR(30) );
CREATE TABLE plugins( plugin VARCHAR(30) );
INSERT INTO plugins VALUES ('dlls/plugin_base.amx');
INSERT INTO plugins VALUES ('dlls/plugin_chat.amx');
INSERT INTO plugins VALUES ('dlls/plugin_cheat.amx');
INSERT INTO plugins VALUES ('dlls/plugin_hldsld_mapvote.amx');
INSERT INTO plugins VALUES ('dlls/plugin_message.amx');
INSERT INTO plugins VALUES ('dlls/plugin_retribution.amx');
INSERT INTO plugins VALUES ('dlls/plugin_spawn.amx');
INSERT INTO plugins VALUES ('dlls/plugin_fun.amx');
INSERT INTO plugins VALUES ('dlls/plugin_CS.amx');
INSERT INTO plugins VALUES ('dlls/plugin_logtest.amx');

You can now close your browser and return to SSH.

[root@e-smith html]# cd /games/half-life/cstrike/

[root@e-smith cstrike]# mcedit server.cfg

Add those lines in this file :

// Admin Mode Cvars
mysql_host "localhost"
mysql_user "root"
mysql_pass "PASSWORD1"
mysql_dbtable_users "adminmod.users"
mysql_dbtable_models "adminmod.models"
mysql_dbtable_ips "adminmod.ips"
mysql_dbtable_words "adminmod.words"
mysql_dbtable_plugins "adminmod.plugins"

PASSWORD1 is the password you entered in the phpmyadmin config file
Admin Mod need this password to be able to access the tables !

By the way, configure the RCON Password which is needed by Punkbuster server !
So add this line in the server.cfg file :

Here is how to launch your Counter-Strike with Admin Mod and PunkBuster
(Still the way I do)

[root@e-smith cstrike]# cd /bin

[root@e-smith bin]# mcedit cstrike

You are now in the file "cstrike". This is the file which is gonna launch the cs server.
Write those lines in it :

#!/bin/bash
IP_LOC=`ifconfig ppp0 | fgrep "inet ad" | cut -f2 -d":" | cut -f1 -d" "`
export LD_LIBRARY_PATH=/games/half-life:$LD_LIBRARY_PATH
cd /games/halflife/
./hlds_run -game cstrike +ip $IP_LOC +maxplayers 8 +map cs_assault

Note: IP_LOC contain the PPP0 IP

[root@e-smith bin]# chmod 750 cstrike

 

You can now launch your CS Server !

[root@e-smith ]# cstrike

 

Note: If you want some help with the configuration file of counter strike have a look at http://server.counter-strike.net/linuxbasic.html

Note: If you do not want to keep the sources of HL, CS, PB and Admin mod just delete /tmp/cs/sources

Troubleshooting - Common Errors
"Not implemented yet"
Waiting for some trouble to happen

Acknowledgements
Thanks to Grand'Pa for having posted the way to install a basic counter strike server and the way to launch it !
Thanks to [-SGT]DeV!L for testing the server for our team (the server I tested this howto on)
Thanks to Dan Brown for the style of the HTML page. I don't really have ideas to make the web pages style !



Copyright © 2001 Pierrick Brossin.  This document may be freely redistributed so long as this notice remains intact.