更新系统

yum update -y

安装必要工具

yum install vim wget perl tar net-tools bzip2 -y

  1. 开始安装
    首先需要创建一个普通用户teamspeak,密码请按自己需求设置

useradd teamspeak
passwd teamspeak

切换至/home/teamspeak目录下

cd /home/teamspeak

官网下载最新服务端软件包(以最新版本为准)
解压到/home/teamspeak目录下并赋予权限
chmod +x *
chmod 777 *

  1. 配置与运行

同意TeamSpeak许可条款
touch .ts3server_license_accepted

启动TeamSpeak服务器
./ts3server_startscript.sh start
屏幕上会出现两条IMPORTANT的信息,请注意保管并记牢!其中Token是激活服务器管理员的重要凭证!

[teamspeak@vultr teamspeak3-server_linux_amd64]$ ./ts3server_startscript.sh start
Starting the TeamSpeak 3 server
TeamSpeak 3 server started, for details please view the log file

[teamspeak@vultr teamspeak3-server_linux_amd64]$

                     I M P O R T A N T                          

              Server Query Admin Account created                

        loginname= "serveradmin", password= "*"


                     I M P O R T A N T                          

     ServerAdmin privilege key created, please use it to gain
     serveradmin rights for your virtualserver. please
     also check the doc/privilegekey_guide.txt for details.

      token=

  1. 配置防火墙

firewall-cmd --get-default-zone
打开与TeamSpeak服务相关的端口

9987/udp+tcp for Voice.(必须)

30033/tcp for Filetransfer.

10011/tcp for ServerQuery.

41144/tcp for TSDNS (optional)

firewall-cmd --zone=public --permanent --add-port=9987/udp
firewall-cmd --zone=public --permanent --add-port=10011/tcp
firewall-cmd --zone=public --permanent --add-port=30033/tcp
firewall-cmd --zone=public --permanent --add-port=41144/tcp

firewall-cmd --reload

  1. 自启动配置
    以root身份创建并编辑文件

SU root
vim /lib/systemd/system/teamspeak.service


[Unit]
Description=Teamspeak, The most superior online voice communication solution.
After=network.target

[Service]
User=账户
Group=密码
WorkingDirectory=目录
ExecStart=目录/ts3server_startscript.sh start
ExecStop=目录/teamspeak3-server_linux_amd64/ts3server_startscript.sh stop
PIDFile=目录/teamspeak3-server_linux_amd64/ts3server.pid
Type=forking
RestartSec=15
Restart=always

[Install]

WantedBy=multi-user.target

systemd需要被重新加载以生效
systemctl daemon-reload
开启服务自启动
systemctl enable teamspeak.service
启动 TeamSpeak:
systemctl start teamspeak.service
停止 TeamSpeak:
systemctl stop teamspeak.service
重启 TeamSpeak:
systemctl restart teamspeak.service

Last modification:March 20th, 2021 at 08:15 pm
如果觉得我的文章对你有用,请随意赞赏