Installing HLStatsX:CE

HLstatsX Community Edition is free Real-time stats and ranking for Source engine based games. It can also be rather tricky to install. Here we’ll provide a guide to installing it on your INX-Gaming webspace.

Installing your web space

The first thing to do before setting up your stats is to setup your web space, to do this simply goto your MyINX control panel and, provided you’ve got the correct package, select ‘install‘for your web hosting. Fill in the details as necessary and proceed.

Getting the correct files

Point your browser towards http://www.hlxcommunity.com/ and grab the latest files (1.6.3 at the time of writing this). Download them to your local hard drive and save them somewhere easy to remember. Once done, unzip all the files and you should have the following folders: amxmodx, heatmaps, scripts, sourcemod, sql and web. The web folder is the one we’re interested in at the moment.

Uploading the files

Connect to your websites FTP server and browse to the ‘public_html‘ folder (or the www) folder. Once there, create a new folder (this varies from client to client, however right clicking should give you this option). Name it something relevant – for example ‘stats’. Once done, upload the entire contents of your web folder from the HLStatsX:CE .zip file.

Creating the database and uploading the .sql file

Now it’s time to give the stats a place to be stored. Go back to your MyINX control panel and browse to your web hosting service, you should see the option to goto the control panel for your web service (called cPanel). Click this. Once there you should be presented with lots of controls for your website, we’re interested in the database section. Scroll down until you see ‘MySQL Database Wizard‘ and click it. Give your database a name (again, make it something relevant) and assign a user to it. Give this user ‘full privileges’ (using the wizard will show you how to do this). Now that we’ve created the database, we need to populate it with tables.

Go back to the home page of your cPanel (the web hosting one) and select ‘PHPMyAdmin’. On the left hand side you should see your database name, click it so we can add our tables. If you now look towards the top you should see the option to ‘import’. Select this tab and select ‘choose’. This will bring up your browser, so goto the location where you unzipped your files and goto your ‘sql‘ folder. Select ‘install.sql’ and press OK. This will now upload the file and add all the necessary tables to your database.

That’s the database bit done now, we just need to configure our stats.

Configuring your Stats

Go back to your local hard drive and goto your ‘web’ folder. In here you’ll see ‘config.php‘, edit this file with notepad. The lines we’re looking for are the following:

// DB_NAME – The name of the database
define(“DB_NAME”, “”);
// DB_USER – The username to connect to the database as
define(“DB_USER”, “”);
// DB_PASS – The password for DB_USER
define(“DB_PASS”, “”);
// DB_ADDR – The address of the database server, in host:port format.
//           (You might also try setting this to e.g. “:/tmp/mysql.sock” to
//           use a Unix domain socket, if your mysqld is on the same box as
//           your web server.)
define(“DB_ADDR”, “localhost”);

define(“DB_NAME”, “”);

define(“DB_USER”, “”);

define(“DB_PASS”, “”);

define(“DB_ADDR”, “localhost”);

The first line is your database name – this is the one we setup earlier and will follow the format <your username>_<database name>. So, for example, my1234_stats.

The second line is the user we assigned to the database, the third line is the password.

The 4th line can be left as localhost, however if that does not work try ‘195.242.236.15‘. Save and close the file, then upload it.

That’s it for the website side. The last remaining thing to do is login as an admin, to do this goto your stats URL and click ‘admin’ at the bottom. Log in with the following details:

User: admin
Pass: 123456

Setting up Perl

Now that the website is setup, we’ll need to make sure we can send and receive logs. Goto your unzipped directory and browse to your ‘scripts’ folder. In here you should see a file called ‘hlstats.conf‘. Edit this file (like you did with config.php). The database information should be pretty simple, you will notice this line further down the file:

BindIP “”

You can leave this blank if you want to, however we like to ensure we’re checking the correct IP so enter ’195.242.236.15′ in here. The next line down is very important and must be changed to suit you.

Port 27500

Change ’27500′ to something individual. There will be other users running stats programs on here and will likely be using the default port, in order to ensure you receive the correct logs change this. We recommend using the numbers from your username to keep it individual. Close and save this file.

Go back to your website FTP and goto the root directory (the directory above ‘public_html‘). Now upload your ‘scripts’ directory here, upload the entire folder so you now have a scripts folder on your FTP.

So far so good, we’ve got all the core files setup. You will now need to contact INX support. We need to make  the files an executable on the server (the .pl files), we will also setup a cronjob for you so your stats are updated regularly.

Configuring your game server

This is the final step. You can either use your FTP client to access your game servers FTP server or your control panel, but we need to edit your ‘autoexec.cfg’ file. Simply add this line:

logaddress_add 195.242.236.15:<port from before>

Change ‘port from before’ to the unique one you used when setting up HLStats.conf. Save your autoexec.cfg and upload it. Now reboot your server.

Your stats should now be online!

This entry was posted in Tutorials. Bookmark the permalink.

3 Responses to Installing HLStatsX:CE

  1. lastwarrior says:

    Thanks for the tutorial Mike!

    Absolutely awesome, got mine set up and running perfectly.

  2. SharpShot.gif says:

    Very Useful. Thank you!

  3. ajni says:

    i have a problem when i upload install.sql
    here is the problem:
    query SQL:

    – ——————————————————–

    – Table structure for table `geoLiteCity_Blocks`

    CREATE TABLE IF NOT EXISTS `geoLiteCity_Blocks` (
    `startIpNum` bigint( 11 ) unsigned NOT NULL default ’0′,
    `endIpNum` bigint( 11 ) unsigned NOT NULL default ’0′,
    `locId` bigint( 11 ) unsigned NOT NULL default ’0′
    ) ENGINE = MYISAM DEFAULT CHARSET = utf8;
    what should i do?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>