- Instant Cloud Server Deployment
Game Rank
Forum Home > Half Life 1 Server Administration & Help > Looking for HaflStats by Zack Karpinski
Looking for HaflStats by Zack Karpinski
Feb 05, 2015 6:37 PM
Joined: Jan 09, 2015
Posts: 21
I'm trying to find the HalfLife stats program called HalfStats which was readily and freely available about 14-15 years ago. It is a very good program with which to run game server stats. Anybody have a copy?
Feb 19, 2015 2:04 PM
Joined: Dec 12, 2011
Posts: 18
i found it for you

for linux

and windows

installation guide
halfStats v2.0 pre-requisites

This section is intended to get you prepared to install halfStats on your web server.

Perl: Most modern UNIX distributions will come with some version of perl installed. halfStats v2.0 was tested with perl 5.6.1. Each halfStats script assumes perl will be available at /usr/bin/perl. Windows users can obtain perl from ActiveState at the following URL
Apache or IIS: this program is obviously a web based content delivery system. You will need Apache 1.3.x (Apache 1.3.26 preferred) or IIS. There are separate downloads available for Apache and IIS web servers running on different platforms. Apache can be downloaded from the following URL:
MySQL: halfStats v2.0 stores its data in tables inside MySQL. halfStats supports MySQL 1.3.23. It was not tested with 1.3.22. The latest version is available for download from the following URL:
Perl Modules: halfStats v2.0 uses a few perl modules that do not come with most default installations of perl. Unix users can install these modules with CPAN, using this command perl –MCPAN –e shell. Windows ActiveState users can use c:\perl\bin\ppm.exe. Installation of these custom modules is fairly straightforward. You can install packages with the command syntax "install package-name". CPAN packages use "::" but PPM packages generally use "-"
Packages to install:


mod_perl greatly increases the performance of halfStats v2.0 on Apache based servers. On IIS it is recommended you install the DLL that ActiveState provides, for similar speed increases.

Widndows users should make sure Perl and MySQL are in their path. After starting your command prompt (Start->Run->Command) type this:

SET PATH=c:\perl\bin;c:\mysql\bin;c:\windows\system32

Those of you on NT will need to put c:\winnt\system32 instead of c:\windows\system32

Installing halfStats v2.0

Download the latest version of halfStats from
Uncompress the halfStats archive. Inside the halfStats v2.0 folder you will find two sub-folders. One is called cgi-bin, the other html. Move the "halfStats" directory inside cgi-bin to your web server’s cgi-bin directory. The move the contents of the html directory to the place where your web server’s document root is contained. Common places for these are:


c:\program files\apache group\apache\cgi-bin

c:\program files\apache group\apache\html

You now should have a "halfStats" directory inside your web server’s cgi-bin directory and a "stats" folder inside your web server’s document root.

Using an appropriately privledged account, use mysqladmin to create a database called "hs_db". With the following command:
mysqladmin –u root –h localhost create hs_db

After you have created the database, you must load the halfStats v2.0 tables into it. Change to your cgi-bin/halfStats/sql directory. Create the tables with the following command:
mysql –u root –h localhost hs_db < hs_db.sql

Change to the cgi-bin/halfStats directory. Edit config.txt. Inside you will see some basic information about connecting to the database. halfStats requires this information so it knows how to contact your MySQL server. Usually the only thing you will need to change is the password. Set the password and then save that file. Now open up cgi-bin/halfStats/sql/db_login_setup.sql. Inside this file you should change ‘password’ to whatever you put in config.txt. Save this file.
With our password settings created, we must create an account for the halfStats system to access MySQL with. Do so with the following command:
mysql –u root –h localhost mysql < db_login_setup.sql
mysqladmin –u root –h localhost reload

It is a good idea to change the default password for the halfStats admin account. This is the password you will use when logging into the admin section of the halfStats page. Using the following commands, change the admin account password to something new (not what you used in config.txt) When mysql prompts you for a password, you must use the password from step 5:
mysql –u hs –p –h localhost hs_db

update Users set password = 'NEWPASS' where id = 1;

Now we must make sure that your copy of apache is configured properly for Server Side Includes in HTML files. Open your httpd.conf and search for the following string "AddHandler server-parsed .shtml". Make sure this line is NOT commented out. It enables Apache to parse .shtml files.

Now search for the html directory configuration section for your Apache server. Commonly you can find this by searching for the following string "apache/htdocs". You will know you have the right line if the beginning says "Directory" and not "DocumentRoot". Underneath You should see something like "Options FollowSymlinks" and/or several options. If "Includes" is not listed, add it. Save httpd.conf and restart apache "apachectl graceful".
Now you must decide if you will be using logaddress or logfile collection. It is HIGHLY recommended that you use logaddress collection. Presently there are a few bugs in the logfile collection method for time related calculations. If you have more than one server, you can use either method for local servers but only logaddress for remote servers. Logaddress collection: change to your cgi-bin/halfStats directory. Run the program. It will print output to the console, much like a half-life server. If you wish to run it in the backgrond, run with the –b flag. Logfile collection: If you are only having one local server and are not using logaddress collection, you do not need to run the program. However you must manually add your server to the database. Run the program. It will ask you some basic questions about your server and then add it to the database for you. You then must run the program periodically to put stats into the database for you.
[Log address collection only] Edit the autoexec.cfg in your valve/cstrike/tfc/other mod directory. Add the following lines (remember to replace with the ip of your webserver or whichever machine is running
logaddress 20808

log on

Once your server is sending logs to, you will need to activate it before it will show up in the server list. You can do this by visiting You will need to log in with the "admin" account, using the password you chose from step 7.
halfStats is written in such a way that it gradually learns about your server(s). As players use weapons, play on maps and trigger events, halfStats will gradually store these new items in its tables. You will need to periodically visit your admin area and make sure that weapon and trigger bonuses are given the appropriate values. Changes to these values are not retroactive so it is best to update them as soon as they get into the system.
Finally, to keep the database running tip-top, you must schedule a nightly event (cronjob) to dump cgi-bin/halfStats/sql/optimize.sql into MySQL. Example crontab –e:
30 0 * * * cd /path/to/cgi-bin/halfStats/sql; mysql –u hs –pPASSWORD_FROM_STEP_5 –h localhost hs_db < optimize.sql
Last edited by: sens0r Feb 19, 2015 2:15 PM