Koozali.org: home of the SME Server

TeamSpeak server on SME (moved)

Offline cool34000

  • *
  • 339
  • +0/-0
TeamSpeak server on SME (moved)
« on: August 26, 2006, 11:16:31 PM »
I searched a howto for TeamSpeak with SME server and didn't find a complete howto...
So, i'm just putting together a lot of stuff founded in several posts
Here's one who worked for me...
I've tested it on a SME 6.0.1-01 and on a SME 7.0 final install and it works very well... As i'm quite new and noob with SME, i didn't tested it on other  versions...

First of all, download ts2_server_rc2_20201.tar.bz2 (latest stable)here

then, make a file called teamspeak with that : (cut+paste)
Code: [Select]
#! /bin/bash
# Copyright (c) 2004 TeamSpeak team   All rights reserved.
#
# Author: pwk.linuxfan 2004
# Modified by Derek "Cybernaut" Jackson - www.DigitalNines.com
#
# chkconfig: 345 85 15
# description: Runs and kills TeamSpeak Voice server at boot time and shutdown.
# Source function library.
#. /etc/rc.d/init.d/functions

# START OF CONFIG SECTION
# WARNING ! For security reasons we advise: DO NOT RUN THE SERVER AS ROOT
USER=teamspeak
DIR=/home/teamspeak/tss2_rc2
# END OF CONFIG SECTION

# See how we were called.
case "$1" in
        start)
                if [ -e $DIR/tsserver2.pid ]; then
                        echo "tsserver2.pid already exists...server already started ?";
                        echo "If you are sure the server is not running, delete tsserver2.pid"
                        exit 1
                else
                        if [ "$UID" = "0" ]; then
                                for c in $(seq 1 10); do
                                        echo -n "!"
                                        sleep 1
                                done
                                echo !
                        fi
                        echo "Starting the TeamSpeak Voice server..."
                        if [ -e $DIR/server_linux ]; then
                                if [ ! -x $DIR/server_linux ]; then
                                        echo "server_linux is not executable; trying to set it."
                                        chmod u+x $DIR/server_linux
                                fi
                                if [ -x $DIR/server_linux ]; then
                                        WD=pwd
                                        cd $DIR
                                        su $USER -c "$DIR/server_linux -PID=tsserver2.pid" &
                                        cd $WD
                                else
                                        echo "server_linux is not executable; fix this."
                                        exit 4
                                fi
                        else
                                echo "Couldnt find server_linux."
                                exit 5
                        fi
                fi
        ;;
    stop)
                if [ -e $DIR/tsserver2.pid ]; then
                        echo -n "Stopping the TeamSpeak Voice server..."
                        if ( kill -TERM cat $DIR/tsserver2.pid ); then
                                for c in $(seq 1 300); do
                                        if [ -e $DIR/tsserver2.pid ]; then
                                                echo -n "."
                                                sleep 1
                                        fi
                                done
                        fi
                        if [ -e $DIR/tsserver2.pid ]; then
                                echo "server does not shutdown cleanly - killing"
                                kill -KILL cat $DIR/tsserver2.pid
                                rm $DIR/tsserver2.pid
                                sleep 5
                        else
                                echo "done"
                        fi
                else
                        echo "tsserver2.pid is missing; is the server stopped already?"
                        #exit 7 - Should not be here as doesn't allow restart if server is already stopped.
                fi
        ;;
        restart)
                $0 stop && $0 start || exit 1
        ;;
        status)
                if [ -e $DIR/tsserver2.pid ]; then
                        echo "The TeamSpeak Voice server is running."
                        exit 0
                else
                        echo "The TeamSpeak Voice server is stopped."
                        exit 3
                fi
        ;;
        passwords)
                if [ -e $DIR/server.log ]; then
                        date=$(cat $DIR/server.log | grep "admin account info: username: admin" | tail -n 1 | sed "s/^\([0-9]\+-[0-9]\+-[0-9]\+ [0-9]\+:[0-9]\+:[0-9]\+\).*$/\1/")
                        spass=$(cat $DIR/server.log | grep "superadmin account info: username: superadmin" | tail -n 1 | sed"s/^.*username: superadmin password: \([a-z0-9]\+\).*$/\1/")
                        pass=$(cat $DIR/server.log | grep "admin account info: username: admin" | tail -n 1 | sed "s/^.*username: admin password: \([a-z0-9]\+\).*$/\1/")
                        echo "Following passwords were generated on $date"
                        echo "superadmin = \"$spass\""
                        echo "admin      = \"$pass\""
                else
                        echo "server.log not found; maybe the server has not been started yet?"
                        exit 1
                fi
        ;;
        *)
                echo "Usage: $0 {start|stop|restart|status|passwords}"
                exit 2
