Contents of the manual
Introduction
Welcome to the HLX:CE setup tutorial brought to you by Angrygaming Network.
We will be showing you how to set the HLX:CE stats step by step. We hope that using this manual you will be able to set your stats yourself.
Files and folders
The first thing you have to do is download latest current HLX:CE build. You can download it at http://code.google.com/p/hlstatsxcommunity/downloads/list/
Unzip the application with your choice of winzip, winrar, 7-Zip, personally I use winrar or 7-zip.
After unzipping the archive, your stats files and folders should look like this.
Setting up the SQL database
Using whatever panel is given by your VPS, Web Provider access the MySQL creation section. In cPanel you can use the wizard so you create the database as well as the user associated with it.
Now following the steps of the wizard fill in the apropiate text fields with your preferences. I will be using the database name username_statsx and associate it with the username_admin.
Step 1, step 2 and step 3.
Now that you have created an SQL database, you have to add the SQL tables that HLX:CE uses. To do that you should find phpMyAdmin tool in your Databases category.
Uploading and editing the web files
Before uploading any files you should know that some folders of your FTP site are accessible to the public and some are not. The public CAN access the files that are within the public_html and public_ftp folders, anything above these folders ARE NOT accessible to the public.
Using your preferred FTP client transfer the files inside the web directory to the desired location under your public_html directory. In this manual we will be uploading the files to public_html/stats/ folder which will be accessible to the public.
If you do not have an FTP client, the makers of Firefox offer Filezilla which is a free FTP program that can be downloaded HERE.
Uploading the files will take some time depending because there are more than 4000 files that need to be uploaded.
Now that we have created the database, imported the SQL TABLE for the database and copied over the web files, it is now time to input that information into our configuration files HLX:CE uses to communicate with your web service.
You can do this in two ways: use the file manager provided by cPanel or you can also edit the files locally using wordpad or another text file editor then upload and over-write them through FTP. The choice is yours.
The file we will have to edit is config.php. To edit the config.php file, you have to open it with wordpad or some other text editor. My personal favourite is Notepad++ which can be downloaded at http://notepad-plus.sourceforge.net/uk/. It opens and displays the text properly and can highlight different programming languages. Tthe config.php file is written in the PHP programing language.
In the config.php file you will have to add the SQL database name, database username and password.
Once you have uploaded the edited config.php file, you can try and access your stats page at http://your.domain.com/stats/. You should see this.
You should click on /hlstats.php?mode=updater and once the update has been completed (if any) you will have to remove the updater folder and its contents from the public_html directory. Once you remove the updater folder, your web part should be fully functional.
This means we should now set up the script side of the stats.
Uploading and editing the script files
You should upload the scripts folder to the same folder your public_html and public_ftp folders are located in. This way the scripts will not be accessible via web.Once you have finished uploading the script files, you will have to edit the hlstats.conf file. It is pretty much the same as edditing the config.php from the web part. I have marked the lines that you would have to edit. The port number should be the one you will be sending your server logs to. If you are a member of the Angrygaming Network, you should have received the port number by email or if you haven't, please request one.
Afterwards, you will need to set the correct file permissions. Right click on scripts folder in ftp and select File Permissions.
Starting the stats daemon
Well, this is the tricky part. To connect to your SSH, you will have to download a program called PuTTY. You can download it from here. http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
First, lets create a new session for your stats. In the Host name or IP address part enter your stats domain name. You can name your session whatever you want. In the example I have two sessions created.
Now that we have a session created, you can double click a session name and a black window will come up. There you will have enter your username and password. You wont see what you are typing while entering your password so make sure you type it correctly.
When you have successfully logged into your account, it should look like this.
You will need only three lines while managing your stats daemon via SSH. One for starting the daemon, one for stopping the daemon and one for restarting the daemon.
The command lines are:
You can copy-paste those lines to your putty by right-clicking on the window. This way you wont have to type the long line. Also, the server remembers all the commands you have entered in SSH so once you have entered the restart command to SSH, you will be able to find it by pushing the up arrow key once you log in to your SSH.
Now you should start your stats daemon. Starting the daemon once via SSH doesnt mean that the daemon will work forever. The daemon may crash but there you have a thing like CRON jobs to start the daemon back up.
Setting up CRON jobs
The CRON job menu can be accessed via cPanel when you click on the CRON jobs icon in the Advanced tab.
A CRON job in a nut shell is a command that is executed in the server on a given time. The CRON job can be scheduled to be hourly, daily, weekly, etc. The time the command will be executed is described by five variables: minute, hour, day of month, month, day of week.
We will be using CRON jobs for making sure the stats daemon is running and for daily award generation.
The command line ~/scripts/run_hlstats start 1 portnumber will attempt to start the daemon. If the stats daemon is already running, nothing wrong will happen. It is a good idea to have this command run every 30 minutes.
The other command we will need is cd ~/scripts && ./hlstats-awards.pl -iargoIt runs the awards calculation process. The -iargo parameter means that player activity, awards and ribbons will be recalculated, missing IP locations will be tried to resolve and the database will be optimized and the script will prune all old events. This command should be executed each night, best to run it some time after midnight. Notice that the cron jobs are executed according to the servers time so you might need to adjust the awards calculation time so that the awards would be executed after 00:00 your gameserver's time.
Configuring Your Stats Web Frontend and adding your gameservers
Now it comes time for the web part of it all. You need to go to your stats web page. Type in the URL that you uploaded the web portion to. My typical format is domain.com/stats or customname.hlxce.net
Browse to the bottom of the webpage and click on ADMIN
The default username and password is username: admin password: 123456
Fill out the necessary information. My example.
Now we need to tell the gameservers we have where to send the stats exactly.Depending on your provider there are a few ways you can do this. One way is to edit your autoexec.cfg or server.cfg file locally and then upload it via FTP.
If your gameserver is running on a non-source engine, like Counter-Strike 1.6 or Day of Defeat, you should add this text to the very bottom of your server.cfg:
If your gameserver is running on a source engine or later (CS:S, DOD:S, TF2), you should add this text to the very bottom of your server.cfg:
Now before you restart your gameservers. If you use sourcemod on your servers then now is the time to use your preferred FTP client connect to your gameserver and just like you have with other addons for sourcemod drag the folder from the sourcemod directory under the HLXCE Installation you unzipped into the addon's section of sourcemod on your gameserver. If you do not use sourcemod then just ignore this step and when you add your gameservers for mod just choose none. Now before you restart your servers go ahead and add them via the admin panel under HLXCE. I will be adding a TF2 Server as an example.
When we have the gameservers added to the web part and have edited the server configuration, we have to reload the daemon so that the stats configurations could go live.
Reloading the HLX:CE Daemons
Log into the admin page on your HLX:CE stats and click HLstatsX:CE Daemon control. In the daemon port field, specify the port number you are using/are assigned to and click EXECUTE. The daemon should reload the configuration and your stats should start working!