使用一键脚本之前一定要是用root用户登录的shh
- 如果非腾讯云服务器操作系统安装完后换apt源和pip源为腾讯源
- 服务器版本为ubuntu server 18.04
- 请百度使用成root用户来搭建
- 安装环境
- apt-get install expect subversion build-essential lib32stdc++6 gcc-multilib g++-multilib python-dev pypy-dev gdb python2.7-dbg libcurl4-openssl-dev graphviz openssl libssl-dev swig gawk iotop lsof iftop ifstat iptraf htop dstat iotop ltrace strace sysstat bmon nethogs silversearcher-ag libsasl2-2 sasl2-bin libsasl2-modules python-setuptools luajit curl wget unzip python-pip
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
- echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" | tee /etc/apt/sources.list.d/mongodb-org-3.6.list
- 安装宝塔:
- wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh
- 输入y回车确认安装
- 安装环境
- Nginx 1.18
- MySQL 5.6
- Php 7.1
- 关闭防火墙
- sudo ufw disable
- 上传服务端hhw.zip到服务器/home/ubuntu文件夹
- 解压
- cd /home/ubuntu
- unzip hhw.zip
- 安装芒果数据库
- sudo apt-get update
- mv /home/ubuntu/mongodb.tar.gz /
- cd /
- tar -zxvf mongodb.tar.gz
- apt-get install mongodb-org=3.6.12 mongodb-org-server=3.6.12 mongodb-org-shell=3.6.12 mongodb-org-mongos=3.6.12 mongodb-org-tools=3.6.12
- rm -rf /usr/lib/python2.7/dist-packages/OpenSSL
- rm -rf /usr/lib/python2.7/dist-packages/pyOpenSSL-0.15.1.egg-info
- pip install cython six lz4==0.8.2 numpy==1.16.0 xlrd xdot rpdb psutil fabric==1.7.3 pycurl pycrypto M2Crypto==0.36.0 objgraph msgpack-python backports.ssl-match-hostname Markdown toro pymongo pyrasite pyopenssl ThinkingDataSdk==1.4.0
- pip install tornado==4.4.2
- pip install Supervisor==3.3.0
- pip install cryptography==2.6
- sudo mv /home/ubuntu/default /etc/nginx/sites-available
- sudo mv /home/ubuntu/pokemon_server_test.zip /mnt
- sudo mv /home/ubuntu/game.zip /www
- cd /mnt
- unzip pokemon_server_test.zip
- cd /www
- unzip game.zip
- 重新加载nginx
- nginx -s reload
- 给予权限
- chmod 755 -R /mnt
- chmod 777 -R /www/wwwroot
- 修改服务端文件IP: 搜:193.112.101.67
- /www/wwwroot/game/pokemon/patch/1112/res/version.plist
- /mnt/pokemon/release/login/conf/dev/serv.json
- /mnt/pokemon/release/login/conf/serv.json
- /mnt/pokemon/release/login/defines.json
- /mnt/pokemon/release/game_defines.py
- /mnt/pokemon/release/payment_defines.py
- 查看md5和获取文件size
- md5sum /www/wwwroot/game/pokemon/patch/1112/res/version.plist # 复制输出的md5码
- ls -l /www/wwwroot/game/pokemon/patch/1112/res/version.plist # 获取文件size大小值
- 修改服务端文件
- /mnt/pokemon/release/login/patch/cn/1112.json # 将version.plist的md5码和size更新一下并保存退出
- 重启nginx
- 启动游戏
- cd /mnt/pokemon/deploy_dev
- rm supervisor.sock
- supervisord -c supervisord.conf
- supervisorctl start all
- supervisorctl status
- 关闭游戏:
- supervisorctl reload
- 客户端修改:
- 安卓
- /assets/res/version.plist
- 后台地址
- 管理后台:http://IP:39981/login
- 账号:admin
- 密码:qq123456..
- 邮件发送格式:{"指令":数量}
- 授权GM后台:
- http://IP:81/gm/gm.php
- GM码:t9gm.com
- 玩家后台:
- http://IP:81/gm/
- 游戏正常启动示列
- root@VM-20-11-ubuntu:/mnt/pokemon/deploy_dev# supervisorctl status
- account_db_server RUNNING pid 4048, uptime 0:00:20
- anti_cheat_server RUNNING pid 4153, uptime 0:00:19
- crash_platform_server RUNNING pid 4062, uptime 0:00:20
- disable_word_check_server RUNNING pid 4051, uptime 0:00:20
- game_mongodb RUNNING pid 4047, uptime 0:00:20
- game_server RUNNING pid 4055, uptime 0:00:20
- gm_server RUNNING pid 4063, uptime 0:00:20
- login_server RUNNING pid 4064, uptime 0:00:20
- nsqadmin RUNNING pid 4045, uptime 0:00:20
- nsqd RUNNING pid 4044, uptime 0:00:20
- nsqlookupd RUNNING pid 4046, uptime 0:00:20
- online_fight_forward_server RUNNING pid 4152, uptime 0:00:19
- payment_server RUNNING pid 4054, uptime 0:00:20
- pvp_server RUNNING pid 4052, uptime 0:00:20
- storage_server RUNNING pid 4049, uptime 0:00:20
- 所有RUNNING这样才算正常。。。。。
复制代码
|
大佬,别默默的看了,快登录帮我点评一下吧!:)
登录 立即注册