HomeDownloadsHelpForums HLstats

HLstats Installation - Windows

Dependencies

HLstats requires:

You should install all of the above software before attempting to install HLstats.

Recommended method:

  1. Install MySQL first. Make sure to install into its default directory to avoid difficulties later.
  2. Install ActivePerl.
  3. Unzip the DBI and Mysql Perl modules.
  4. Open a DOS window and change directory to the location you unzipped the DBI module to, then do:

    C:\PMod\DBI> ppm install DBI.ppd


  5. After it is completed, change directory to the location you unzipped the Mysql module to, then do:

    C:\PMod\Mysql> ppm install DBD-Mysql.ppd
    C:\PMod\Mysql> ppm verify --upgrade


  6. Install PHP. Some users have encountered problems with the ISAPI version; if in doubt, try the CGI version (php.exe).

Installation Instructions

  1. Extract the distribution archive. You can use a program like WinZip to open .tar.gz files. These instructions will assume that the archive has been extracted to C:\HLstats, although you can use a different path if you wish. Make sure you extract with "Use folder names" enabled, so that the necessary subfolders will be used.

  2. Create the MySQL database. Open a DOS window and do:

    C:\> cd HLstats
    C:\HLstats> mysqladmin create hlstats


    (Where the last "hlstats" is the database name, and must match the settings DBName in hlstats.conf and DB_NAME in hlstats.php, which you will configure in a moment.)

    Note These examples assume that the MySQL executables directory (commonly C:\MySQL\Bin) is in your %PATH%.

  3. Create required tables:

    C:\HLstats> mysql hlstats < hlstats.sql


  4. Import default settings for the games you want to run statistics for. Default settings for several games are provided in separate gamesupport_game.sql files. Import all of the games you want as follows:

    C:\HLstats> mysql hlstats < gamesupport_game.sql


    For example, if you want to run statistics for Counter-Strike, do:

    C:\HLstats> mysql hlstats < gamesupport_cstrike.sql


    If support for the game you want to run statistics for is not provided, check for additional gamesupport files at https://hlstats.org/downloads.php. (Note that, to be compatible with HLstats, games must support the Half-Life Standard Log Format.)

  5. Optional: Create a MySQL username and password for HLstats.

    C:\> mysql --user=root mysql
    mysql> GRANT ALL ON hlstats.* TO hlstats IDENTIFIED BY 'somepassword';


    The first "hlstats" is the database name, the second is the username to create.

    Note Depending on your MySQL server configuration you may need to do "TO hlstats@localhost" instead of just "TO hlstats".

  6. Edit hlstats.conf.

    • Configure the database options to suit your MySQL server details.
    • Follow the comments to make any other desired changes.

    Note MailTo, MailPath and DNSResolveIP are not compatible with Windows. Leave MailTo as blank ("") and set DNSResolveIP to 0.

  7. Edit hlstats.php.

    • Configure the database options to suit your MySQL server details.
    • Configure the INCLUDE_PATH setting to match the location where you will put the hlstatsinc directory. Note you must use forward slash (/) instead of back slash (\). For example: C:/HLstats/hlstatsinc
    • Follow the comments to make any other desired changes.

  8. Copy hlstats.php and the hlstatsimg directory to a Web-accessible location (for example, C:\inetpub\wwwroot). All other files and directories should be kept in a NON-Web-accessible location (for example, C:\HLstats).

  9. Configure user, game and server settings. Go to the following URL:

    http://your-server/path/hlstats.php?mode=admin
    Log in as user admin with password 123456.

    The admin interface is broken up into various sections: General Settings, Game Settings and Tools. Under each section are groups of settings, which when selected are represented as a table. You can enter information in the fields in the rows and columns to change existing values, and enter values in the blank row at the bottom to create a new row.

    • IMPORTANT: First you should create your own username and password from the Admin Users page, and delete the default admin/123456 user!
    • IMPORTANT: For each game, select the game's name and then select Servers. Configure the server addresses that you want to collect data from. HLstats will ignore any data coming from servers that it does not recognise!

  10. Run hlstats.pl. Either browse to C:\HLstats and double-click on hlstats.pl, or open a DOS window and do:

    C:\HLstats> perl hlstats.pl


  11. Configure your game server(s) to log data remotely using logaddress. Recommended method:

    • Create an autoexec.cfg file in the mod's directory (e.g. cstrike\autoexec.cfg), if it does not already exist. HLDS will automatically execute this file once at startup. (Note DO NOT place logging commands in your server.cfg!)

    • Place the following lines in the file:

      log on
      logaddress 1.2.3.4 27500

      map de_dust


      Where 1.2.3.4 is the address of the machine running hlstats.pl. 27500 is the default HLstats port, it must match Port in hlstats.conf, which can be anything.

    • Start up the game server.

  12. If you want daily awards, configure a scheduled task to run hlstats-awards.pl once a day.

    Note that hlstats-awards.pl looks at the previous day's data, so you won't get any awards until you have been running HLstats for about a day.

    (For performance reasons awards are not generated in real-time.)

  13. View your HLstats real-time player and clan rankings and statistics online at:

    http://your-server/path/hlstats.php
Enjoy!

Further documentation and resources can be found at https://hlstats.org/help.php.

Copyright © 2000-2004 Simon Garner.