esac
exit 0

Don't modify this file untill you know what you're doing... That's how TS starts and stop !!!

I saved all the files (this one + the downloaded package)  in /root/addons/tss2 so you have to modify the following to feet your needs !
Code: [Select]
echo "Installation de TeamSpeak Server 2 RC2"
useradd -d /home/teamspeak teamspeak -p your_teamspeak_password_here
cp /root/addons/tss2/ts2_server_rc2_20201.tar.bz2 /home/teamspeak/ts2_server_rc2_20201.tar.bz2
cd /home/teamspeak
tar -xjf ts2_server_rc2_20201.tar.bz2
rm ts2_server_rc2_20201.tar.bz2
cp /root/addons/tss2/teamspeak /etc/init.d/teamspeak
chmod 755 /etc/init.d/teamspeak
ln -s /etc/rc.d/init.d/teamspeak /etc/rc.d/rc7.d/S98teamspeak
ln -s /etc/rc.d/init.d/teamspeak /etc/rc.d/rc6.d/K03teamspeak
cd /home/teamspeak/tss2_rc2
./teamspeak2-server_startscript start
sleep 2
./teamspeak2-server_startscript stop
cd /home/teamspeak
chown teamspeak:teamspeak * -R
service teamspeak start
# echo "/sbin/iptables --append INPUT -p udp --dport 8767 -i \$OUTERIF -j ACCEPT" > /etc/e-smith/templates/etc/rc.d/init.d/masq/42AllowTS
# /sbin/e-smith/expand-template /etc/rc.d/init.d/masq

A user called teamspeak is created (change his password in the script !)
Don't mind of the root warning during installation, it's a way to fix a problem during installation, the start script is first started with root rights, then it shutdowns, change owner and then start the service with the good user !
If you server is in gateway+server mode, then you have to uncomment the last 2 lines (not tested on both versions of SME, but seen on another forum) to open open port 8767UDP... If as me you're in server-only mode, just redirect port 8767UDP from the firewall/nat to your server's IP

After installation, just open /home/teamspeak/tss2_rc2/server.log with your favorite text editor and grab the admin and superadmin passwords (radomly generated at the install stage)
Then, go to http://yourserver:14534 to configure the few settings in the web interface... And connect to it with the client, all should be working !
TeamSpeak client is available for all platforms...

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Re: TeamSpeak server on SME (moved)
« Reply #1 on: August 31, 2006, 12:19:59 PM »
Quote from: "cool34000"

After installation, just open /home/teamspeak/tss2_rc2/server.log with your favorite text editor and grab the admin and superadmin passwords (radomly generated at the install stage)


You could probably do the following to get the passwords...

Code: [Select]
cd /home/teamspeak/tss2_rc2
./teamspeak2-server_startscript passwords
Regards,
William

IF I give advise.. It's only if it was me....

Offline cool34000

  • *
  • 339
  • +0/-0
TeamSpeak server on SME (moved)
« Reply #2 on: August 31, 2006, 10:32:07 PM »
Thanks for the tip !

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
TeamSpeak server on SME (moved)
« Reply #3 on: September 01, 2006, 05:36:34 PM »
Quote from: "cool34000"
Thanks for the tip !


I've had an attempt at creating a How-To which is more within the SMEServer guidelines.

http://no.longer.valid/phpwiki/index.php/How-To%20install%20TeamSpeak%20on%20SME%207.0%20%28and%20start%20it%20on%20boot%20up%29
Regards,
William

IF I give advise.. It's only if it was me....

Offline cool34000

  • *
  • 339
  • +0/-0
TeamSpeak server on SME (moved)
« Reply #4 on: September 02, 2006, 06:09:41 PM »
Thanks for making a more 'sme-like' howto.

I've tested it, and it's working fine !!!


Has someone tested it in server-gateway mode ?

Offline cool34000

  • *
  • 339
  • +0/-0
TeamSpeak server on SME (moved)
« Reply #5 on: September 05, 2006, 08:23:42 PM »
I've tested on a server-gateway and it works fine too.

