关于opencrx的介绍,可以去以下网站看
对于新手,提供了中文傻瓜包,不过只能在windows平台使用
另外还有打包好的VMWARE虚拟机版可以体验
如果希望自己安装配置,可以参考本文:
本文参考了官方安装文档PDF文件
1.JDK
此软件需要JDK1.5以上.
安装JDK .JDK很简单,在sun网站下载jdk-6u3-linux-i586.bin
#chmod 700 jdk-6u3-linux-i586.bin
#./jdk-6u3-linux-i586.bin
按空格阅读完许可协议后,回答yes开始安装,稍侯就将JDK解压缩了
#mv jdk1.6 /usr/local/jdk1.6
设置JAVA_HOME
#export JAVA_HOME=/usr/local/jdk-1.5.0.05
#export PATH=${PATH}:${JAVA_HOME}/bin
#export JAVA_HOME=/usr/local/jdk-1.5.0.05
#export PATH=${PATH}:${JAVA_HOME}/bin
2 Install Ant
下载ant二进制包(
[url]http://ant.apache.org[/url])apache-ant-1.7.0-bin.tar.gz
不用安装,直接解压缩到/usr/local/ant
设置环境变量
export ANT_HOME=/usr/local/ant
export PATH=${PATH}:${ANT_HOME}/bin
不用安装,直接解压缩到/usr/local/ant
设置环境变量
export ANT_HOME=/usr/local/ant
export PATH=${PATH}:${ANT_HOME}/bin
3.生成二进制发布包(可以在sourceforge网站上直接下载)
[url]http://jaist.dl.sourceforge.net/sourceforge/opencrx/opencrx-core-CRX-App.ear[/url]
[url]http://jaist.dl.sourceforge.net/sourceforge/opencrx/opencrx-core-CRX-Web.ear[/url]
[url]http://jaist.dl.sourceforge.net/sourceforge/opencrx/opencrx-core-CRX-App.ear[/url]
[url]http://jaist.dl.sourceforge.net/sourceforge/opencrx/opencrx-core-CRX-Web.ear[/url]
下载
[url]http://jaist.dl.sourceforge.net/sourceforge/opencrx/opencrx-1.11.0-core.jre-1.5.tar.gz[/url]
解压缩opencrx-1.11.0-core.jre-1.5.tar.gz
tar zxvf opencrx-1.11.0-core.jre-1.5.tar.gz
在解压缩的目录中创建opt目录
#cd opencrx-1.11.0
#mkdir opt
下载 [url]http://jaist.dl.sourceforge.net/sourceforge/openmdx/openmdx-1.18.2-core.jre-1.5.tar.gz[/url]
[url]http://jaist.dl.sourceforge.net/sourceforge/openmdx/openmdx-1.18.2-portal.jre-1.5.tar.gz[/url]
[url]http://jaist.dl.sourceforge.net/sourceforge/openmdx/openmdx-1.18.2-security.jre-1.5.tar.gz[/url]
[url]http://jaist.dl.sourceforge.net/sourceforge/openmdx/openmdx-1.18.2-websphere.websphere-6.tar.gz[/url]
解压缩opencrx-1.11.0-core.jre-1.5.tar.gz
tar zxvf opencrx-1.11.0-core.jre-1.5.tar.gz
在解压缩的目录中创建opt目录
#cd opencrx-1.11.0
#mkdir opt
下载 [url]http://jaist.dl.sourceforge.net/sourceforge/openmdx/openmdx-1.18.2-core.jre-1.5.tar.gz[/url]
[url]http://jaist.dl.sourceforge.net/sourceforge/openmdx/openmdx-1.18.2-portal.jre-1.5.tar.gz[/url]
[url]http://jaist.dl.sourceforge.net/sourceforge/openmdx/openmdx-1.18.2-security.jre-1.5.tar.gz[/url]
[url]http://jaist.dl.sourceforge.net/sourceforge/openmdx/openmdx-1.18.2-websphere.websphere-6.tar.gz[/url]
解压缩openmdx-1.18.2-core.jre-1.5.tar.gz
openmdx-1.18.2-portal.jre-1.5.tar.gz
openmdx-1.18.2-security.jre-1.5.tar.gz
openmdx-1.18.2-websphere.websphere-6.tar.gz
openmdx-1.18.2-portal.jre-1.5.tar.gz
openmdx-1.18.2-security.jre-1.5.tar.gz
openmdx-1.18.2-websphere.websphere-6.tar.gz
#tar zxvf openmdx-1.18.2-core.jre-1.5.tar.gz
...
...
把解压缩生成的openmdx-1.18.2移动到opt目录下
#cd opencrx-1.11.0/core
#cd opencrx-1.11.0/core
#ant install-src
#ant assemble
在如下目录生成2个EAR包(opencrx-core-CRX-App.ear,opencrx-core-CRX-Web.ear)
opencrx-1.11.0/jre-1.5/core/deployment-unit
#ant assemble
在如下目录生成2个EAR包(opencrx-core-CRX-App.ear,opencrx-core-CRX-Web.ear)
opencrx-1.11.0/jre-1.5/core/deployment-unit
opencrx支持3种J2EE平台,JBOSS,WebLogic,Websphere,下面以JBOSS来配置
4 JBOSS-4.22GA安装
下载jboss4.22GA.zip
解压缩(jar -xvf jboss4.22GA.zip)//也可以用unzip和tar命令来解压缩
下载jboss4.22GA.zip
解压缩(jar -xvf jboss4.22GA.zip)//也可以用unzip和tar命令来解压缩
启动jboss
jboss4.22GA/bin/run.sh
启动后可以访问 [url]http://127.0.0.1:8080[/url]来看到JBOSS的欢迎界面.
要想从任意地址访问
需要修改 jboss-4.2.0.GA\server\default\deploy\jboss-web.deployer\server.xml 把 <Connector port="8080"
jboss4.22GA/bin/run.sh
启动后可以访问 [url]http://127.0.0.1:8080[/url]来看到JBOSS的欢迎界面.
要想从任意地址访问
需要修改 jboss-4.2.0.GA\server\default\deploy\jboss-web.deployer\server.xml 把 <Connector port="8080"
address="${jboss.bind.address}"中的jboss.bind.address
改成对应的 IP 或者 0.0.0.0 就可以用 IP 访问了
<Connector port="8080" address="${0.0.0.0}"
改成对应的 IP 或者 0.0.0.0 就可以用 IP 访问了
<Connector port="8080" address="${0.0.0.0}"
5 设置数据库(opencrx支持多种数据库,本文以MYSQL为例)
5.1.下载opencrx-1.11.0-core.mysql-5.zip
5.2.安装MYSQL 数据库
下载MYSQL JDBC 驱动连接器 mysql-connector-java-5.0.8.tar.gz
注意:MYSQL的表类型需要修改为InnoDB,默认类型为MyISAM
5.3修改MYSQL的表类型
编辑/etc/my.cnf,加入
[mysqld]
default-storage-engine=INNODB
5.4创建数据库
mysql -u root -p
>create database crx;
>GRANT ALL PRIVILEGES ON crx.* TO 'system'@'localhost' IDENTIFIED BY 'manager';
编辑/etc/my.cnf,加入
[mysqld]
default-storage-engine=INNODB
5.4创建数据库
mysql -u root -p
>create database crx;
>GRANT ALL PRIVILEGES ON crx.* TO 'system'@'localhost' IDENTIFIED BY 'manager';
5.5修改默认字符集.mysql默认字符集为latin1
查看字符集
mysql -u root -p
>SHOW VARIABLES LIKE 'character%';
查看字符集
mysql -u root -p
>SHOW VARIABLES LIKE 'character%';
修改字符集
在linux下修改/etc/my.cnf文件
在linux下修改/etc/my.cnf文件
找到客户端配置[client] 在下面添加
default-character-set=utf8 默认字符集为utf8
default-character-set=utf8 默认字符集为utf8
再找到[mysqld] 添加
default-character-set=utf8 默认字符集为utf8
init_connect='SET NAMES utf8' (设定连接mysql数据库时使用utf8编码,以让mysql数据库为utf8运行)
default-character-set=utf8 默认字符集为utf8
init_connect='SET NAMES utf8' (设定连接mysql数据库时使用utf8编码,以让mysql数据库为utf8运行)
5.6导入sql文件
解压缩opencrx-1.11.0-core.mysql-5.zip得到以下文件
dbcreate-tables.sql
dbcreate-views.sql
dbcreate-indexes.sql
populate-preferences.sql
解压缩opencrx-1.11.0-core.mysql-5.zip得到以下文件
dbcreate-tables.sql
dbcreate-views.sql
dbcreate-indexes.sql
populate-preferences.sql
#mysql -u root -p crx < *.sql
如果导入dbcreate-views.sql报错:
ERROR 1051 (42S02) at line 45: Unknown table 'OOCKE1_JOIN_ACCTHASASSACT'
如果导入dbcreate-views.sql报错:
ERROR 1051 (42S02) at line 45: Unknown table 'OOCKE1_JOIN_ACCTHASASSACT'
不影响后面的操作.
6 安装,设置应用服务器
6.1 复制openmdx-kernel.jar 到server/default/lib/
(opencrx-1.11.0/opt/jre-1.5/core/lib/openmdx-kernel.jar)
复制 jdbc 驱动(mysql-connector-java-5.0.8-bin.jar)到 /server/default/lib
复制第3步生成的EAR包(opencrx-core-CRX-App.ear,opencrx-core-CRX-web.ear)
opencrx-1.11.0/jre-1.5/core/deployment-unit
到server/default/deploy
(opencrx-1.11.0/opt/jre-1.5/core/lib/openmdx-kernel.jar)
复制 jdbc 驱动(mysql-connector-java-5.0.8-bin.jar)到 /server/default/lib
复制第3步生成的EAR包(opencrx-core-CRX-App.ear,opencrx-core-CRX-web.ear)
opencrx-1.11.0/jre-1.5/core/deployment-unit
到server/default/deploy
复制jdbc-opencrx-CRX-mysql-ds.xml 到/server/default/deploy
在server/default下创建server.log.properties
ApplicationId = openCRX
LogFileExtension = log
LogFilePath = /home/jboss-4.2.2.GA/server/default/log/
LogLevel = warning
java.LoggingMechanism = SharedDatedFileLoggingMechanism
ApplicationId = openCRX
LogFileExtension = log
LogFilePath = /home/jboss-4.2.2.GA/server/default/log/
LogLevel = warning
java.LoggingMechanism = SharedDatedFileLoggingMechanism
在/bin/run.conf 后添加
rem Setup openMDX-specific properties
JAVA_OPTS="$JAVA_OPTS -Xms128m -Xmx512m"
JAVA_OPTS="$JAVA_OPTS -Dorg.openmdx.compatibility.base.application.j2ee.domain=apps"
JAVA_OPTS="$JAVA_OPTS -Dorg.openmdx.compatibility.base.application.j2ee.server=server1"
JAVA_OPTS="$JAVA_OPTS -Djava.protocol.handler.pkgs=org.openmdx.kernel.url.protocol"
JAVA_OPTS="$JAVA_OPTS -Dorg.openmdx.log.config.filename=/opt/jboss/server/default/server.log.properties"
rem Setup openMDX-specific properties
JAVA_OPTS="$JAVA_OPTS -Xms128m -Xmx512m"
JAVA_OPTS="$JAVA_OPTS -Dorg.openmdx.compatibility.base.application.j2ee.domain=apps"
JAVA_OPTS="$JAVA_OPTS -Dorg.openmdx.compatibility.base.application.j2ee.server=server1"
JAVA_OPTS="$JAVA_OPTS -Djava.protocol.handler.pkgs=org.openmdx.kernel.url.protocol"
JAVA_OPTS="$JAVA_OPTS -Dorg.openmdx.log.config.filename=/opt/jboss/server/default/server.log.properties"
在server/default/conf 创建文件users.properties
admin-Root=rootSecret
admin-Standard=adminSecret
guest=guest
admin-Root=rootSecret
admin-Standard=adminSecret
guest=guest
创建文件 roles.properties
admin-Root.Roles=OpenCrxRoot
admin-Standard.Roles=OpenCrxAdministrator
guest.Roles=OpenCrxUser
admin-Root.Roles=OpenCrxRoot
admin-Standard.Roles=OpenCrxAdministrator
guest.Roles=OpenCrxUser
在login.conf.xml最后添加.
(直接粘贴在文件尾会报错,要粘贴在 最后一个</policy>前面)
(直接粘贴在文件尾会报错,要粘贴在 最后一个</policy>前面)
<application-policy name="opencrx-core-CRX">
<authentication>
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="sufficient">
<module-option name="dsJndiName">java:/jdbc_opencrx_CRX</module-option>
<module-option name="principalsQuery">SELECT c.passwd FROM OOCSE1_PRINCIPAL p, OOCSE1_CREDENTIAL c WHERE
<authentication>
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="sufficient">
<module-option name="dsJndiName">java:/jdbc_opencrx_CRX</module-option>
<module-option name="principalsQuery">SELECT c.passwd FROM OOCSE1_PRINCIPAL p, OOCSE1_CREDENTIAL c WHERE
(p.object_id LIKE 'principal/CRX/Root/Default/%') AND (p.credential = c.object_id) AND (p.name = ?)</module-option>
<module-option name="rolesQuery">SELECT r.name, 'Roles' FROM OOCSE1_PRINCIPAL_ pg, OOCSE1_PRINCIPAL p,
<module-option name="rolesQuery">SELECT r.name, 'Roles' FROM OOCSE1_PRINCIPAL_ pg, OOCSE1_PRINCIPAL p,
OOCSE1_PRINCIPAL_ pn, OOCSE1_ROLE r WHERE (p.object_id = pn.object_id) AND (pn.is_member_of = pg.object_id) AND
(pg.granted_role = r.object_id) AND (p.object_id LIKE 'principal/CRX/Root/Default/%') AND (p.name = ?)</module-
option>
<module-option name="ignorePasswordCase">true</module-option>
<module-option name="hashCharset">UTF-8</module-option>
<module-option name="hashEncoding">base64</module-option>
<module-option name="hashAlgorithm">MD5</module-option>
</login-module>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="sufficient" >
<module-option name="usersProperties">users.properties</module-option>
<module-option name="rolesProperties">roles.properties</module-option>
</login-module>
</authentication>
</application-policy>
<module-option name="ignorePasswordCase">true</module-option>
<module-option name="hashCharset">UTF-8</module-option>
<module-option name="hashEncoding">base64</module-option>
<module-option name="hashAlgorithm">MD5</module-option>
</login-module>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="sufficient" >
<module-option name="usersProperties">users.properties</module-option>
<module-option name="rolesProperties">roles.properties</module-option>
</login-module>
</authentication>
</application-policy>
#/home/jboss/bin/run.sh
运行后会在控制台看到jboss的启动输出,等待3-5分钟后,服务就起来了
然后从浏览器访问
用刚才创建的用户登录
admin-Root=rootSecret
admin-Standard=adminSecret
guest=guest
admin-Standard=adminSecret
guest=guest
7 JBoss的其他设置(性能优化)
修改server.xml 添加compression="on" 启用压缩
URIEn/coding="UTF-8" 启用UTF-8支持
Apache-Jakarta-Project的http connector reference 页面)添加/设置Tomcat选项
<Connector port="80" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="utf-8"
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain" />
修改server.xml 添加compression="on" 启用压缩
URIEn/coding="UTF-8" 启用UTF-8支持
Apache-Jakarta-Project的http connector reference 页面)添加/设置Tomcat选项
<Connector port="80" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="utf-8"
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain" />
8开机自启动jboss
进入Jboss目录下的bin目录
#cp jboss_init_redhat.sh /etc/init.d/jboss
编辑此脚本,加入JAVA_HOME的声明
#export JAVA_HOME=/usr/local/jdk1.6
进入Jboss目录下的bin目录
#cp jboss_init_redhat.sh /etc/init.d/jboss
编辑此脚本,加入JAVA_HOME的声明
#export JAVA_HOME=/usr/local/jdk1.6
#chmod 700 jboss
#chkconfig --add jboss
#chkconfig --add jboss
#chkconfig jboss on
后续的操作可以参考PDF手册
openCRX_Quick_Start1.10.pdf