Google Search

Google
 

sâmbătă, 20 octombrie 2007

Counter Strike 1.6 Linux Server Installation Tutorial


Introduction

What do we need to make a Counter-Strike 1.6 Linux Server?

- a computer having linux installed and direct acces or ssh access

- root privileges

- internet connection (at least 100kB/s speed - metro and extern) optic fiber.

- 1-2 GB disc space

- wget, screen and a text editor (pico, nano, vi or mcedit)

Downloading files

Make a new working directory first:

mkdir /usr/hlds

cd /usr/hlds

Then download the following files:

HldsUpdateTool

wget http://www.steampowered.com/download/hldsupdatetool.bin

Change current directory to /usr/hlds having the above files downloaded. Start with hldsupdatetool.bin:

chmod +x hldsupdatetool.bin

./hldsupdatetool.bin

After the above commands there should be a new file named steam.

Start the server installation:

./steam -command update -game valve -dir .

If an update is being made, run the command above again. Depending of the internet connection speed, the commmand may take from a couple of minutes to a couple of hours and

the finishing message will be HLDS installation up to date

Installing Counter-Strike mod

./steam -command update -game cstrike -dir .

Again, depending of the internet connection speed, the commmand may take from a couple of minutes to a couple of hours and the finishing message will be HLDS installation up to date.

Install AMXMODX

Directory structure

You should familiarize yourself with the directory structure for AMX Mod X now.
addons\ - this is where Server addons go
metamod\ - this is where Metamod goes. Metamod is necessary to run AMX Mod X
dlls\ - this is where Metamod's binaries go
amxmodx\ - this is where AMX Mod X goes
dlls\ - amxmodx_mm.dll should go here
modules\ - Where modules are stored (_amxx.dll or _amxx_i386.so etc)
plugins\ - Where plugins are stored (.amx or .amxx)
scripting\ - Where example source code and the compiler/assembler are stored
include\ - Where include files for source code is stored
compiled\ - Where the compiler batch file stores .amxx output
doc\ - This documentation is kept here
data\ - Binary data, for example saved stats, language caches, and GeoIP information
lang\ - Dictionary text files for AMX Mod X ML features (multi lingual)
configs\ - Configuration files
logs\ - AMX Mod X log files

Metamod

If you already have metamod installed, you may skip to step e.In your mod folder, create a folder called "addons".In \addons, create a folder called "metamod".
In \addons\metamod, create a folder called "dlls".

Go to www.metamod.org and download the appropriate version of Metamod (either Windows, Linux, or Linux AMD64).Extract the metamod binary into \addons\metamod\dlls.Edit the file \liblist.gam with a text-editor like Notepad.
For windows, find the gamedll line. It will look like this:

gamedll "dlls\mp.dll"

Replace it with:

gamedll "addons\metamod\dlls\metamod.dll"

For Linux, find the gamedll line. It will look like this:

gamedll_linux "dlls/mp_i386.so"

Replace it with:

gamedll_linux "addons/metamod/dlls/metamod_i386.so"

*NOTE: use metamod_amd64.so for AMD64 servers.

Edit the file \addons\metamod\plugins.ini. If it does not exist, create it.If you are upgrading from AMX or AMX Mod X 0.1x, skip to step h.Add a line to \addons\metamod\plugins.ini like so:

Windows:

win32 addons\amxmodx\dlls\amxmodx_mm.dll

Linux:

linux addons/amxmodx/dlls/amxmodx_mm_i386.so

Linux AMD64:

linux addons/amxmodx/dlls/amxmodx_mm_amd64.so

If you're using AMX, change "amx\amx_" to "amxmodx\amxmodx_".If you're using AMX Mod X 0.1x, change "amxx\amxx_" to "amxmodx\amxmodx_".

AMX Mod X

Go to www.amxmodx.org and click "Downloads". Download the amxmodx-base package for either Windows, Linux, or AMD64.

Extract the base package to your mod folder. This will place AMX Mod X into \addons\amxmodx.

Go back to the AMX Mod X download site. If there is one available, and you want to use it, download the addon package corresponding to your mod.
As of this writing, addon packs are available for Counter-Strike/Condition-Zero, Team Fortress Classic, Day of Defeat, The Specialists, and Natural Selection.
Make sure you download the pack that corresponds to the server's operating system, either Windows, Linux, or AMD64.

Extract the addons pack into your mod folder. This will merge the addon pack into your installation in \addons\amxmodx.

AMX Mod X should now be installed! You can load your server now to try it out (type "meta list" to see it loaded).

Adding Admins

The following instructions are for admins stored in addons\amxmodx\configs\users.ini. If you are using SQL, please refer to the SQL setion.

Open users.ini with your favorite text editor. There are four parameters when adding a user:

Authentication Style, Password, Access Rights, Connection Flags

Generally, a users.ini entry will look like this:

"STEAMID" "" "abcdefghijklmnopqrstu" "ce"


Or for a more concrete example:

"STEAM_0:0:123456" "" "abcdefghijklmnopqrstu" "ce"


This means:

  • Authentication: STEAM_0:0:123456
  • Password: None (auth by SteamID)
  • Access Rights: a through u
  • Connection Flags: SteamID + No Password

In general you should follow this example. Rarely should you ever need to authenticate by password + name, but it is possible. Here is what the entry would look like:

"iamadmin" "mypass" "abcdefghijklmnopqrstu" "a"


Then to authenticate yourself, edit "autoexec.cfg" (or create it) in your client mod folder and add:

setinfo "_pw" "mypass"


Where "_pw" is the setting for amx_password_field in amxx.cfg.

The available access and connection flags are below.

Important: Do not use "z" for admins.

Access Flag

Purpose

a

immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)

b

reservation (can join on reserved slots)

c

amx_kick command

d

amx_ban and amx_unban commands

e

amx_slay and amx_slap commands

f

amx_map command

g

amx_cvar command (not all cvars will be available)

h

amx_cfg command

i

amx_chat and other chat commands

j

amx_vote and other vote commands

k

access to sv_password cvar (by amx_cvar command)

l

access to amx_rcon command and rcon_password cvar (by amx_cvar command)

m

custom level A (for additional plugins)

n

custom level B

o

custom level C

p

custom level D

q

custom level E

r

custom level F

s

custom level G

t

custom level H

u

menu access

z

user (no admin)

Connection Flag

Purpose

a

disconnect player on invalid password

b

clan tag

c

this is steamid/wonid

d

this is ip

e

password is not checked (only name/ip/steamid needed)

Running the server

./hlds_run -game cstrike +ip +sv_lan 0 +maxplayers 18 +map de_dust2

In order to start the server on screen use the following command:

screen -A -m -d -S hlds ./hlds_run -game cstrike +ip ip.de.internet +sv_lan 1 –nomaster +maxplayers 18 +map de_dust2

This command starts the server in background. In order to attach us again to it, write:

screen -r hlds

In order to send it to background again, hold pressed the ctrl button and press A letter fromthe keyboard and after that press D key.

If you want the server to start on every Linux server boot, you must add the following lines in /etc/rc.local file:

cd /usr/hlds

screen -A -m -d -S hlds ./hlds_run -game cstrike +ip ip.server +sv_lan 0 +maxplayers 18 +map de_dust2