Install liferay framework and integrate with MySql or other database
2010-11-15 13:52
381 查看
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.
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.
相关文章推荐
- Manual install on Windows 7 with Apache and MySQL
- php install with mysql on w2k3 and IIS mannually
- [PHP] Reprinted - Database Sharding at Netlog, with MySQL and PHP
- Solving a “communications link failure” with jdbc and mysql :Cannot connect to database server Commu
- Install Nginx with PHP5 and MySQL (LEMP) in Ubuntu 13.10 Server
- Your app, extension, and/or linked framework appears to contain code designed explicitly with the ca
- How To Install Or Upgrade LAMP: Linux, Apache, MySQL and PHP Stack Using Yum
- Install and configure MySQL 5 with MacPorts
- How to Integrate angular 2 with php and mysql db
- Liferay service builder connects with other database
- Understanding JOINs in MySQL and Other Relational Databases 理解JOIN在MySQL和其他数据库中的运用
- Git CMD - pull: Fetch from and integrate with another repository or a local branch
- How to install Nginx, PHP, PHP-FPM and MySQL under Windows with Cygwin
- mysql 报错 Ignoring query to other database
- Using the Repository Pattern with ASP.NET MVC and Entity Framework
- How to Install MySQL 5.1 Database on A Linux Server
- yum install mysql提示“This system is not registered with RHN”
- Creating Database Web Applications with PHP and ASP
- How To Look At MySQL Joins and More ORDER BY With LIMIT
- A context path must either be an empty string or start with a '/' and do not end with a '/' 问题解决方法