- 1、安装宝塔
- yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
- 输入y回车确认安装
- -----------------------------------------------------------------------------------------------------------------------------------
- 安装环境:
- Nginx 1.18
- mysql 5.7
- PHP 7.2
- mongo4.0 关闭安全验证
- redis5.0
- -----------------------------------------------------------------------------------------------------------------------------------
- 宝塔放行端口:1-65535 或单独放行 82,85,8889 自行抓包!
- 关闭防火墙:
- systemctl stop firewalld
- systemctl disable firewalld
- -----------------------------------------------------------------------------------------------------------------------------------
- 上传服务端压缩文件到home目录,解压
- cd /
- unzip 手工端home.zip
- -----------------------------------------------------------------------------------------------------------------------------------
- 安装openresty1.19.3.1
- cd /home/proj
- wget https://openresty.org/download/openresty-1.19.3.1.tar.gz
- tar -zxvf openresty-1.19.3.1.tar.gz
- mv openresty-1.19.3.1 openresty
- cd openresty
- sudo apt-get install libpcre3-dev \
- libssl-dev perl make build-essential curl unzip -y
- sudo yum install -y pcre-devel openssl-devel
- ./configure
- make
- make install
- echo "openresty环境变量"
- echo "PATH=/usr/local/openresty/bin:/usr/local/openresty/nginx/sbin:$PATH
- export LC_ALL=en_US.UTF-8
- export PATH" >> ~/.bash_profile
- source ~/.bash_profile
- -----------------------------------------------------------------------------------------------------------------------------------
- 设置数据库密码为:123456
- 导入数据库
- mysql -uroot -p123456
- create database sanguo DEFAULT CHARACTER SET utf8;
- flush privileges; #
- use sanguo
- source /home/sql/sanguo.sql
- exit;
- -----------------------------------------------------------------------------------------------------------------------------------
- 宝塔添加站点:
- IP:85端口
- 网站目录指向:/home/proj/goserver/admin/assets/web/dist
- 127.0.0.1:82端口
- 网站目录指向:/home/proj/web-mobile
- -----------------------------------------------------------------------------------------------------------------------------------
- 修改服务端IP:替换192.168.0.152为你自己的ip
- \home\proj\common\settings.lua (2 hits)
- \home\proj\goserver\admin\assets\web\.env.development (1 hit)
- \home\proj\goserver\admin\assets\web\dist\js\app.3d18e251.js (2 hits)
- \home\proj\goserver\admin\assets\web\dist\js\highlight.js.0adc4c0f.js (1 hit)
- \home\proj\goserver\agent_admin\agent_assets\web\.env.development (1 hit)
- \home\proj\goserver\agent_admin\agent_assets\web\dist\js\app.bfd4e5a3.js (2 hits)
- \home\proj\goserver\agent_admin\agent_assets\web\dist\js\highlight.js.0adc4c0f.js (1 hit)
- \home\proj\pyapi\wxpay\app.py (1 hit)
- \home\proj\web-mobile\assets\main\index.bcc80.js (3 hits)
- \home\proj\web-mobile\assets\resources\import\24\241bc4ec-587f-41fa-a24d-e904c5f906c6.9f804.json (1 hit)
- find /home/proj/ -type f -name '*.*' | xargs sed -i 's/192.168.0.152/你的IP/g'
- find /home/proj/ -type f -name '*.py' | xargs sed -i 's/192.168.0.152/你的IP/g'
- find /home/proj/ -type f -name '*.js' | xargs sed -i 's/192.168.0.152/你的IP/g'
- find /home/proj/ -type f -name '*.development' | xargs sed -i 's/192.168.0.152/你的IP/g'
- -----------------------------------------------------------------------------------------------------------------------------------
- chmod 777 -R /home/proj/
- 启动服务器
- 启动apiserver
- 启动
- cd /home/proj/apiserver
- nginx -p `pwd` -c conf/nginx.conf
- 重启
- nginx -p `pwd` -c conf/nginx.conf -s reload
- 停止
- nginx -p `pwd` -c conf/nginx.conf -s stop
- 启动gameserver
- cd /home/proj/skynet
- sh getkey.sh
- 生成key,后面的串码复制后黏贴到本目录下面的key.txt里面后保存
- ./skynet ../loginserver/prodconfig //启动登录服务器
- ./skynet ../gameserver/prodconfig //启动游戏服务器
- kill -9 `cat loginskynet.pid` //停止登录服务器
- kill -9 `cat gameskynet.pid` //停止游戏服务器
- 启动goserver
- cd /home/proj/goserver
- ./mygo //启动管理后台服务
- -----------------------------------------------------------------------------------------------------------------------------------
- 游戏地址
- http://IP:82/?id=646415
- 链接id后面的数字是账号随便填
- 后端地址:
- http://Ip:85/#/login?next=%2F
- 数据库sys_auth_user.password修改成VNgFfka8Or4=
- 账号:admin
- 密码:admin
- 登陆后到 游戏配置-区服配置 新增一个大区 再点开服,默认保存就行,开服活动自行研究
咸鱼之王 linux搭建教程
最新推荐文章于 2024-08-14 16:09:08 发布