Install Instructions
설치 길라잡이
Introduction!
길라잡이!
Greetings!
반갑습니다!
I have updated the wiki to make it alot more clear on installing HLX:CE on both Windows and Linux systems. Before we start please check the requirements page to make sure that HLX:CE will run on your set up.
저는 HLX:CE 를 리눅스와 윈도우 시스템에서 더 확실한 설치 정보를 제공하기 위해 이 위키를 업데이트하게 되었습니다.
This has been tested on Windows 7 & Debian Linux, if there is a work around that is needed please post it on the forums
here. And i will update the wiki to match the needed changes.
이 위키는 데비안 리눅스와 윈도우7에서 시험했음을 먼저 밝힙니다. 만약 도움이 필요하시면
이
포럼에 방문해주시기 바랍니다. 또한 저는 수정이 필요한 변화사항에 대해 위키를 업데이트 할 것입니다.
HLX:CE Set Up
HLX:CE is divided into a few parts. All parts are equally important to HLX:CE as a whole and will be explained below.
HLX:CE 는 몇가지 부분으로 나뉘어져 있습니다. 아래에 설명된 모든 부분은 HLX:CE 에 있어 확실히
중요한 부분입니다.
Step 1 - Download HLX:CE
The latest version of HLX:CE can always be found
here].
HLX:CE의 최신버전은
이 곳에서 접하실 수 있습니다.
Step 2 - Uploading the Files
The zip or tar file you have first needs to be decompressed on windows you can right click on the file and extract. For Linux you can type the following
다운받은 Zip 또는 Tar 파일은 압축을 해제해 줄 필요가 있습니다. 오른쪽 클릭을 이용하여 파일을 압축해제 해주세요. 리눅스는 아래의 절차를 따라주세요.
tar -zxvf HLXCE-1.X.X-FULL.tar.gz
Replacing the X's with the current version.
X 로 표기되어 있는 부분은 현재 다운받으신 버전의 숫자로 변경하여 입력해 주세요.
After you unzip the file you are going to see the following folders
압축해제한 압축파일에는 다음과 같은 폴더를 볼 수 있습니다.
- amxmodx
- heatmaps
- scripts
- sourcemod
- sql*
- web*
You will need to upload the web folder to your website. To check this go to
http:yoursite/stats/
여러분은 web 폴더를 여러분의 웹 사이트에 업로드 해야합니다. 업로드가 정상적으로 수행되었는지 확인하고 싶으면
여러분의 웹사이트 주소와 하위 디렉토리인 /stats 를 입력하세요.
If you are running Sourcemod on your servers then you need to go into the Sourcemod folder and add the plugin to your server. The same go's for AMXMod.
만약에 Sourcemod (소스모드) 를 사용하고 있다면 여러분은 sourcemod 폴더와 플러그인을 여러분의
서버에 추가해야 합니다. AMXMod도 마찬가지 입니다.
For the SQL folder you only need to upload the install.sql file, this does not have to be in the public folder but does need to be accessed from the command line SSH
The last folder you need to have upload is the scripts folder, most of the time you are going to want the scripts AKA:Damon folder on the same server as the database, in 90% of cases this is going to be the website. For this folder it is extra important that people can not access this from the website. IE do not put it in the folder where you can see it in your browser. This is for security reasons.
Step 3 - Configuring the Website and daemon.
On the web server open the config.php with a text editor and fill out the needed data.
// DB_NAME - The name of the database
define("DB_NAME", "hlstatsx");
// DB_USER - The username to connect to the database as
define("DB_USER", "hlxuser");
// DB_PASS - The password for DB_USER
define("DB_PASS", "hlxpassword");
// 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");
Exit and save the file.The website part is done… for now!
For the deamon it is just another text file. Open the hlstats.conf file in the scripts folder with a text editor. Now fill the following.
# DBHost - Database server "address" or "address:port". Address can be an IP or
# 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 ""
!!!!! NOTE !!!!! Read the rest of the daemon config and adjust Cpanel setting only if you can not get the daemon on to run with out it.
Step 4-Setting up SQL
Now we need to import the database,For this i am going to be showing the command line way for linux and windows, Thre are many GUI tools such as
phpMy Admin and
Navicat But because those require extra setup i will not be covering them. If you are running Cpanel you can also use this to import your DB instructions for that are
here
Go to the folder where you uploaded install.sql and use the following command line to import the sql tables and config into your sql database:
mysql -uhlxuser -phlxpassword hlstatsx < install.sql
A few seconds / minutes will pass and the SQL database will be filled with the required tables.
Step 5-Running the daemon
Because this differs so much from windows and Linux i am going to split this up covering both.
Linux
We need to make the following files executable:
- hlstats-awards.pl
- hlstats.pl
- hlstats-resolve.pl
- run_hlstats
To do this we type the following
chmod +x hlstats-awards.pl hlstats.pl hlstats-resolve.pl run_hlstats
Once we make the files executable we going to want to test that every thing is working. Type the following.
cd path/to/scripts/folder
./run_hlstats start
You should now see on your screen something like this.
HLstatsX:CE daemon control
http://www.hlxce.com
---------------------------
Attempting to start HLstatsX:CE daemon on port 27500...
Daemon successfully started on port 27500
If you see any errors here STOP and go back. Make sure you did not make a typo in your config files, also check the log folder inside the scripts folder there should be an log file with detailed errors.
After you have tested all that we now need to run the files every so offtion to make sure that every thing runs smooth. For this we are going to use cron jobs.
Before we get to the jobs them self lets lay out when we want the files to be run.
- run_hlstat - We want to run this about every 5 mins to make sure the daemon has not crashed
- hlstats-awards.pl - This needs to be run once a day other wise you will have no awards, This is also the script that translate ip's to locations and the general maintenance of the DB
Now that we have that setup we can enter our cron jobs. type the following then copy the code to fit your file locations.
crontab -e
*/5 * * * * cd /home/user/scripts/ && ./run_hlstats start >/dev/null 2>&1
15 00 * * * cd /home/user/scripts/ && ./hlstats-awards.pl >/dev/null 2>&1
After you have done that you are set as far as all the scripts go.
While we are here there are some extras that will help you that only work in Linux as of this writing.
In the scripts folder there is a folder called GeoLiteCity in there you can make the file install_binary.sh executable then run it. This will update the file HLX:CE uses to get the location of an ip address.
If there are any errors in the log file and it's not working, yet you have no idea what it means. Post it at the hlstatsx forums! Someone is bound to help you there!!
Windows
First install ActivePerl
- Run the ActivePerl installer accepting the defaults.
- Launch the Perl Package Manager from the Start Menu
- Install the additional Perl extensions <tt>DBD-mysql</tt> and <tt>Geo-IP-PurePerl</tt> by choosing the '''View All Packages button''' and then searching for the modules. Right click on the module and choose '''Install <package name>'''.
- Now check the "Run marked actions", and confirm the installation.
- You will receive a confirmation that the packages have been installed. This completes the setup for ActivePerl
After you have installed perl you need to run it as a service thanks to psychonic this is made easy go [
http://wiki.hlxce.com/wiki/HLXCEServ here] to set that up. You are done now with the daemon :D
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://ip/stats http://yoursite/stats/).
- Login as admin on the website (login url on bottom of page)
- *Username: admin
- *Password: 123456
- Go to '''Admin Users'''.
- *Make yourself a new user.
- *Give it admin privileges.
- *Delete the old admin user.
- Go to '''HLstatsX:CE Settings''' and edit the settings to your liking</div>
- Go to '''Games''' and select the game you want the stats page to facilitate. You can do this by setting the dropdown menu for that particular game to '''show''' and all other games to hide.
- Setting the above to the game you wish to host will unlock the '''Game Settings''' for that game. Click on this and then click on '''Quick-Add Server'''. Fill in all those required fields and hit the save button. This server will now be displayed on the main page as well.
- <div class="li">Logaddress.</div>
- 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 '''log on''' and '''logaddress_add ip:port'''.
- 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 '''logaddress_add ip:27500''' or for goldsrc games '''logaddress_add ip 27500'''.
- Gold src games
- cs
- hl1mp
- tf classic
- dod
- Rcon & Plugin
- The HlstatsX daemon communicates with the gameserver via rcon. Next to that it uses the hlstatsx plugin “talk” to the users via specific commands.
- Make sure that the rcon_password set on the server is the same password as used in the '''Game Settings''' on the website.
- To check if the plugin is correctly loaded (with sourcemod) type '''sm plugins list''' and look for hlstatsx in the 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 'help' in to the main chat window (defaultkey “y”) and read the windows contents!'''
십중팔구 여러분은 scripts 폴더를 여러분의 웹 사이트 기능을 하는 디렉토리에 업로드 할 것입니다.
이는 보안상의 이유로 자제해야 하는 행동입니다. 왜냐하면 이 스크립트들은 사용자가 접근하지 못하도록
차단하는 것이 보안상 적합한 행동이기 때문입니다.
http://support.hostgator.com/articles/cpanel/how-to-import-your-mysql-database
Mysql 에서 DB나 구절을 추가할 때 사용하는 명령어나 기법에 대한 가이드