First off, I stole basically all this information from this guy. But, he left out a few parts I thought needed further instruction and that I had trouble with myself, so here’s my slightly improved version, mostly for my own future use.
Installing the server:
mkdir ~/css-server
cd ~/css-server
wget http://www.steampowered.com/download/hldsupdatetool.bin
chmod +x hldsupdatetool.bin
./hldsupdatetool.bin
./steam
./steam -command update -game “Counter-Strike Source” -dir .
vim cstrike/cfg/server.cfg
Of course if you’re running an x-server you can use gedit, kate, mousepad, etc to edit the server.cfg file. Here’s the example only slightly editted from the guide I’m ripping off:
// General Settings
hostname “My AMAZING Dedicated Server” // What your server will be called. Change this!
host_framerate 0
setpause 0
mp_chattime 10
mp_dynamicpricing 0 // Disable dynamic pricing. Change to 1 to enable it.
sv_lan 0
sv_secure 1
sv_pausable 0
sv_cheats 0
sv_consistency 1
sv_stats 1
sv_allowdownload 1
sv_allowupload 0
sv_timeout 30
sv_voicecodec vaudio_miles
sv_voiceenable 1
sv_alltalk 1
sv_visiblemaxplayers 14 // maxplayers minus reserved slots
// Ban Settings
exec banned_user.cfg
exec banned_ip.cfg
writeid
writeip
// Contact & Geo Settings
sv_contact my@email.address // Change this!
sv_region 0 // Change this!
// us eastcoast - sv_region 0
// us westcoast - sv_region 1
// south america - sv_region 2
// europe - sv_region 3
// asia - sv_region 4
// australia - sv_region 5
// middle east - sv_region 6
// africa - sv_region 7
// world - sv_region 255
// Rcon Settings
rcon_password “My_Ub3R_l3T-5eRv%r” // Change this!
sv_rcon_banpenalty 15
sv_rcon_maxfailures 4
sv_rcon_minfailures 2
sv_rcon_minfailuretime 30
// Log Settings
sv_log_onefile 0
sv_logfile 1
sv_logbans 1
sv_logecho 1
mp_logdetail 3
log on
// Teamplay Settings
mp_spawnprotectiontime 0
mp_autokick 0
mp_autoteambalance 0
mp_fadetoblack 0
mp_forcecamera 0
mp_forcerespawn 1
mp_teamplay 0
// Game Settings
mp_fraglimit 0
mp_maxrounds 0
mp_winlimit 0
mp_timelimit 15
mp_startmoney 800
mp_roundtime 2.5
// mp_allowNPCs 1
mp_autocrosshair 0
mp_buytime 0.75
mp_c4timer 30
mp_falldamage 1
mp_flashlight 1
mp_footsteps 1
mp_freezetime 2
mp_friendlyfire 1
mp_tkpunish 0
mp_hostagepenalty 4
mp_limitteams 2
mp_playerid 0
sv_footsteps 1
// Performance Settings
mp_weaponstay 0
mp_decals 200
decalfrequency 10
breakable_multiplayer 1
// Spectator Settings
mp_allowspectators 1
sv_specaccelerate 5
sv_specnoclip 1
sv_specspeed 3
// Physics Settings
sv_gravity 800
sv_friction 4
sv_airaccelerate 10
sv_stopspeed 75
sv_stepsize 18
sv_maxspeed 320
// Rate Settings
sv_minrate 0
sv_maxrate 0
sv_minupdaterate 10
sv_maxupdaterate 60
sv_unlag 1
sv_maxunlag 1
// Ammo Settings
ammo_338mag_max 30
ammo_357sig_max 50
ammo_45acp_max 100
ammo_50AE_max 35
ammo_556mm_box_max 200
ammo_556mm_max 90
ammo_57mm_max 100
ammo_762mm_max 90
ammo_9mm_max 120
ammo_buckshot_max 40
ammo_flashbang_max 1
ammo_hegrenade_max 1
ammo_smokegrenade_max 1
// Announce Execution
say Public Mode CFG executed
Installing Mani-Admin-Plugin:
# cd ~/css-server
wget http://mani-admin-plugin.com/mani_admin_plugin/v1_2_beta_s/mani_admin_plugin_v1_2_beta_s.zip
mkdir cstrike/addons
unzip mani_admin_plugin_v1_2_beta_s.zip
rm mani_admin_plugin_v1_2_beta_s.zip
vim cstrike/addons/mani_admin_plugin.vdf
Once again, you may use a graphical text editor instead of vim. Put the following into the file and save and exit.
"Plugin"
{
"file" "../cstrike/addons/mani_admin_plugin"
}
Lastly if you wish to run Mani’s Admin Plugin with your server, you must add the following line to the end of your ~/css-server/cstrike/cfg/server.cfg file:
exec mani_server.cfg
Port configuration:
First you need a static IP address to forward necessary ports to your server. This can be done with a line similar to `ifconfig 192.168.X.X netmask 255.255.255.0 up`, where device is your networking device (eth0, wlan0, etc), and the x’s must be filled in with your desired static ip address, such as 192.168.1.42. Make sure the address isn’t already assigned, and the ip address templates above may vary.
You may also need to use a firewall program such as Firestarter to allow inbound traffic on the ports listed below, which can be done on the policy tab by right clicking on the Inbound Traffic box and clicking “Add Service” (as far as I remember).
These ports also need to forwarded to your static ip address through your router settings. (This part is also copied directly from this guy’s wonderful guide.)
[UDP] 1200 (Used for Steam’s Friends service)
[UDP] 27000 to 27015 inclusive
[TCP] 27030 to 27039 inclusive
These are all Steam related ports
[UDP] 27015 and 27020 (Default dedicated server port, also used for HLTV)
[TCP] 27015 (For RCON access)
Running the server:
We’ll make a shell script to run the server, because it’s easier.
vim ~/css-server/load-server.sh
Paste/transcribe this script into the file, changing the ip address to your static internal ip address, and modifying the map to load or max players as you see fit.
#!/bin/sh
cd ~/css-server
./srcds_run -console -game cstrike +map de_dust2 +ip 192.168.X.X +maxplayers 16 -autoupdate
Now make it executable with chmod +x ~/css-server/load-server.sh. To run the server now, you just have to execute the shell script like this: sh ~/css-server/load-server.sh.
To run without the x-server, leaving more CPU free for the CS:S server, I change runlevels with CTRL-ALT-F2 (or whatever you do on your distribution), login as a regular user, do `killall Xorg gdm` (I use gnome/gdm, you can enter your xfce or kde equivelent or just omit that part — also the x-server process may be called something other than Xorg, refer to `ps -e`), and run the script from there.
Using rcon:
I feel this deserves it’s own section since there’s so much conflicting information out there on the intrawebs. To login to rcon, you need to open the in-game developer’s console (default hotkey is “~”) and type in “rcon_password <your password here>” (without quotes). You should’ve set the rcon password in the server.cfg file, and that’s the password you should be using here.