























服务器系统:centos7.6
安装宝塔直接运行命令即可。
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
搭建环境:
Nginx1.18
mysql5.6
php5.6
1、关闭防火墙、开放端口
宝塔放行端口:1:65535
关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
PS:如果使用腾讯云或阿里云记得把控制台的端口也打开
2、上传xy.tar.gz到服务器根目录(根目录不是root目录!!使用WinSCP或其他工具上传数据,也可以直接宝塔传!!)
解压xy.tar.gz
cd /
tar zxvf xy.tar.gz
3、给予 777权限
chmod -R 777 /xyserver
chmod -R 777 /www/wwwroot/game
4、设置数据库密码为:syymw.com(在宝塔直接设置)
输入命令导入数据库
cd /xyserver
./sk
数据库创建结束。可以通过宝塔查看是否创建成功。(数据库 – 点击 从服务器获取 获取到1个就正确的)
运行后为了安全可以把 sk 文件删除
6、搭建网站
新建一个网站-你的ip:端口 或域名:端口
有端口就添加端口这里的端口81
网站目录设置\www\wwwroot\game
———————————————————————
7、服务端和网站修改 192.168.200.129 修改为你的IP
网站修改:
/www/wwwroot/game/index1.php
/www/wwwroot/game/pay/config.php
到此算服务端就可以了
7、启动游戏服务
启动
cd /xyserver/server/sh1
./gamectl.sh startall
关闭
cd /xyserver/server/sh1
./gamectl.sh stopall
启动后可以通过
端口查看命令 netstat -lntp
浏览器输入
http://ip:81
可以正常登陆。
好了。本期教程到此结束。
祝君好运。。。。
其他自行研究吧。。。
PS:
简单介绍下GM后台使用
直接输入
http://ip:81/gm
账号:admin
密码:syymw.com
友情提示:如果是阿里云或者腾讯云架设 请注意端口是否开放。