本机环境
- 系统:CentOS 6.7 64 位
- MySQL 5.6
- JDK 1.8
- Tomcat 8
- Redis 3.0.7
- Rap 0.14.1
Rap 说明
- 官网:https://github.com/thx/RAP
- 在线版:http://rap.taobao.org/
- 官网 Wiki:https://github.com/thx/RAP/wiki/home_cn
- 官网部署手册:https://github.com/thx/RAP/wiki/deploy_manual_cn
- 用户手册:https://github.com/thx/RAP/wiki/user_manual_cn
下载
- 官网下载:https://github.com/thx/RAP/releases
- 当前最新版本:0.14.1
- 下载 war 部署包:https://github.com/thx/RAP/releases
安装 MySQL、JDK、Tomcat、Redis
安装 Rap
RAP的war包下载:https://github.com/thx/RAP/releases
创建数据库,并创建权限用户:
mysql> create database rap_db character set utf8;
Query OK, 1 row affected (0.06 sec)
mysql> grant all privileges on rap_db.* to 'rap'@'%' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
把 RAP-0.14.1-SNAPSHOT.war 移动到 tomcat 的 webapp 目录下,删除其他多余的文件夹 解压:unzip -x RAP-0.14.1-SNAPSHOT.war -d ROOT 初始化数据库:mysql -u rap -p rap_db < /usr/program/tomcat8/webapps/ROOT/WEB-INF/classes/database/initialize.sql
➜ database pwd /app/servers/tomcat7/webapps/ROOT/WEB-INF/classes/database ➜ database mysql -urap -p rap_db < initialize.sql mysql> select user,host,password from user; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | | | root | ok | | | root | 127.0.0.1 | | | root | ::1 | | | | localhost | | | | ok | | | rap | % | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | | rap | localhost | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 | +------+-----------+-------------------------------------------+
修改连接数据库的配置信息:
➜ database cat /app/servers/tomcat7/webapps/ROOT/WEB-INF/classes/config.properties jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.url=jdbc\:mysql\://localhost\:3306/rap_db?useUnicode\=true&characterEncoding\=utf8&zeroDateTimeBehavior\=convertToNull&noAccessToProcedureBodies\=true jdbc.username=rap jdbc.password=123456 redis.host=localhost redis.port=6379
http://192.168.1.10:8081/org/index.do
成功了!!!!
参照文章:https://github.com/judasn/Linux-Tutorial/blob/master/Rap-Install-And-Settings.md
注意注册账户的时候,账户必是数字字母下划线组成(并不是密码,这一点要注意)
注意记住把端口开放,由于是实验,直接把iptables关掉:/etc/init.d/iptables stop