Subscribe by RSS RSS Icon

How to make your own Counter Strike dedicated server on windows

It’s been a year already since I started playing Counter Strike and most of the times I play with my friends on my dedicated server hosted in my computer. So, here is a complete guide for all you guys who want to make your own Counter Strike (CS) dedicated server on windows, starting from installing and configuring CS, till making a web based ranking system. It doesn’t matter if it’s a pc or a laptop, as long as it has xp or vista. I haven’t tried it on windows 7, but I think it should.

Before we begin, these are the stuffs we’re gona cover in this guide:

  • Installing Counter-Strike: Source
  • Creating the server
  • Configuring the server
  • Installing Mani Admin Plugin (optional)
  • Intalling Metamod:Source
  • Intalling SourceMod
  • Installing Xampp
  • Intalling ActivePerl and DBD-mysql
  • Installing and configuring HLstatsX: CE
  • A bit of port forwarding
This guide contains two parts. Making the CS server and making the webhost. Okay, so now let’s get it started! ;)

Installing and configuring the CS server
  1. Download and install Counter-Strike: Source (installation instructions will be included). Let’s assume that you’ve installed in C:\Program Files\Counter-Strike Source\
  2. Go to C:\Program Files\Counter-Strike Source\ and look for srcds.exe. Right click and sent to desktop, which makes a shortcut on the desktop.
  3. Go to desktop, rename the srcds.exe shortcut to server, right click on it and go to properties.
  4. In the shortcut tab, add this line in the target field after the srcds.exe" part:
    -console -game cstrike +maxplayers 30 +map de_dust2 -secure

    shortcut

    -console: tells it to run as the console command interface, instead of the GUI, which takes more load than console.
    +maxplayers 30: how many players can join the game, in this case its 30.
    +map de_dust2: which map the server is going start with, in this case its de_dust2.
    -secure: secure the server with Valve Anti Cheat (VAC).
  5. Now it’s time make some basic settings for your server by using the server.cfg file in your C:\Program Files\Counter-Strike Source\cstrike\cfg\. If you don’t have that files, you can create it by using a cfgmaker to help you to generate it easily.
  6. Go to desktop and run the server shortcut. It should show up the console like the command prompt and starts to load some stuffs. If something goes wrong, go back to the step 4. After loading all those stuffs, run your Counter-Strike game, find your server in the LAN tab and join. Play around a bit; it’s just to check whether it works ;) So, basically your dedicated CS server is up and running on LAN, but it might not work through internet, when your friends try to join. Don’t worry; we’ll cover it up later. Shutdown the server by typing, exit in the console.
  7. This is an optional step, you may skip to step 9. Mani Admin Plugin makes it easier to manage the server, like kick, ban, change map, slap and more. Download Mani Admin Plugin and extract it into C:\Program Files\Counter-Strike Source\cstrike\. Go to your C:\Program Files\Counter-Strike Source\cstrike\addons\, open CreateVDF.exe, select cstrike and save it as mani_admin_plugin.vdf.
  8. Run the server and let everything gets loaded. If the server crashes, go back to step 7 and try installing a previous version of Mani Admin Plugin like v1.2 Beta O. After the server loads everything, to check whether Mani Admin Plugin was loaded, type:
    plugin_print
    ...and it should show something like:
    mani admin
    …or if it doesn’t, something is wrong with your installation. For troubleshooting, configuration and commands check the documentation. You can shutdown the server now.
  9. In order to make the HLstatsX in game ranking system to work, you need to have SourceMod, and SourceMod requires Metamod:Source. So let’s download Metamod:Source, installation instructions and troubleshooting can be found in AlliedModders Wiki.
  10. Download SourceMod and extract it into C:\Program Files\Counter-Strike Source\cstrike\. To check whether the addons are loaded, run your server and type:
    meta list
    …and it should show this line:
    meta list
    If it works, shutdown the server and proceed to next step, and if it doesn’t work, go back to step 9 or check out the AlliedModders Wiki.
  11. Download the HLstatsX: CE, extract it somewhere, and copy the sourcemod folder into C:\Program Files\Counter-Strike Source\cstrike\addons\.
The game server is now ready, and it’s time to setup the web server part now ;)

