windows下 WSO2 Application Server配置 及 MySQL数据服务部署

【来,chi个痛快】

1. 下载WSO2 Application Server

http://wso2.org/downloads/appserver/, 下载Binary. 建议将Documentation也一块搞下来, 对以后的部署有帮助.

2. 配置JAVA_HOME

Jdk的版本最好是1.6, 有个彩笔说他的jdk是1.7, 配出来有问题, 所以才跑到Ubuntu下的…瞎了.

另外, 据su神等人经验, JAVA_HOME 要设到系统变量里面, 不要设到用户变量,不然service访问不了, 无法启动

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

3. 解压 wso2as-4.1.2.zip 到某目录下

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

4. 运行bin目录下的 install.bat , 安装

注意:

1. Win7下请使用管理员权限运行

2. 有群众反映安装时界面一闪而过. 可以在cmd(管理员权限)中运行install.bat,看看安装结果.安装成功应该出现如下界面.(恐怖的run丰竟然不知道如何用管理员权限打开cmd,方法是: win->输入cmd->右键->管理员权限运行)

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

5. 启动WSO2 Carbon 服务

查看WSO2 Carbon 服务是否已经启动, 没启动就启动吧

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

6. 开始配置

在浏览器中输入: https://localhost:9443 进入登陆界面 ( 可能会进不去,原因是端口被防火墙黑了, 最简单的方法是关闭防火墙,也可更改防火墙端口设置, 添加9443端口, 参看: http://support.microsoft.com/kb/308127/zh-cn)

Username和Password 都是 admin

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

点击最左边的竖着的Main标签, 就可以看到各种服务了

下面我们尝试配置一个MySQL数据服务

1. 首先在机器上装个MySQL, 使用默认配置. 最好是使用mysql-noinstall 版的,卸起来方便. 普通安装也没问题.

(恐怖的run丰又不知道怎么搞......参考: http://blog.csdn.net/xiaoanian/article/details/7061787)

2. 下载MySQL的JDBC驱动程序

在这,是个ZIP文件 http://dev.mysql.com/downloads/connector/j/

3. 配置驱动

解压ZIP后将里面的.jar放到如下路径. 千万别放错了!!!

另外,还要重启一下WSO2 Carbon服务, 方法可以如上, 也可以在cmd中先后输入: net stop wso2carbon (回车), net start wso2carbon (回车).

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

4. 配置MySQL数据服务

点击左侧 DataService -> Create, 填写一些信息.

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

点击Next.

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

再点 Add New Data Source

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

随便写个DataSource ID, DataSource Type 要选RDBMS, 点击Save

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

填一些配置, 其中

a. "JDBC URL" 的数据库名称根据自己的填. 这里的名称是test.

b. 如果是新安装的MySQL, 默认用户名是root, 密码为空(不填). (当然也可自己先在MySQL中新建用户,不用默认的root)

填完之后点击 Test Connection 即可看是否能连上(注意先启动MySQL服务: 启动方法是在cmd中输入net start mysql )

如果成功,再点Save, 可以看到已经创建成功了.

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

点Next

windows下 WSO2 Application Server配置 及 MySQL数据服务部署

Add New Query , 可以添加很多条语句….

然后一步步往下走…自己摸索吧, 挺简单的…


关于Data Service的具体用法,参考:http://wso2.org/blog/sumedha/2573

还可以将一个 jar文件 部署到 Jar Service 上, 非常简单.

没然后了.

【来,chi个痛快】