欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

LIFERAY 6.0 部署过程 和JDBC 版本注意问题 JDBCOracleJBossSQL ServerHSQLDB 

程序员文章站 2024-03-22 22:22:46
...
这几天准备开发liferay,在OOB的基础上面开发,第一步当然是环境搭建。

部署过程其实很简单,只是部署过程需要注意很多问题,特此记录:

liferay部署过程如下:

前提条件:Oracle 数据库10 g, jdk 1.6

1. 在数据库中创建一个数据库,例如名字叫SISDCS05
  
2. 使用system登录进去,创建tables,user,并给该user dba的权限。

    (如果不想给dba的权限,只想让user使用select, insert 等语句,那只能先手动创建表了,liferay官网上面有提供的sql脚本)

QL> create tablespace liferay
2  datafile 'd:\LiferayData\liferay.dbf'
3  size 100m autoextend on next 10m maxsize unlimited extent management local;

ablespace created.

QL> create user liferay identified by liferay default tablespace liferay
2  Temporary tablespace temp;

ser created.

QL> grant connect,resource,dba to liferay;

rant succeeded.

QL> commit;

ommit complete.


3. 在liferay官网(http://www.liferay.com) 上面下载liferay+jboss绑定版本,
  
4. 下载后,解压到c盘下面,(修改文件夹名,去掉版本号,其实是我自己喜欢修改成为简短的文件夹名,因为如果文件夹名字过程,会导致子文件夹下面的文件完整路径过程,而windows 的文件路径是有长度限制的。)
4. 开始配置liferay。
4.1  下载ojdbc6.jar包(由于我用的是jdk1.6+oracle10g,所以需要,如果你用的是1.5或者1.4,这个很恼火,我部署的时候就是因为这个问题,换了好几次jar包,始终不行,原因就是对jdbc版本和oracle版本不了解,完了整理下。)
4.2  下载ojdbc6.jar,放在%liferay_home%/%JBOSS_HOME%/server/default/lib 文件夹下(不需要配置环境变量,我只是为了书写方便)
4.3  找到%liferay_home%/%JBOSS_HOME%/server/default/deploy文件夹,拷贝hsqldb-ds.xml,粘贴,并重命名copy-hsqldb-ds.xml文件为liferay-ds.xml,修改该文件,去掉<?xml version="1.0" encoding="UTF-8"?>以下的所有部分,用一下代码替换:
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/LiferayPool</jndi-name>
<connection-url>
jdbc:oracle:thin:@16.173.234.74:1521:SISDCS05
</connection-url>
<driver-class>oracle.jdbc.OracleDriver</driver-class>
<user-name>liferay</user-name>
<password>liferay</password>
<min-pool-size>0</min-pool-size>
</local-tx-datasource>
</datasources>
(结合自己的具体jdk版本和oracle版本编写)
4.4  找到liferay_home文件夹(JBOSS_HOME文件夹的上一层)新建一个portal-ex.properties文件,并编写以下代码:
jdbc.default.jndi.name=jdbc/LiferayPool
4.5  找到$JBOSS_HOME/server/default/conf/login-config.xml文件,编辑该文件,注释掉以下段落。
<!-- The default login configuration used by any security domain that
  does not have a application-policy entry with a matching name
 
  <application-policy name="other">
     A simple server login module, which can be used when the number
    of users is relatively small. It uses two properties files:
    users.properties, which holds users (key) and their password (value).
    roles.properties, which holds users (key) and a comma-separated list of
    their roles (value).
    The unauthenticatedIdentity property defines the name of the principal
    that will be used when a null username and password are presented as is
    the case for an unuathenticated web client or MDB. If you want to
    allow such users to be authenticated add the property, e.g.,
    unauthenticatedIdentity="nobody"
   
    <authentication>
      <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
        flag="required"/>
    </authentication>
  </application-policy>

-->

4.6  ok,截止到目前,所有都完成了,可以跑到%jboss_home%\bin文件夹下,运行
run.bat,不出意外的话,就可以了。