Installing and configuring the web server
  1. I’m gona’ use Xampp as the web server pakage. Download and install Xampp as to the instructions.
  2. HLstatsX Community Edition uses a Perl daemon to parse the log streamed from the game server”, so Perl has to be installed. You can use the Perl addon for Xampp, or use ActivePerl to run the perl scripts. I use ActivePerl and I recommend using it :)
  3. Open up Perl Package Manager (PPM) by typing ppm in the run. Search for dbd-mysql in the PPM, right click on it and install. Go to file, Run Marked Actions and you’re done!
    ppm
  4. Copy the web folder from the extracted HLstatsX file, into htdocs of your Xampp web server. Rename the folder to stats.
  5. I assume that your web server is working by now. So, go to http://localhost/phpmyadmin/ and make a new database. The username is root and there is no password by default. Let’s call this database, hlstatsx.
  6. Click on the hlstatsx database on the left side which you created, and go to the 'Import' tab on the top. Under the ‘File to import’, browse to the extracted HLstatsX folder, \sql\install.sql and ‘Go’.
  7. Open config.php, in your web server stats folder, with a notepad. Edit the file to match your settings:
    define("DB_NAME", "hlstatsx");
    define("DB_USER", "root"); - the default xampp username
    define("DB_PASS", ""); - the default xampp password is *none*
  8. Go to http://localhost/stats/hlstats.php?mode=admin and login as admin, with 123456 as the password. Add your server under game settings and play around a bit with the HLstatsX: CE settings.
    Server Address: your internal network IP
    Server Port: 27015
    Server Name & Rcon Password: See your server.cfg
    Game Mod: Sourcemod
  9. Go to your C:\Program Files\Counter-Strike Source\cstrike\cfg\ and open autoexec.cfg with a notepad. Add the following lines:
    log on
    logaddress_delall
    logaddress_add IP:PORT

    your IP will be the internal IP and the port can be 27500.
  10. Copy the perl folder from the extracted HLstatsX to the stats web server folder. Open hlstats.conf with a notepad and edit it to match your settings:
    DBHost "localhost"
    DBUsername "root"
    DBPassword ""
    DBName "hlstatsx"
    Port 27500
  11. Open up notepad and paste the following line:
    perl hlstats.pl
    ..save it as hlx_run.cmd in that folder. You may create a shortcut for the hlx_run.cmd in your desktop for easy use. Try running it. If it shows an error and closes, try checking your hlstats.conf, or if there is no error and if it doesn’t closes, it’s working!
Your game server and web server is now ready, but still you’re not done yet! ;) The last part is to open or forward your ports. To do that, you’ve to login into your router and set the ports. Most of the routers have the configuration for the web server and for Counter-Strike too, but if you don’t have or you don’t know, you can go to PortForward.com to get it done :)
For Counter-Strike server:
Protocol / Port start - Port end / Port Map
UDP / 1200-1200 / 1200
UDP / 27000-27015 / 27000
TCP / 27020-27039 / 27020

For web server:
Protocol / Port start - Port end / Port Map
TCP / 80-80 / 80
TCP / 443-443 / 443
You can check whether your web server is working by going to Hidemyass.com, enter your external IP and browse. You can get your external IP by going to Whatismyip.com. If you can access, that means its working! Once you are done, it’s time to finally start the server.
  1. Run the hlx_run and the CS server shortcut from the desktop.
  2. Run your CS game, join your server and add some bots.
  3. Minimize the game, go to http://localhost/stats/ and check the players and played times whether it matches. If it does, it’s working correctly, if it doesn’t, go back and check your steps carefully, because something is really screwed up!
  4. Tell your friends your IP and let the fun begin! :D If your IP is dynamic, its’ kinda annoying when your IP changes every time. So, you can use a free DNS service like afraid.org, which has many different kewl domains and they have a free DNS updating software so that, when every time your IP changes, it updates your DNS settings.
So, this is it! I hope this guide helped to make your own CS dedicated server and also about the web server too. If you have any questions, please drop a comment.

14 comments:

Anonymous said...

how can i make a cs server in a web server?

|[ sykez ]| said...

well, it depends on your hosting features...but most of the times you can't host games on a web hosting server...

gazmo said...

wow! gr8 work there mate! so complicated too o.O
is it possible to make the web server and game server separate? i mean i have a web hosting but i cant host games on that server so i want to host the game server only on my pc and web server on another host. possible?

|[ sykez ]| said...

thanks! :D ...yeah it jus kinda complicated too sometimes :P

..yeah its possible to do that...but still..again it depends on your hosting...mostly private dedicated servers will work...and you'll need ssh too..its pretty much the same as this guide...settin up the database and stuffs...and then you'll need to use ssh to run the perl scripts...thats all! :D
check this out:
http://code.google.com/p/hlstatsxcommunity/wiki/DreamhostInstallInstructions

schkiler said...

thanks for the guide mate :> this helps alot and it workd too but unfortunately i have this prob wid the hosting provider. they blockd hlx frm running :<

Anonymous said...

part13 is not there :(

|[ sykez ]| said...

@schkiler:
you're welcome :) ..m glad that it helped you someway... yeah...some hostings have already blocked hlx scripts from running...but you can still host the game and webserver on your local computer itself ;)

@Anonymous:
sorry, the link went down...i've updated the link again..and thanks for lettin me know :) enjoy!

Anonymous said...

is this non steam?

|[ sykez ]| said...

yes it is...

someone said...

this guide is about hosting cs on a pc right? how can i make one in my vpn?

|[ sykez ]| said...

yeah...this guide is for pc...if you have a VPN...usually you'll have cPanel. cPanel has a software module which allows you to make a game server. check it out: http://cpgs.cpanel.net/
after setting up...you can install all the addons and the ranking system like as in this guide :)

xgametop said...

Counter Strike private server top

counter strike said...

the article was great , i had great ideas learned from this. for newbies, this could be a good contribution to the gaming industry. continue making post and articles on this. thank you.

Blogger said...

DreamHost is ultimately one of the best hosting company for any hosting plans you require.

 
Copyright Info.

Copyright 2009 sykez
Powered by Blogger and BTemplates

Partners
Other Links
XHTML/CSS validations
Valid XHTML 1.0 Transitional Valid CSS!