Offline cool34000

  • *
  • 339
  • +0/-0
TeamSpeak server on SME (moved)
« Reply #6 on: September 10, 2006, 10:28:57 PM »
You will also need to open the port in server-only mode to accept external connexions to TS Server.

Just follow willam_syd's howto and type those more lines :
Code: [Select]
echo "/sbin/iptables --append INPUT -p udp --dport 8767 -i \$INTERNALIF -j ACCEPT" > /etc/e-smith/templates/etc/rc.d/init.d/masq/42AllowTS
Code: [Select]
expand-template /etc/rc.d/init.d/masq

This should open the TS server to Internet :-D
I got that after doing iptables -L :
Quote
ACCEPT     udp  --  anywhere             anywhere            udp dpt:8767

Offline cool34000

  • *
  • 339
  • +0/-0
TeamSpeak server on SME (moved)
« Reply #7 on: September 11, 2006, 12:09:54 AM »
OK, I've managed to create a better template witch should open port 8767 in iptables according to the server mode (serveronly or server+gateway)

So now, 42AllowTS should look like this :
Code: [Select]
   if [ -n "$OUTERIF" ]; then
        /sbin/iptables --append INPUT -p udp --dport 8767 -i $OUTERIF -j ACCEPT
    else
        /sbin/iptables --append INPUT -p udp --dport 8767 -i $INTERNALIF -j ACCEPT
    fi


Don't forget to expand template :
Code: [Select]
expand-template /etc/rc.d/init.d/masqand to restart masq :
Code: [Select]
service masq restart


I think the howto should be updated william_syd.

Thanks

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
TeamSpeak server on SME (moved)
« Reply #8 on: September 11, 2006, 09:05:41 AM »
Quote from: "cool34000"



I think the howto should be updated william_syd.

Thanks


I agree. Just select 'Edit' at the bottom of the how-to page. :-D

Here is a link to 42AllowTS.
Regards,
William

IF I give advise.. It's only if it was me....

Offline cool34000

  • *
  • 339
  • +0/-0
TeamSpeak server on SME (moved)
« Reply #9 on: September 11, 2006, 03:31:43 PM »
Done !
It's up to date now. Thanks for linking the file William...

Didn't know I could edit a howto... :-D How noob am I ??? :hammer:

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
TeamSpeak server on SME (moved)
« Reply #10 on: September 11, 2006, 03:42:38 PM »
You can edit most pages here that are part of the wiki. Some are locked and you need to be a "very very special person" to change them  :-)

Back when I was an ultra noob.. http://forums.contribs.org/index.php?topic=30320.msg127167#msg127167
Regards,
William

IF I give advise.. It's only if it was me....

Offline cool34000

  • *
  • 339
  • +0/-0
TeamSpeak server on SME (moved)
« Reply #11 on: September 11, 2006, 04:53:36 PM »
I guess this is what man call 'community'... This is really new for me since I am totally new to linux world.

But I gotta say I really love this way of working...

kaukomieli

TeamSpeak server on SME (moved)
« Reply #12 on: December 19, 2006, 08:10:55 PM »
edit: as soon as you ask for help - you find a solution ;)

Offline harshl

  • *
  • 32
  • +0/-0
TeamSpeak server on SME (moved)
« Reply #13 on: January 22, 2007, 12:55:51 AM »
This is fantastic thanks to those who put this together!
-Landon

boss_hog

TeamSpeak server on SME (moved)
« Reply #14 on: January 27, 2007, 05:18:26 PM »
Hi yall,
firstly, thanks for the efforts on the TS contrib.

Now for the layout. I have an SME7.1 >test box(TB)< hanging out
behind my SME7.1 >production machine(PM)< which is an
server-gateway/webserver/mail etc..
I have followed the How-To above to install TS on my test box(TB),
and then setup my SME7.1 (PM) to forward UDP-port 8767 to the
SME7.1 (TB). I have also install the 42AllowTS to the SME7 (TB).

Q1). can the above setup work?

Q2). any thoughts on why I can't get a TS connection from the WAN side?

My logs didn't show any obvious errors(to my eyes!). IOW, I didn't see
any connection fails etc..

This setup is not critical.. testbox! I am doing it to learn a little more and
try to have a little fun.
Any thoughts much appreciated
Joe