Ventrilo Server Setup

From Www.FreeNerd.net

Jump to: navigation, search


This guide is provided for informational purposes only. If you choose to use this guide for anything more than information, you do so "At Your Own Risk".

  • This guide will cover all you need to know to get Ventrilo server running at home for free

Contents

Pre-requisites

  • A computer running Linux. (I use Red Hat, CentOS, or Fedora. Any major disto of Linux should work as long as you have configured it correctly)
  • You have downloaded the files needed from Ventrilo
  • A home high speed broadband connection
  • You will need to know how to forward ports through your home router to your Ventrilo server. (You need port 3784, both UDP and TCP forwarded to the IP address of the server running Ventrilo Server.)

Extract files

Copy the ventrilo_srv-*-Linux-i386.tar.gz to your computer and extract the files

tar -zxvf ventrilo_srv*

The extracted files will now be in the directory "ventsrv". Move this folder to the location you want to run Ventrilo from. (I used /programs/ventsrv) Test that you can launch Ventrilo

./ventrilo_srv

You should see confirmation that the server has launched. Type "quit" to stop the server

Change server config

The free edition is very limited in what you can change, but you will want to customize the server name and set your admin password.

vim ventrilo_srv.ini


[Server]

Name=<set your server name here>
Phonetic=
Auth=0
Duplicates=1
AdminPassword=<place your admin password here>
Password=
SendBuffer=0
RecvBuffer=0
Diag=0
LogonTimeout=5
CloseStd=1
TimeStamp=0
PingRate=10
ExtraBuffer=0
ChanWidth=0
ChanDepth=0
ChanClients=0
DisableQuit=0
VoiceCodec=0
VoiceFormat=1
SilentLobby=0
AutoKick=0 

Save the file

Creating the Ventrilo service

You do not want to run Ventrilo as root. Make sure you have another user with sudo rights.

To create the Ventrilo service. Copy the contents of this box below and place them into a file named "ventrilo" in /etc/init.d/. Make sure you replace the require fields in the file with your data.

vim /etc/init.d/ventrilo
#!/bin/bash
#
# vent This shell script takes care of starting and stopping
# the Ventrilo subsystem (vent).
#
# chkconfig: - 64 36
# description: Ventrilo Chat Interface.
# processname: ventd
# config: /do_not_remove/ventrilo_srv.ini
# pidfile: /do_not_remove/ventrilo_srv.pid
# Source function library.
. /etc/rc.d/init.d/functions

# CONFIG
prog="Vent"
vent_path=<path_to_ventrilo>/ventsrv      # <----  Replace with the path to your /ventsrv directory
vent_user=<your user with sudo rights>    # <----  Replace with sudo user
vent_bin=$vent_path/
vent_server=ventrilo_srv
vent_log=$vent_path/ventrilo_srv.log
vent_pid=$vent_path/ventrilo_srv.pid
# Startup ventrilo servers.
start(){
chmod 0775 $vent_path
chmod 0775 $vent_log

su $vent_user -c "$vent_path/$vent_server -f$vent_path/$vent_server -d"
ret=0
if [ $ret -eq 0 ]; then
STARTTIMEOUT=30
while [ $STARTTIMEOUT -gt 0 ]; do
RESPONSE=`ls -al ventrilo_srv.pid 2>&1` && break
echo "$RESPONSE" | grep -q "root" && break
break
sleep 1
let STARTTIMEOUT=${STARTTIMEOUT}-1
done
if [ $STARTTIMEOUT -eq 0 ]; then
echo "Timeout error occurred trying to start $prog Daemon."
action $"Starting $prog: " /bin/false
else
action $"Starting $prog: " /bin/true
fi
else
action $"Starting $prog: " /bin/false
fi

return $ret
}
stop(){
VENTPID=`cat "$vent_pid" 2>/dev/null `
if [ -n "$VENTPID" ]; then
/bin/kill "$VENTPID" >/dev/null 2>&1
ret=$?
if [ $ret -eq 0 ]; then
STOPTIMEOUT=60
while [ $STOPTIMEOUT -gt 0 ]; do
/bin/kill -0 "$VENTPID" >/dev/null 2>&1 || break
sleep 1
let STOPTIMEOUT=${STOPTIMEOUT}-1
done
if [ $STOPTIMEOUT -eq 0 ]; then
echo "Timeout error occurred trying to stop $prog Daemon."
ret=1
action $"Stopping $prog: " /bin/false
else
action $"Stopping $prog: " /bin/true
fi
else
action $"Stopping $prog: " /bin/false
fi
else
ret=1
action $"Stopping $prog: " /bin/false
fi
return $ret
}
restart(){
stop
start
}
  
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status vent
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit $?

Now that the file exists in /etc/init.d/ let's make sure it's working. First thing to do is set the permissions up to allow the service to run.

chmod 755 ventrilo

Next let's test start & stop the service

service ventrilo start

Provide the sudo users password and you should see confirmation that the service is running

service ventrilo stop

You should see confirmation that the service has stopped. Lastly, lets set the service to start automatically.

chkconfig ventrilo --add
chkconfig ventrilo --level 5 on

Ventrilo will now start when your server is at run level 5. If your server is running at a different run leve, replace 5 with that number.

Firewall Rules

You will need to open your iptables file for editing

vim /etc/sysconfig/iptables

Add these lines your iptables file before the deny all rule at the bottom. It's usually safe to add them in the middle of the list.

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3784 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 3784 -j ACCEPT

Notes

  • If you can setup port forwarding on your home router or firewall, you should be able to have your friends jump on your ventrilo server based on your public IP address
  • With Dynamic DNS you can have them join via a DNS name to your server. This option is great as it will remain accurate even if your IP changes.