Install liferay framework and integrate with MySql or other database

I am asked to learn liferay,which is an open source portal framework, to make a demo as soon as possible. Unluckily, I have never heard of it before. have no choice, I have to google about it, go to the related forms I can found,etc.


The first problem I need to resolve is to install liferay with mysql.

how to Install liferay:
* go to http://www.liferay.com/web/guest/downloads/portal , and select one of the recommended bundle version 'liferay portal v5.2.3 Bundled with Tomcat 5.5' to download.

* unzip the downloaded file to folder c:/liferay-portal-sql-5.2.3,

then you got LIFERAY_HOME=c:/liferay-portal-sql-5.2.3 ,

TOMCAT_HOME=c:/liferay-portal-sql-5.2.3/tomcat-5.5.27

* set your JAVA_HOME correctly in your system

* if you have never set your CATALINA_BASE or CATALINA_HOME in your system environment, you can ignore this step, otherwise,

you need to set CATALINA_BASE=C:/liferay-portal-5.2.3/tomcat-5.5.27 and CATALINA_HOME=C:/liferay-portal-5.2.3/tomcat-5.5.27 in your system environment,which location is Control Panel - System - Advanced System Settings - Advanced tab - Environment Variables...

* run startup.bat in folder C:/liferay-portal-5.2.3/tomcat-5.5.27/bin and welcome page will launch automatically. then you can login as admin to use default admin account 'test@liferay.com' and password 'test' to play it.

but this installation is to use default database HSQL, it is not good for development and production environment. so how to integrate with other database ? I take mysql as example to show you the steps.

how to integrate with MySql:

* download mysql database with the latest version ,such as v5.4 and later, do not waste your time to try v5.1 or earlier versions.

* go to http://sourceforge.net/projects/lportal/ to dowload liferay-portal-sql-5.2.3.zip .

* open script file create/create-mysql.sql in zip file liferay-portal-sql-5.2.3.zip and execute it in mysql , this script will create liferay database and insert initial data.

* put the mysql jdbc driver file, such as mysql-connector-java-5.1.7-bin.jar, to folder C:/liferay-portal-5.2.3/tomcat-5.5.27/common/lib/ext.

* add a resource between and in the file C:/liferay-portal-5.2.3/tomcat-5.5.27/conf/Catalina/localhost/ROOT.xml, I paste the resource settings here.

<Resource name="jdbc/LiferayPool" auth="Container" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8" username="root" password="" maxActive="20" maxIdle="30" maxWait="10000" />

take note I use default admin account root and empty password to login mysql.

* add a new config file portal-ext.properties in folder C:/liferay-portal-5.2.3/tomcat-5.5.27/webapps/ROOT/WEB-INF/classes ,and put a config item in this file.

jdbc.default.jndi.name=jdbc/LiferayPool

* run startup.bat in folder C:/liferay-portal-5.2.3/tomcat-5.5.27/bin , you will find liferay would access mysql database,rather than default HSQL database.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值