之前和别人玩游戏联麦的时候都是用的Discord,但是对我个人而言我不是很满意,毕竟这个软件过于臃肿,我不是很喜欢,看见有一个teamspeak的软件,看了一下很小巧,感觉很适合,所以决定自己搭建一个服务器试试,测试一下感觉还不错。写个教程,以免以后自己忘了。
系统老规矩使用的centos,我个人不太喜欢折腾,所以还是centos对我来说比较友好,我也是很喜欢
创建用户
我这里创建的用户是teamspeak
,因为官方推荐不要使用root
用户,不安全,所以建议还是使用非root
还是比较安心
useradd teamspeak
su teamspeak
我个人一般是不会给非root用户添加密码的,主要是防止忘记了,所以干脆就不设置密码了,如果要退出非ROOT用户我一般习惯直接exit
,也比较方便
安装Teamspeak
wget https://files.teamspeak-services.com/releases/server/3.13.7/teamspeak3-server_linux_amd64-3.13.7.tar.bz2
解压teamspeak并将文件移动至teamspeak用户根目录
tar -xvf teamspeak3-server_linux_amd64-3.13.7.tar.bz2
mv * ../
接受teamspeak条款
touch .ts3server_license_accepted
测试运行一下teamspeak
./ts3server
然后记录下一下必要信息
------------------------------------------------------------------
I M P O R T A N T
------------------------------------------------------------------
Server Query Admin Account created
loginname= "XXXXXXX", password= "XXXXXXX"
apikey= "BADY75hniE_Dwrdi-T8C-009-fFP_JuXVGBiLqk"
------------------------------------------------------------------
------------------------------------------------------------------
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=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
------------------------------------------------------------------
按住CTRL+c,退出运行
创建系统服务文件,将teamspeak交给systemctl管理
vim /etc/systemd/system/teamspeak.service
内容如下
[Unit]
Description=teamspeak
After=network.target
[Service]
User=teamspeak
Group=teamspeak
Type=forking
WorkingDirectory=/home/teamspeak/
PIDFile=/home/teamspeak/ts3server.pid
ExecStart=/home/teamspeak/ts3server_startscript.sh start
ExecStop=/home/teamspeak/ts3server_startscript.sh stop
RestartSec=15
Restart=always
[Install]
WantedBy=multi-user.target
将teamspeak交给systemctl管理
systemctl enable teamspeak
systemctl start teamspeak
systemctl status teamspeak
systemctl stop teamspeak