
测试系统:CentOS 7.6
安装宝塔
yum install -y wget && wget -O install.sh https://download.bt.cn/install/install_6.0.sh && sh install.sh
输入y回车确认安装
安装环境
Nginx1.22
MySQL5.7
php7.4
宝塔开放端口:1:65535
关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
上传服务端rok.tar.gz到服务器根目录
解压
cd /
tar xvzf rok.tar.gz
给权限
chmod -R 777 /data
chmod -R 777 /www/wwwroot/game
安装docker
yum install docker
设置开机自启
systemctl start docker
systemctl enable docker
安装mongodb
docker run -it –name mongo -p 27017:27017 -d mongo:3.6 –auth
添加mongo用户
docker exec -it mongo mongo admin
db.createUser({user:’root’, pwd:’root’, roles:[{role:’userAdminAnyDatabase’, db:’admin’}, ‘readWriteAnyDatabase’]})
exit
设置数据库root密码为:10086abc
配置环境 命令运行
docker run -it –name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=10086abc -d mysql:5.7
导入数据库
cd /data
./sk
创建网站
端口为:IP:9988
网站目录为:/www/wwwroot/game
修改服务端文件IP: 替换:123.207.42.5
/data/work/etc/start_chat.sh
/data/work/etc/start_game.sh
/data/work/server/monitor_server/html/js/main.js
/www/wwwroot/game/api/lists.php
/www/wwwroot/game/api/pay.php
启动游戏
cd /data/work
./start -w
温馨提示启动很慢,等半小时左右 启动完成4G左右内存
查看端口:
netstat -lntp
关闭游戏
for i in `sudo netstat -lntp | grep “./co\|redis-server” | awk ‘{print $7}’ | awk -F ‘/’ ‘{print $1}’`; do sudo kill -9 $i; done && rm -rf /home/ys/workspace/ROK/work/logs/*
后台地址:
http://IP:58111/
服务器选择 game1
客户端修改:
安卓: 替换:123.207.42.5 注意对位
\assets\bin\Data\Managed\Metadata\global-metadata.dat
————————————————————————————
本期教程到此结束。















