目录
部署java环境
1.上传jdk压缩包
2.解压缩
[root@xa22 ~]#tar -xf jdk-8u211-linux-x64.tar.gz
[root@xa22 ~]#mv jdk1.8.0211/ /usr/local/jdk1.8
3.配置环境变量
[root@xa22 ~]#vim /etc/profile.d/Java.sh
export JAVA_HOME=/usr/local/jdk1.8
export PATH=$JAVA_HOME/bin:$PATH
[root@xa22 ~]#source /etc/profile.d/java.sh
[root@xa22 ~]#java_version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
发布项目
准备数据库
1.修改数据库密码强度设置
[root@xa22 ~]#vim /etc/my.cnf
validate-password=OFF
2.重启数据库
[root@xa22 ~]#systemctl restart mysqld
3.修改密码
[root@xa22 ~]#mysqladimn -p123zj456@ password jgirlstest
4.登录建库
[root@xa22 ~]# mysql -pjgirlstest
mysql>create database jgirls_test default charset 'utf8';
//图片中我已经创建好数据库了,所以我进行了查看
5.导入sql语句 //rz下载 sql语句放在家目录下
mysql>use jgirls_test;
mysql>source /root/jgirls_test.sql;
6.执行sql语句
mysql>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\":\"192.168.199.136\",\"port\":10090,\"status\":2},{\"id\":100002,\"name\":\"www.QFetu.com\",\"host\":\"192.168.199.136\",\"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');
//将里面的IP地址换成自己的ip
mysql>\q //退出数据库,也可以用exit
补充点数据库命令:
查看数据库 :
show databases;
删除数据库:
drop database 数据库名称;
显示数据库中的表:`show tables;`
显示表中记录:`SELECT * FROM 表名`
建库:`create database 库名;`
建表:`create table 表名 (字段设定列表);`
发布前后端项目
1.上传项目代码 项目压缩包
rz
2.解压缩
[root@xa22 ~]#tar -xf zjwy.tar.gz -C /
修改后端项目配置
[root@xa22 ~]#vim /opt/server/100001/APPlication.propertises
managerWhiteList=127.0.0.1,192.168.199.136
[root@xa22 ~]#vim /opt/server/apache-tomcat-8080/conf/context.xml
<Resource name="jdbc/mysql" auth="Container" type="javax.sql.DataSource"
maxActive="500" maxIdle="30" maxWaitMillis="10000"
username="root" password="jgirlstest" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/jgirls_test?characterEncoding=utf-8&useSSL=false"
factory = "org.apache.tomcat.jdbc.pool.DataSourceFactory"
removeAbandonedOnBorrow="true"
removeAbandonedOnMaintenance="true"
logAbandoned="true"
testOnBorrow="true"
/>
部署前端项目
1.前端项目部署
[root@xa22 ~]#rm -rf /usr/share/nginx/html/*
[root@xa22 ~]#mv /www/wwwroot/yixiaw/* /usr/share/nginx/html/
2.修改配置
[root@xa22 ~]#vim /usr/share/nginx/html/index.html
:%s/218.93.207.238/192.168.100.132/g
启动后端项目
cd /opt/server/mongodb-linux-x86_64-rhel70-3.2.9/ && ./start.sh
cd /opt/server/AdminNew/ && ./restart.sh
cd /opt/server/apache-tomcat-8080/bin/ && ./startup.sh
cd /opt/server/chatserver/ && ./start.sh
cd /opt/server/100001/ && ./start.sh start
访问项目
http://192.168.199.136
http://192.168.199.136:8002
//游戏界面![](https://i-blog.csdnimg.cn/direct/2fc9d1847390438e827d8823d007da1e.png)
http://192.168.199.136:8002 //管理员登录平台
压缩包文件分享
链接:https://pan.baidu.com/s/1P-dgiiokQaKjzM6FB81QlQ
提取码:2580