narugo3 Posted November 15, 2016 Posted November 15, 2016 Hello, i've added helio nameserver at domain http://hlstatsx.tk./ for http://hlstatsx-ins.heliohost.org/ but still only works with ( . ) after tk./http://hlstatsx.tk./http://hlstatsx.tk/ I think this guy had same issue, but not shared how fixed it :shttp://www.helionet.org/index/topic/26546-addon-domain/ PS: I would like to ask if i can use 1 port udp/tcp (default 27500) or any unused by steam and srcds
wolstech Posted November 15, 2016 Posted November 15, 2016 That domain works fine without the . for me. If you need a non-standard outbound port that is open, please use 58070. 1
narugo3 Posted November 18, 2016 Author Posted November 18, 2016 That domain works fine without the . for me. If you need a non-standard outbound port that is open, please use 58070. Thanks so much, 2 days after post worked without http://www.hlstatsx.tk/ or http://hlstatsx.tk./ another question cronjob i have permission to run it?cd path/to/scripts/folder./run_hlstats start #!/bin/bash <<-- if yes, its right? #!/bin/bash# HLstatsX Community Edition - Real-time player and clan rankings and statistics# Copyleft (L) 2008-20XX Nicholas Hastings (nshastings@gmail.com)# http://www.hlxce.com## HLstatsX Community Edition is a continuation of# ELstatsNEO - Real-time player and clan rankings and statistics# Copyleft (L) 2008-20XX Malte Bayer (steam@neo-soft.org)# http://ovrsized.neo-soft.org/## ELstatsNEO is an very improved & enhanced - so called Ultra-Humongus Edition of HLstatsX# HLstatsX - Real-time player and clan rankings and statistics for Half-Life 2# http://www.hlstatsx.com/# Copyright © 2005-2007 Tobias Oetzel (Tobi@hlstatsx.com)## HLstatsX is an enhanced version of HLstats made by Simon Garner# HLstats - Real-time player and clan rankings and statistics for Half-Life# http://sourceforge.net/projects/hlstats/# Copyright © 2001 Simon Garner## This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License# as published by the Free Software Foundation; either version 2# of the License, or (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.## For support and installation notes visit http://www.hlxcommunity.com #------------------------------------------------------------------------------# Usage# Information on how to use this script can be found on our wiki:# http://wiki.hlxce.com#------------------------------------------------------------------------------ #------------------------------------------------------------------------------# Script Configuration# These parameters allow you to adjust various functions of the daemon.# In general, they should not need to be modified.# Please visit our wiki for more information: http://wiki.hlxce.com #------------------------------------------------------------------------------# SCRIPTPATH:# File system path to daemon and supporting files# NOTE: This is only needed if the other scripts files will be in another directory.# In general, NO TOUCHY! SCRIPTPATH=.#------------------------------------------------------------------------------ #------------------------------------------------------------------------------# CONFFILE:# Specifies the configuration file (relative to SCRIPTPATH) to use for the daemonCONFFILE=hlstats.conf#------------------------------------------------------------------------------ #------------------------------------------------------------------------------# DAEMON:# Specifies the daemon Perl script to be usedDAEMON=hlstats.pl#------------------------------------------------------------------------------ #------------------------------------------------------------------------------# LOGDIR:# Specifies the location to store logsLOGDIR=${SCRIPTPATH}/logs#------------------------------------------------------------------------------ #------------------------------------------------------------------------------# LOGDATE:# Specifies the date format to use in log file namesLOGDATE_FORMAT=%Y-%m-%d_%H-%M-%S#------------------------------------------------------------------------------ #------------------------------------------------------------------------------# PIDDIR:# Specifies location to store daemon PID filesPIDDIR=${SCRIPTPATH}#------------------------------------------------------------------------------ #------------------------------------------------------------------------------# Nothing to modify below hereWEBSITE=http://www.hlxce.comWIKI=http://wiki.hlxce.com # Start outputechoecho "HLstatsX:CE daemon control"echo "${WEBSITE}"echo "---------------------------" # Change to directory of scriptcd `dirname ${0}` # Perform some initial checks before we encounter later errors# Check if we can write to the SCRIPTPATHif [ ! -w ${SCRIPTPATH} ]; thenecho "CRITICAL ERROR: Could not write to SCRIPTPATH: ${SCRIPTPATH}"echo "Verify you have write access to this directory."echo "Visit our wiki for more information: ${WIKI}."exit 1fi # Check if the daemon perl script existsif [ ! -f ${SCRIPTPATH}/${DAEMON} ]; thenecho "CRITICAL ERROR: Cannot access the daemon: ${DAEMON}"echo "Verify that the daemon, and corresponding files, exist in ${SCRIPTPATH}"echo "Visit our wiki for more information: ${WIKI}."exit 1fi # Verify shebang line in daemonSHEBANG=`head -n1 ${SCRIPTPATH}/${DAEMON}`if [[ ${SHEBANG} =~ ^#! ]]; thenSHEBANG_BINARY=`echo "${SHEBANG}" | sed 's/^#!//'`if [ ! -f ${SHEBANG_BINARY} ]; thenecho "CRITICAL ERROR: The path to Perl is incorrect in ${DAEMON}."echo "Current Perl path in shebang: ${SHEBANG_BINARY}"echo "Visit our wiki for more information: ${WIKI}."echoecho "Potential paths for Perl: "echo `which perl`exit 1fielseecho "CRITICAL ERROR: The shebang line is incorrectly configured. Please verify that your shebang line is correct in ${DAEMON}."echo "Current shebang line: ${SHEBANG}"echo "Visit our wiki for more information: ${WIKI}."exit 1fi # Create logdir if neededif [ ! -d ${LOGDIR} ]; thenmkdir ${LOGDIR}fi # Make sure we can write to logdirif [ ! -w ${LOGDIR} ]; thenecho "CRITICAL ERROR: Could not write to the log folder: ${LOGDIR}"echo "Verify that you have write access to the log folder."echo "Visit our wiki for more information: ${WIKI}."exit 1fi # Daemon control functionsfunction start_daemon {# This function handles the creation of a new daemon process.# This function requires one parameter: PORT# Returns:# 0 - Daemon started# 1 - Daemon failed to start# 2 - Daemon already running if [ ! $1 ]; thenecho "CRITICAL ERROR: No port was received on function start_daemon"exit 1elselocal PORT=$1fi local LOG=${LOGDIR}/hlstats_${PORT}_`date +${LOGDATE_FORMAT}` local PID=`get_pid ${PORT}`# Check if a PID exists for this port numberif [ "${PID}" != "" ]; then# PID exists -- check if the daemon is running.kill -0 ${PID} &> /dev/nullif [ $? -eq 0 ]; then# Daemon running -- nothing to do.return 2else# Daemon not running -- remove pid.remove_pidfile ${PORT}fifi # Start the daemon on requested portecho -ne "Attempting to start HLstatsX:CE daemon on port ${PORT}..."${SCRIPTPATH}/${DAEMON} --configfile=${CONFFILE} --port=${PORT} &> ${LOG} &# Store PID in memory until we verify Daemon has launchedPID=$! # Perform one quick check to see if PID is runningkill -0 ${PID} &> /dev/nullif [ $? -eq 0 ]; thencreate_pidfile ${PORT} ${PID}echo ""return 0else# PID not detected in time, keep checking for 10 more seconds.local i=1while [ $i -le 10 ]doecho -ne " ${i}"sleep 1# Perform a kill check against saved PIDkill -0 ${PID} &> /dev/null# Check results of pid testif [ $? -eq 1 ]; then# Process does not existlet i++if [ $i -eq 10 ]; then# Daemon did not respond to start request within 10 seconds.return 1fielse# Daemon started successfully -- commit PID to filecreate_pidfile ${PORT} ${PID}echo ""return 0fidonefi} function stop_daemon {# This function handles shutting a daemon down.# This function requires one parameter: PORT. # Returns:# 0 - Daemon gracefully stopped# 1 - Daemon forcefully stopped# 2 - Daemon could not be stopped# 3 - No daemon to stop or PID missing if [ ! $1 ]; thenecho "CRITICAL ERROR: No port was received on function stop_daemon"exit 1elselocal PORT=$1fi local PID=`get_pid ${PORT}` if [ ${PID} -eq 0 ]; thenreturn 3fi # Attempt to stop the daemonecho -n "Attempting graceful shutdown of HLstatsX:CE daemon on port ${PORT} "kill -INT ${PID} &> /dev/null if [ $? -ne 0 ]; then# Daemon is not running, purge the PID.remove_pidfile ${PORT}echo ""return 3else# Found running PID -- perform a quick check before entering loopkill -0 ${PID} &> /dev/nullif [ $? -eq 1 ]; then# Daemon stopped, remove PIDremove_pidfile ${PORT}echo ""return 0elselocal i=1while [ $i -le 10 ]doecho -n " ${i}"sleep 1# Perform a kill check against saved PIDkill -0 ${PID} &> /dev/nullif [ $? -eq 0 ]; then# Daemon still operatinglet i++else# Daemon stopped, remove PIDremove_pidfile ${PORT}echo ""return 0fidonefi # Daemon did not respond to shutdown, attempt a forced killecho ""echo "WARNING: Daemon did not respond to a graceful shut down. Forcing a shut down on port ${PORT} "local i=1while [ $i -le 5 ]dokill -KILL ${PID} &> /dev/nullecho -n " ${i}"sleep 1 # Check if PID is still presentkill -0 ${PID} &> /dev/null if [ $? -eq 0 ]; then# Daemon still operatinglet i++else# Daemon stopped successfully.remove_pidfile ${PORT}echo ""return 1fidonereturn 2fi} function reload_daemon {# This function handles reloading a daemon down.# This function requires one parameter: PORT. # Returns:# 0 - Reload sent successfully# 1 - Daemon not running or pid file missing # Sanity check on incoming required parameterif [ ! $1 ]; thenecho "CRITICAL ERROR: No port was received on function reload_daemon"exit 1elselocal PORT=$1fi local PID=`get_pid ${PORT}`# Check to verify the daemon is operationalif [ ${PID} -ne 0 ]; thenkill -0 ${PID} &> /dev/nullif [ $? -eq 0 ]; thenkill -HUP ${PID} &> /dev/nullreturn 0elsereturn 1fielsereturn 1fi} function check_port {# This function verifies user input on the port number# One argument is required # Returns:# 0 - Valid input# 1 - Invalid Input (non-digit or not in UDP port range) if [ $1 ]; then# Perform regex test on inputecho ${1} | grep -q '^[0-9]\{1,5\}$'# Check if within range and if grep test was successful.if [ $? -eq 0 ] && [ $1 -le 65535 ] && [ $1 -ge 1 ]; thenreturn 0elsereturn 1fifi} function get_status {# This function performs a lookup for the PID on specified port and checks status# Parameters:# 1 - port # Returns:# 0 - PID is running# 1 - PID is not running# 2 - Invalid PID if [ $1 ]; thenlocal PID=`get_pid ${1}`if [ "${PID}" != "" ]; thenkill -0 ${PID} &> /dev/nullif [ $? -eq 0 ]; thenreturn 0elsereturn 1fielsereturn 2fifi} function create_pidfile {# This function will handle the creation of a PID file for a corresponding port# Parameters required:# 1 - port number# 2 - PID # Returns:# 0 - PID saved# 1 - Unable to save PID if [[ $1 && $2 ]]; thenPIDFILE=${PIDDIR}/hlstats_${1}.pidecho ${2} > ${PIDFILE} if [ "`cat ${PIDFILE}`" -eq "${2}" ]; thenreturn 0elsereturn 1fifi} function remove_pidfile {# This function will handle the deletion of a PID file for a corresponding port# Parameters required:# 1 - port number # Returns:# 0 - PID removed# 1 - PID does not exist if [ $1 ]; thenPIDFILE=${PIDDIR}/hlstats_${1}.pidrm -f ${PIDFILE} &> /dev/nullif [ $? -eq 0 ]; thenreturn 0elsereturn 1fifi} function get_pid {# This function will echo out the found pid and return 0, or return 1 if it finds nothing# Parameters required:# 1 - port number # Output# Requested PID on return 0 # Returns:# 0 - PID number for corresponding process# 1 - No PID file for specified port if [ $1 ]; thenPIDFILE=${PIDDIR}/hlstats_${1}.pidPID=`cat ${PIDFILE} 2> /dev/null`if [ $? -eq 0 ]; thenecho ${PID}return 0elsereturn 1fifi} # Cleanup old legacy run_hlstats stuff# Check if hlstats.pid exists (original pid from legacy run_hlstats)if [ -f ${PIDDIR}/hlstats.pid ]; thenecho "WARNING: A old PID file has been detected. To prevent further troubles this daemon will be shut down."kill -KILL `cat ${PIDDIR}/hlstats.pid` &> /dev/nullsleep 1# Check if PID is deadi=1while [ $i -le 5 ]dokill -0 `cat ${PIDDIR}/hlstats.pid` &> /dev/nullif [ $? -eq 0 ]; then# Daemon still operatinglet i++sleep 1else# Daemon stopped successfully.rm -f ${PIDDIR}/hlstats.pidecho ""echo "HLstatsX:CE daemon has been forcefully stopped."echo "Please re-run this script to control your daemon."exitfidonefi # Daemon control case switchercase "$1" instart)# Usage: run_hlstats start <# of daemons> # All arguments are optional# Defaults: # of Daemons = 1; First port number = 27500; Port increment number = 1NUMDAEMONS=1STARTPORT=27500INCREMENT=1 # Get user-specified number of daemonsif [ $2 ]; thenNUMDAEMONS=$2fi if [ $3 ]; thencheck_port $3if [ $? -eq 0 ]; thenSTARTPORT=$3elseecho "CRITICAL ERROR: An invalid port number was specified."exit 1fifi if [ $4 ]; thenINCREMENT=$4fi # Saving this for a future release -- right now this would prevent people from running run_hlstats every few minutes to make sure their daemon is operational.#else# # Lookup the highest currently used port number# LASTPORT=`ls ${PIDDIR} | egrep 'hlstats_[0-9]{1,5}.pid' | egrep -o '[0-9]{1,5}' | tail -1`# if [ "${LASTPORT}" != "" ]; then# # We have currently running daemons, to take the current highest port number and increment it# let STARTPORT=LASTPORT+INCREMENT# fi##fi i=0CURRENTPORT=${STARTPORT}while [ ${i} -lt ${NUMDAEMONS} ]dostart_daemon ${CURRENTPORT}case $? in0)echo "Daemon successfully started on port ${CURRENTPORT}"let CURRENTPORT=CURRENTPORT+INCREMENTlet i++;;1)echo "CRITICAL ERROR: Unable to start daemon on port ${CURRENTPORT}"exit 1;;2)echo "Daemon is already running on port ${CURRENTPORT}"let CURRENTPORT=CURRENTPORT+INCREMENTlet i++;;esacdone;; stop)# Usage: run_hlstats stop # All arguments are optional# Defaults: port = ALL if [ $2 ]; thencheck_port $2if [ $? -eq 0 ]; thenPORT=$2elseecho "CRITICAL ERROR: An invalid port number was specified."exit 1fielsePORT=0fi # Stop a single daemonif [ ${PORT} -ne 0 ]; thenstop_daemon ${PORT}case $? in0)echo "Daemon gracefully stopped on port ${PORT}"exit 0;;1)echo "Daemon forcefully stopped on port ${PORT}"exit 0;;2)echo "WARNING: Daemon could not be stopped on port ${PORT}"exit 1;;3)echo "No daemon running on port ${PORT} or PID file is missing."exit 1;;esacfi # Stop all daemonsPORTS=`ls ${PIDDIR} | egrep 'hlstats_[0-9]{1,5}.pid' | egrep -o '[0-9]{1,5}'`if [ $? -eq 0 ]; thenfor port in ${PORTS} ; dostop_daemon ${port}case $? in0)echo "Daemon gracefully stopped on port ${port}";;1)echo "Daemon forcefully stopped on port ${port}";;2)echo "WARNING: Daemon could not be stopped on port ${port}";;3)echo "No daemon running on port ${port} or PID file is missing.";;esacdoneelseecho "No daemons found running, or PID files are missing."exit 1fi;; restart)# Usage: run_hlstats restart # All arguments are optional# Defaults: port = ALL if [ $2 ]; thencheck_port $2if [ $? -eq 0 ]; thenPORT=$2elseecho "CRITICAL ERROR: An invalid port number was specified."exit 1fielsePORT=0fi # Handle individual restart requestif [ ${PORT} -ne 0 ]; thenstop_daemon ${PORT}case $? in0 | 1 | 3)start_daemon ${PORT}if [ $? -eq 0 ]; thenecho "Daemon successfully restarted on port ${PORT}"exit 0elseecho "CRITICAL ERROR: Failed to restart daemon on port ${PORT}"exit 1fi;;2)echo "WARNING: Daemon could not be stopped on port ${port}"exit 1;;esacfi # Restart all PIDsPORTS=`ls ${PIDDIR} | egrep 'hlstats_[0-9]{1,5}.pid' | egrep -o '[0-9]{1,5}'`if [ $? -eq 0 ]; thenfor port in ${PORTS} ; dostop_daemon ${port}case $? in0 | 1 | 3)start_daemon ${port}if [ $? -eq 0 ]; thenecho "Daemon successfully restarted on port ${port}"elseecho "WARNING: Failed to restart daemon on port ${port}"fi;;2)echo "WARNING: Daemon could not be stopped on port ${port}"exit 1;;esacdoneelseecho "WARNING: No HLstatsX:CE daemons currently running."exit 1fi;; reload)# Usage: run_hlstats reload # All arguments are optional# Defaults: port = ALL if [ $2 ]; thencheck_port $2if [ $? -eq 0 ]; thenPORT=$2elseecho "CRITICAL ERROR: An invalid port number was specified."exit 1fielsePORT=0fi # Handle individual reload requestif [ ${PORT} -ne 0 ]; thenreload_daemon ${PORT}if [ $? -eq 0 ]; thenecho "Successfully reloaded daemon running on port ${PORT}"exit 0elseecho "WARNING: Unable to reload daemon on port ${PORT} (daemon might not be running)"exit 1fifi # Reload all PIDsPORTS=`ls ${PIDDIR} | egrep 'hlstats_[0-9]{1,5}.pid' | egrep -o '[0-9]{1,5}'`if [ "${PORTS}" != "" ]; thenfor port in ${PORTS} ; doreload_daemon ${port}if [ $? -eq 0 ]; thenecho "Successfully reloaded daemon running on port ${port}"elseecho "WARNING: Unable to reload daemon on port ${port} (daemon might not be running)"fidoneelseecho "WARNING: No HLstatsX:CE daemons currently running."exit 1fi;; status)# Usage: run_hlstats status # All arguments are optional# Defaults: port = ALL if [ $2 ]; thencheck_port $2if [ $? -eq 0 ]; thenPORT=$2elseecho "CRITICAL ERROR: An invalid port number was specified."exit 1fielsePORT=0fi # Handle individual status requestif [ ${PORT} -ne 0 ]; thenget_status ${PORT}case $? in0)echo "Daemon on port ${PORT} is currently running."exit 0;;1)echo "A stale process was found for daemon on port ${PORT}."exit 0;;2)echo "There is no daemon running on port ${PORT}."exit 0;;esacfi # Reload all PIDsPORTS=`ls ${PIDDIR} | egrep 'hlstats_[0-9]{1,5}.pid' | egrep -o '[0-9]{1,5}'`if [ "${PORTS}" != "" ]; thenfor port in ${PORTS} ; doget_status ${port}case $? in0)echo "Daemon on port ${port} is currently running.";;1)echo "A stale process was found for daemon on port ${port}. It has been removed.";;2)echo "There is no daemon running on port ${port}.";;esacdoneelseecho "WARNING: No HLstatsX:CE daemons currently running."exit 1fi;; *)echo "Usage"echo "All optional arguments are in <>. The default is in ()."echo ""echo -e "\trun_hlstats start "echo -e "\trun_hlstats stop "echo -e "\trun_hlstats status "echo -e "\trun_hlstats restart "echo -e "\trun_hlstats reload ";;esacexit
wolstech Posted November 18, 2016 Posted November 18, 2016 HLStats will not run here since we don't allow custom daemons. It'd probably start, but the server will either suspend you for load or kill the process for taking too long (there's a limit on how long a cron can run). You can only have 2 executions per day too. You'll be better off developing something in PHP that pulls and updates your stat data whenever a user accesses the website. That way the data is always fresh, and there's nothing running in the background. 1
narugo3 Posted November 19, 2016 Author Posted November 19, 2016 thanks, deleted cron-job and files about hlstatsx:ce about that port is closed cant connect. i want isntall sourcebans like this http://edge-gamers.heliohost.org/bans/index.php?p=servers&s=0
wolstech Posted November 19, 2016 Posted November 19, 2016 That site is owned by a user who frequents these boards named luigi123. He uses port 51990 for that sourcebans site, and I use it a minecraft server monitor as well. There are a few things that need to be done to get it running, but it does work. Be aware you need to configure your game server to expect the connections on port 51990, and you need to add your game server's IP in the Remote MySQL in cPanel here so it can get to the database. This topic: http://www.helionet.org/index/topic/23514-access-from-my-game-server-to-my-web-server/ might help you get started with it. Some of his other topics might be of interest to you as well: http://www.helionet.org/index/index.php?app=core&module=search&do=user_activity&mid=96430 1
Luigi123 Posted November 21, 2016 Posted November 21, 2016 Hello Narugo,I can show you how to install Sourcebans. Just add me on Steam here: http://steamcommunity.com/id/Luigi122/ or if you don't have a Steam, you can download one from here: http://store.steampowered.com/about/ and sign up if you don't have a Steam account. 2
narugo3 Posted December 3, 2016 Author Posted December 3, 2016 /fixed after 1 day, worked without any change, edited .htaccess but nothing about that. about port, any chance to have 27019 27029 27023 for sourcebans ?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now