J2EE开发环境--RAP

J2EE开发环境--RAP

J2EE开发环境分四步:

1、JDK环境

2、tomcat

3、redis环境

4、mysql环境

5、RAP包

线上环境,推荐使用源码,自建应用用户,设置对应规则,禁止关闭selinux和iptables、firewalld。

一、JDK环境:

直接点:

yum -y install epel-release

yum -y install java

二、tomcat环境:

地址:https://tomcat.apache.org/download-70.cgi

请科学使用wget

tar   -xf   apache-tomcat-8.5.16.tar.gz

cd apache-tomcat-8.5.16/bin

./startup.sh

三、redis环境:

下载地址;https://redis.io/download

unzip redis-4.0.1.tar.gz

cd   redis-4.0.1

chmod -R 755 ../redis-4.0.1

nohup ./src/redis-server &            ---后台启动redis

四、mysql环境:

下载地址:http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

yum localinstall mysql57-community-release-el7-8.noarch.rpm

yum repolist enabled| grep "mysql.*-community.*"

yum install mysql-community-server

systemctl status mysqld          ---查看启动状态

数据库初始化结构请使用此脚本:https://github.com/thx/RAP/blob/release/src/main/resources/database/initialize.sql

更改mysql密码以下:

ALTER  USER'root'@'localhost'   IDENTIFIEDBY   'MyNewPass4!';

或者

set   password    for   'root'@'localhost'=password('MyNewPass4!')

授权用户连接;

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypwd' WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.102' IDENTIFIED BY 'mypwd' WITH GRANT OPTION;

flush privileges;

五、RAP包

下载地址:https://github.com/thx/RAP/releases

请注意:

Release页面中下载war包(建议用最新), 将war包修改为ROOT.war后放入tomcat webapps文件夹中。 startup.sh(.bat)启动tomcat,该war包自动部署到文件夹ROOT 停掉服务器,打开ROOT中得WEB-INF/classes/config.properties来修改数据库配置 启动tomcat,完成部署。

config.properties需要注意:

六、问题集锦:

1、Mysql默认安装版本为5.7.*,数据库推荐使用5.6.*版本,修改5.6.*版本方法如下:

可以修改vim /etc/yum.repos.d/mysql-community.repo源,改变默认安装的mysql版本。比如要安装5.6版本,将5.7源的enabled=1改成enabled=0。然后再将5.6源的enabled=0改成enabled=1即可。

grep'temporary password'/var/log/mysqld.log

---查看mysql日志中的密码

posted @ 2017-08-23 09:53  Alex_Footprint  阅读(229)  评论(0编辑  收藏  举报