This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| commissies:gamescom:manual_hlstatsx [2009/03/22 11:32] – willem | commissies:gamescom:manual_hlstatsx [2010/11/08 23:43] (current) – More text edits willem | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== HlStatsX Install Manual ====== | + | ===== Thanks for all he fish! ===== |
| - | ===== 1. Introduction | + | Sadly, because |
| - | Greetings! \\ | + | |
| - | \\ | + | |
| - | I've taken the liberty of making an install manual for those of you who wish to run a stats server under linux. \\ | + | |
| - | \\ | + | |
| - | Currently, there' | + | |
| - | \\ | + | |
| - | This installer is written on the **debian lenny** system | + | |
| - | Although most software and commands you use are the same, some may vary depending on what distribution OS you use. \\ | + | |
| - | \\ | + | |
| - | Please note you need at least some understanding on how to use basic commands on linux. Thought most commands and things you'll have to do to install HLStatsX on a linux machine are explained, I will not go in-dept to the linux commands used! \\ | + | |
| - | \\ | + | |
| - | All that is left now is to wish you luck :) \\ | + | |
| - | \\ | + | |
| - | If there are still questions regarding | + | |
| - | \\ | + | |
| - | -- Rawh out | + | |
| - | ===== 2. Requirements ===== | + | The people at hlxce.com have been so generous to copy over the content towards their own wiki. |
| - | * Linux software: | + | This installation |
| - | * linux web server ([[http:// | + | |
| - | * linux sql server (this install manual covers [[http:// | + | |
| - | * linux php5, < | + | |
| - | * OPTIONAL: phpmyadmin (for webbased sql management) | + | |
| - | * MySQL stuff: | + | |
| - | * Database (for this manual we use the database " | + | |
| - | * User with write access to the database (for this manual | + | |
| - | * Shell stuff: | + | |
| - | * Login user and password | + | |
| - | * Putty (windows ssh program to login on a server) | + | |
| - | * Stats software: | + | |
| - | * Latest hlstatsx (can be obtained from their [[http://www.hlxcommunity.com/forums/|website]].) | + | |
| - | ===== 3. Additional setup ===== | + | If you have any or more questions, please direct it toward their forum at: http://forums.hlxce.com |
| - | **Notice: \\ | + | This also goes to hints and/or other questions regarding |
| - | Please IGNORE these steps and continue to [[commissies:gamescom: | + | |
| - | This also applies | + | |
| - | \\ | + | |
| - | With debian there' | + | |
| - | \\ | + | |
| - | IMPORTANT: \\ | + | |
| - | - Before we are going to install any packages it's useful to update the current package list, you do this as the user " | + | |
| - | - Aptitude has to be run as " | + | |
| - | ==== 3.1. Linux webserver ==== | + | -- Rawh out |
| - | For the webserver on linux I tend to use apache2. Apache2 can be downloaded by typing: | + | |
| - | aptitude install apache2 | + | |
| - | The system will ask you several things which I can't answer for you. Just sit back, read the text and decide on your own. \\ | + | |
| - | After installing apache2, it will have created the directory / | + | |
| - | \\ | + | |
| - | In order to use apache2 for hlstatsx you are going to have to enable a few modules first. \\ | + | |
| - | The next kind of handlings might be a bit to much if you haven' | + | |
| - | \\ | + | |
| - | Apache2 can load different modules to enable userdirs. A userdir is a directory that is linked on apache for all users on a linux machine. If your user (called " | + | |
| - | Login as root on the linux machine. | + | |
| - | + | ||
| - | Go to the apache2 configuration directory (cd / | + | |
| - | Go to the apache2 mods-enabled directory (cd mods-enabled/ | + | |
| - | Type "ln -s ../ | + | |
| - | Now restart apache2 by typing "/ | + | |
| - | If all goes well and apache does not show any error, the public_html directory created above should now have it's files hosted on the internet. To test this lets go to the manual public_html directory (cd / | + | |
| - | + | ||
| - | ==== 3.2. Linux php5 ==== | + | |
| - | Another module to install with apache2 is php. Php is a scripting language originally designed for producing dynamic web pages ((Description shamelessly coppied from http:// | + | |
| - | \\ | + | |
| - | This module does not come with apache2 itself and has to be installed seperatly by typing: | + | |
| - | aptitude install php5 php5-mysql libapache2-mod-php5 | + | |
| - | The above will install php5, php5-cli (a commandline package for php5), php5-mysql (the ability for php5 to //talk// with mysql databases) and libapache2-mod-php5 (the library file to communicate between php and apache2). \\ | + | |
| - | \\ | + | |
| - | Aptitude should restart apache2 after it installed the above programs. Should this not be the case you can manually restart apache2 by typing: (as root) | + | |
| - | / | + | |
| - | \\ | + | |
| - | Now in order to test if apache2 and php are running we are going to create a test file. We will name this testfile " | + | |
| - | Below will be a short list of commands and instruction you can follow to create this file. There are ofcourse other ways of completing this part, but since we are installing things on linux I'm going to handle it via an editor which is available in linux by default: | + | |
| - | Go to your public_html dir of the user (cd / | + | |
| - | Start the editor with the filename already present (vi phpinfo.php). | + | |
| - | Hit the " | + | |
| - | Type the following: | + | |
| - | <? php | + | |
| - | phpinfo(); | + | |
| - | ?> | + | |
| - | Hit this " | + | |
| - | Hit the ":" | + | |
| - | It should show you the file has been saved. | + | |
| - | Next we are going to use a webbrowser to look at the file. Open your browser and browse to the machine. You can do this by either using the machine' | + | |
| - | + | ||
| - | ==== 3.3. Linux sqlserver ==== | + | |
| - | One of the requirements for HLStatsX is a SQL server. Though there are several sql servers I will only be handling mysql in this manual. | + | |
| - | Again, with debian lenny and the fantastic use of aptitude, we are going to let that program do the installing of the package: | + | |
| - | aptitude install mysql5-server | + | |
| - | aptitude will most likely present you with a screen that tells you it will need other packages as well to get the mysql5-server to be installed. Don't worry about that part, just accept the result by pressing " | + | |
| - | \\ | + | |
| - | Now that mysql has been setup we will have to setup usernames and passwords. First we are going to set the root password for mysql. To do this type the following in a shell: | + | |
| - | mysqladmin -u root password NEWPASSWORD | + | |
| - | Where NEWPASSWORD would be the password you'd like to set. | + | |
| - | Next in line we are going to create a user and a database. While there are almost endless possibilities to do this, I myself tend to use the commandline a lot (like the command mysqladmin shown above). For those of you who wish to do this yourself I'd advise phpmyadmin. Phpmyadmin is a tool that allows you to connect to a mysql server with a webbrowser and set it all up that way. You can install phpmyadmin by using aptitude again (as root ofc!) | + | |
| - | aptitude install phpmyadmin | + | |
| - | {{ http:// | + | |
| - | After installing it this way we're going to reset the apache2 server, just to be sure. | + | |
| - | / | + | |
| - | Next in line would be browsing to phpmyadmin. To your convenience phpmyadmin installs itself on the machine by using it's name as a directory to access. Just browse towards it using [[http://< | + | |
| - | \\ | + | |
| - | Next we are going to login to phpmyadmin using the username ' | + | |
| - | \\ | + | |
| - | + | ||
| - | ==== 3.4. PhpMyAdmin ==== | + | |
| - | Phpmyadmin has it's own manual which can be found [[commissies: | + | |
| - | + | ||
| - | ===== 4. HlstatsX setup ===== | + | |
| - | HlstatsX is divided into a few parts. All parts are equally important to HlstatsX as a whole and will be explained below. | + | |
| - | + | ||
| - | ==== 4.1 Stuff to do first ==== | + | |
| - | First we are going to create a few directories. | + | |
| - | install/ | + | |
| - | stats/ | + | |
| - | stats/ | + | |
| - | stats/ | + | |
| - | The install directory will keep the install file(s). You should use //' | + | |
| - | The stats/ | + | |
| - | cd /var/www/ | + | |
| - | ln -s / | + | |
| - | + | ||
| - | (Now your stats/ | + | |
| - | The stats/perl/ directory will be filled later as well. \\ | + | |
| - | \\ | + | |
| - | Second I'm going to create a user & database which HlstatsX will use. \\ | + | |
| - | No idea how to do this? Look at [[commissies: | + | |
| - | For the purpose of this manual I will use the following: | + | |
| - | Username: hlxuser | + | |
| - | Password: hlxpassword | + | |
| - | Database: hlstatsx | + | |
| - | + | ||
| - | ==== 4.2 Website part ==== | + | |
| - | Go to the //' | + | |
| - | \\ | + | |
| - | Go the the directory with the name //' | + | |
| - | // DB_NAME - The name of the database | + | |
| - | define(" | + | |
| - | + | ||
| - | // DB_USER - The username to connect to the database as | + | |
| - | define(" | + | |
| - | + | ||
| - | // DB_PASS - The password for DB_USER | + | |
| - | define(" | + | |
| - | + | ||
| - | // DB_ADDR - The address of the database server, in host:port format. | + | |
| - | // (You might also try setting this to e.g. ":/ | + | |
| - | // use a Unix domain socket, if your mysqld is on the same box as | + | |
| - | // your web server.) | + | |
| - | define(" | + | |
| - | Exit and save the file. Now copy over all the content of the //' | + | |
| - | cp -R / | + | |
| - | The website part is done... for now! | + | |
| - | + | ||
| - | ==== 4.3 SQL part ==== | + | |
| - | Go to the //' | + | |
| - | mysql -uhlxuser -phlxpassword hlstatsx < install.sql | + | |
| - | A few seconds / minutes will pass and the SQL database will be filled with the required tables. // | + | |
| - | // | + | |
| - | In addition to doing the import via the command line, you can also use [[commissies: | + | |
| - | + | ||
| - | ==== 4.4 Perl part ==== | + | |
| - | **Note: This is one of the core parts of Hlstatsx as it uses perl to open a listenserver to which the logs will be send. Be sure to understand what you are doing here as most of the problems of not getting it to work occur here!** \\ | + | |
| - | \\ | + | |
| - | + | ||
| - | Go to the //' | + | |
| - | # DBHost - Database server " | + | |
| - | # a hostname. The default MySQL port is 3306 (tcp). | + | |
| - | DBHost " | + | |
| - | + | ||
| - | # DBUsername - User to connect to the database as. | + | |
| - | DBUsername " | + | |
| - | + | ||
| - | # DBPassword - Password for the database user. | + | |
| - | DBPassword " | + | |
| - | + | ||
| - | # DBName - Name of the database to use. | + | |
| - | DBName " | + | |
| - | + | ||
| - | # DBLowPriority - Use INSERT DELAYED and DELETE LOW_PRIORITY for some queries. | + | |
| - | # This can give better performance, | + | |
| - | # " | + | |
| - | DBLowPriority 1 | + | |
| - | + | ||
| - | + | ||
| - | ## | + | |
| - | ## UDP Socket Settings (should match " | + | |
| - | ## | + | |
| - | + | ||
| - | # BindIP - IP address to bind to (leave empty to use all interfaces). | + | |
| - | BindIP "" | + | |
| - | + | ||
| - | # Port - Port to listen on for log data from the game servers. | + | |
| - | Port 27500 | + | |
| - | Save and exit the file. | + | |
| - | + | ||
| - | ** Note: In 6 of the 10 cases leaving //' | + | |
| - | + | ||
| - | After editting we need to make the following files executable: | + | |
| - | hlstats-awards.pl | + | |
| - | hlstats.pl | + | |
| - | hlstats-resolve.pl | + | |
| - | run_hlstats | + | |
| - | This can be done in 2 steps: \\ | + | |
| - | - Edit each file with your editor. Change the first line //'# | + | |
| - | - chmod the files with the ' | + | |
| - | To test if this works, run //' | + | |
| - | + | ||
| - | ==== 4.5 Plugins part ==== | + | |
| - | Go to the //' | + | |
| - | \\ | + | |
| - | My own servers are using sourcemod so I would naturally do: \\ | + | |
| - | - Change to the //' | + | |
| - | - Copy over the //' | + | |
| - | - Change to the //' | + | |
| - | - After which I will copy the .smx file from //'/ | + | |
| - | - Now all that remains is (re)start the server and the plugin will be loaded and installed :) \\ | + | |
| - | \\ | + | |
| - | I hope I haven' | + | |
| - | + | ||
| - | ==== 4.6 Finalization ==== | + | |
| - | Next in line would be enabling and using all we've done above and wrap it up into running stats: \\ | + | |
| - | - Website: | + | |
| - | - Go to the website URL (http:// | + | |
| - | - Login as admin on the website (login url on bottom of page) | + | |
| - | * Username: admin | + | |
| - | * Password: 123456 | + | |
| - | - Go to //' | + | |
| - | * Make yourself a new user. | + | |
| - | * Give it admin privileges. | + | |
| - | * Delete the old admin user. | + | |
| - | - Go to //' | + | |
| - | - Go to //' | + | |
| - | - Setting the above to the game you wish to host will unlock the //' | + | |
| - | - Perl **Important!** | + | |
| - | - Starting the Perl Daemon | + | |
| - | - Go to the //'/ | + | |
| - | - Start up the server by typing: //' | + | |
| - | * The above will start the program in the opened ssh session you are currently using. If you close this windows, so will the hlstats daemon and thus it won't log anything anymore. | + | |
| - | * You are able to also launch hlstats.pl into the background by typing //' | + | |
| - | * You can use the //' | + | |
| - | - The Daemon is running now. | + | |
| - | - Keeping it running | + | |
| - | * One of the most fantastic parts of linux is the crontab. The crontab can be compared to windows it's " | + | |
| - | * We are going to use the crontab to setup daily refreshes regarding the hlstats-awards. | + | |
| - | * We are also going to use the crontab to check if the server is still running every 5 minutes. | + | |
| - | - Crontab | + | |
| - | * Edit the crontab by typing //' | + | |
| - | * I can go quite into-dept on how crontab works, which I won't. Please have a look at [[http:// | + | |
| - | * Every 5 minute checks: //'*/5 * * * * cd / | + | |
| - | * Stats update each day at 23:55: //'55 23 * * * cd / | + | |
| - | * Updates the resolve database (ip --> address --> domain/host --> country) at 00:15: //'15 00 * * * cd / | + | |
| - | * Exit the crontab by typing: //': | + | |
| - | - Gameserver | + | |
| - | - Logaddress. | + | |
| - | * In order for the gameserver to send it's logs to the statsserver you need to enable logging and add a logaddress. | + | |
| - | * This is usually done in the config file of the server (server.cfg) by adding | + | |
| - | * Since our statsserver is hosted on the machine with IP <ip> and port 27500, we add the following lines to our server.cfg file: //'log on'// and //' | + | |
| - | - Rcon & Plugin | + | |
| - | * The HlstatsX daemon communicates with the gameserver via rcon. Next to that it uses the hlstatsx plugin " | + | |
| - | * Make sure that the rcon_password set on the server is the same password as used in the //' | + | |
| - | * To check if the plugin is correctly loaded (with sourcemod) type //'sm plugins list'// | + | |
| - | - Now join the server, wait for some players and see if the spam will start ingame :) | + | |
| - | + | ||
| - | ** Note: For more information regarding ingame commands, please type ' | + | |
| - | + | ||
| - | ===== 5. Possible errors & sollutions ===== | + | |
| - | This section will be filled over time with problems and their answers to it. | + | |
| - | ==== 5.1 Hlstats not getting any data ==== | + | |
| - | The vast majority of the time when the daemon isn't receiving the logs, the problem is one of the following: | + | |
| - | * The server is not logging (probably not the case since ps works) | + | |
| - | * The logaddress on the game server is incorrect (double check your logaddress_add line and make sure there are no logaddress_del or - logaddress_delall lines in any configs) | + | |
| - | * There' | + | |
| - | * There' | + | |
| - | * The daemon is listening on the wrong ip address | + | |
| - | + | ||
| - | ===== 6. Thanks!! ===== | + | |
| - | Pfff, that was quite a job getting putting this manual together! \\ | ||
| - | \\ | ||
| - | First I'd like to thank the following people: \\ | ||
| - | - **Psychonic** - //For making such a damn great program and for taking up all my constant whining on steamfriends, | ||
| - | - **Bully** - //For being there most of the time during the day and read this manual//. \\ | ||
| - | \\ | ||
| - | Again, if there are any questions and/or comments regarding this manual, please post them on the hlxcommunity forum (or send me a forum pm there)! \\ | ||
| - | \\ | ||
| - | Cheers for reading :) \\ | ||
| - | \\ | ||
| - | -- Rawh | ||