战姬物语部署

目录

一.准备环境 

二.上传源码到根目录执行下述命令

三.部署nginx 

四.部署mysql

五.配置java

六.安装php5.6

七.替换配置文件IP

八.启动游戏


一.准备环境 

#关闭seliunx和防火墙
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
#配置源,并安装常用工
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
yum install -y ntpdate vim lrzsz net-tools wget tree psmisc bash-completion unzip epel-release

#配置文件修改下述数字,将IP网关修改为自己的
vim /etc/sysconfig/network-scripts/ifcfg-ens33

二.上传源码到根目录执行下述命令

源码包链接:https://pan.baidu.com/s/1JR6LRKWaAIhE7BtQVF-9fQ?pwd=276l 
提取码:276l

[root@localhost ~]# cd / && tar xvzf zjwy.tar.gz -C /

三.部署nginx 

#安装nginx
[root@localhost /]# yum install -y nginx
[root@localhost /]# rm -rf /usr/share/nginx/html/*
[root@localhost /]# cp -r /www/wwwroot/yixiaw/* /usr/share/nginx/html
[root@localhost /]# systemctl start nginx

四.部署mysql

[root@localhost /]# yum install -y https://dev.mysql.com/get/mysql80-community-release-el7-11.noarch.rpm
[root@localhost /]# yum install -y yum-utils
[root@localhost /]# yum-config-manager  --disable  mysql80-community
[root@localhost /]# yum-config-manager  --enable  mysql57-community
[root@localhost /]# yum install -y mysql-server mysql-client --nogpgcheck
[root@localhost /]# systemctl start mysqld
# 获取数据库初始化密码,并修改
[root@localhost /]# mysqladmin -p"`awk '/temporary password/{p=$NF}END{print p}' /var/log/mysqld.log`" password 'TianPFh@123'
[root@localhost /]# echo "validate-password=off" >> /etc/my.cnf
[root@localhost /]# systemctl restart mysqld
[root@localhost /]# mysqladmin -p'TianPFh@123' password 'jgirlstest'
[root@localhost /]# mysql -p'jgirlstest' -e "create database jgirls_test"
#关联到数据库
[root@localhost /]# mysql -p'jgirlstest' jgirls_test < /jgirls_test.sql

五.配置java

[root@localhost /]# vim /etc/profile.d/java.sh
#复制粘贴下述内容
JAVA_HOME=/usr/java/jdk1.8.0_121     
JRE_HOME=/usr/java/jdk1.8.0_121/jre     
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH

[root@localhost /]# source /etc/profile  #使配置生效

六.安装php5.6

[root@localhost /]# rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
[root@localhost /]# yum -y install yum-utils
[root@localhost /]# yum-config-manager --enable remi-php56
[root@localhost /]# yum -y install php php-opcache
[root@localhost /]# yum -y install php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel

七.替换配置文件IP

[root@localhost /]# vim /opt/server/100001/Application.properties
43.226.156.92改成自己的

[root@localhost /]# vim /usr/share/nginx/html/index.html
218.93.207.238改成自己的


#进入数据库里执行的命令 先把这组语句里面的两个IP改成自己的
UPDATE `jgirls_test`.`system` SET `id`='1', `data`='{\"version\":\"1.0.0.0\",\"resVersion\":\"1.0.0.0.0.0.0.0\",\"areas\":[{\"id\":100001,\"name\":\"云计算1\",\"host\":\"10.36.178.74\",\"port\":10090,\"status\":2},{\"id\":100002,\"name\":\"www.QFetu.com\",\"host\":\"10.36.178.74\",\"port\":10100,\"status\":1}],\"globalStatus\":1,\"versionStr\":\"\",\"whiteListWhenMaintenance\":\",\",\"declaration\":[{\"declarationTitle\":\"云计算\",\"declarationCotent\":\"www.QF.com\"},{\"declarationTitle\":\"公告标题2\",\"declarationCotent\":\"公告内容2\"},{\"declarationTitle\":\"公告标题3\",\"declarationCotent\":\"公告内容3\"}]}' WHERE (`id`='1');

八.启动游戏

cd /opt/server/mongodb-linux-x86_64-rhel70-3.2.9 && ./start.sh
cd /opt/server/apache-tomcat-8080/bin &&  ./startup.sh
cd /opt/server/chatserver && ./start.sh
cd /opt/server/AdminNew && ./restart.sh  
cd /opt/server/100001 && ./start.sh restart  

管理后台访问地址http://192.168.226.100:8002      账号密码都是admin 

游戏页面直接访问IP,当然这里的IP在部署的时候需要修改成你的IP

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ZZDICT

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值