安装宝塔直接运行命令即可。
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
搭建环境:
CENTOS 7以上系统
Nginx1.14
mysql5.6
php5.6
1、关闭防火墙、开放端口
centos6系统
chkconfig iptables off
service iptables stop
centos7系统
systemctl stop firewalld.service
systemctl disable firewalld.service
防火墙不关闭也行
宝塔放行端口:1:65535
为了安全考虑你也可以不关闭防火墙直接单独放行:
注:阿里云或腾讯云记得开放对应端口
宝塔-软件管理-数据库设置–配置修改第24行后加入
lower_case_table_names =1
保存–重启数据库
2、上传tsbf.zip到服务器根目录(根目录不是root目录!!!!
解压tsbf.zip
cd /
unzip tsbf.zip
给予tsbf 777权限
chmod 777 -R /tsbf
3.更新动态库 (先不用运行,库都整理在压缩包了,如果服务起不来报错少库文件在运行)
动态库
yum install gcc -y
yum install gcc-c++ -y
动态链接
ldconfig
4、设置数据库密码为:agmsy.com(在宝塔直接设置)
命令行输入
cd /tsbf
./sk
数据库创建结束。可以通过宝塔查看是否创建成功。(数据库 – 点击 从服务器获取 获取到5个就正确的)
6、搭建网站
新建一个网站-你的ip:端口 或域名:端口
有端口就添加端口这里的端口81
网站目录设置\www\wwwroot\game
设置网站伪静态
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
location / {
if (!-f $request_filename){
rewrite (.*)$ $1.php last;
break;
}
}
———————————————————————
7、服务端和网站修改 192.168.10.128 修改为你的IP
服务端修改
/tsbf/LS/bin/config.xml 一共2处
/tsbf/server/bin/config.xml 一共2处
/tsbf/server/bin/serverlist.xml 一共6处
/tsbf/server/bin/battleserverlist.xml 一共1处
网站修改:
安卓
/www/wwwroot/game/9999/configul 一共2处
/www/wwwroot/game/9999/Server/info 一共2处
/www/wwwroot/game/9999/Server/list 一共1处 区名这里改
/www/wwwroot/game/9999/Server/selectzone 一共1处 区名这里改
苹果 下面一样自己改下
/www/wwwroot/game/ios1/configul
/www/wwwroot/game/ios1/Server/info
/www/wwwroot/game/ios1/Server/list
/www/wwwroot/game/ios1/Server/selectzone
到此算服务端就可以了,下面看看客户端
7、启动游戏服务
启动游戏
cd /tsbf/LS
./q
cd /tsbf/server
./q
退出游戏
cd /tsbf/LS
./t
cd /tsbf/server
./t
启动后可以通过
端口查看命令 netstat -lntp
隐藏内容需要付费才可以看见