-Prerequisites // Before we get started
Code: Select all
yum -y install bzip2 wget
- First, we'll start off by creating a new user for the TS3 server to run on (for security purposes, it's not advised to run TS3 as root) however, during this particular tutorial, we'll be using the username teamspeak, with a password of teamspeak.
Once we have our teamspeak user created, we want to go ahead and switch to the home directory (as root) and grab the latest TS3 server files available here; http://dl.4players.de/ts/releases/ (remember that you're looking for 3.0.12.X or greater, just append the version number to file name as shown below).Code: Select all
useradd teamspeak passwd teamspeak
At this point, we must extract the file contents and remember to set the correct permissions.Code: Select all
cd /home/teamspeak/ wget http://dl.4players.de/ts/releases/3.0.12.4/teamspeak3-server_linux_amd64-3.0.12.4.tar.bz2
Now that the server files are prepared, we will be switching to our teamspeak user, going into the servers directory, and starting up TS3 for the first time.Code: Select all
tar -jxvf teamspeak3-server_linux_amd64-3.0.12.4.tar.bz2 chmod 0755 -R teamspeak3-server_linux_amd64
*please note that this step is extremely crucial, as we must obtain the server query admin account information used for administrating & modifying the server.
Usage, remember to always use teamspeak user (start, stop, restart & status).Code: Select all
su teamspeak cd /home/teamspeak/teamspeak3-server_linux_amd64/ ./ts3server_startscript.sh start
Code: Select all
su teamspeak cd /home/teamspeak/teamspeak3-server_linux_amd64/ ./ts3server_startscript.sh start ./ts3server_startscript.sh stop ./ts3server_startscript.sh restart ./ts3server_startscript.sh status
Code: Select all
firewall-cmd --permanent --zone=public --add-forward-port=port=9987:proto=udp:toport=9987 firewall-cmd --permanent --zone=public --add-forward-port=port=10011:proto=tcp:toport=10011 firewall-cmd --permanent --zone=public --add-forward-port=port=30033:proto=tcp:toport=30033 firewall-cmd --reload
- Using your favorite text editor (vi in this case) we will be creating a file named teamspeak under ini.d.
Paste in the content below along with commands :wq or shortcut shift+zz to save.Code: Select all
vi /etc/rc.d/init.d/teamspeak
More permissions!Code: Select all
#!/bin/sh # chkconfig: 2345 99 10 USER="teamspeak" TS3='/home/teamspeak/teamspeak3-server_linux-amd64' STARTSCRIPT="$TS3/ts3server_startscript.sh" cd $TS3 case "$1" in 'start') su $USER -c "$STARTSCRIPT start" ;; 'stop') su $USER -c "$STARTSCRIPT stop" ;; 'restart') su $USER -c "$STARTSCRIPT restart" ;; 'status') su $USER -c "$STARTSCRIPT status" ;; *) echo "Usage $0 start|stop|restart|status" esac
Adding teamspeak to chkconfig with levels 2,3,4 & 5Code: Select all
chmod 0755 /etc/rc.d/init.d/teamspeak
Test start, stop & restart our newly created teamspeak service (you may also use status to see if the server is running)Code: Select all
chkconfig --add teamspeak chkconfig --level 2345 teamspeak on
Code: Select all
service teamspeak start service teamspeak stop service teamspeak restart service teamspeak status