cài đặt liferay 6.1

Download Cài đặt liferay 6.1

If you can't read please download the document

Upload: vu-thanh-binh

Post on 28-Apr-2015

102 views

Category:

Documents


11 download

DESCRIPTION

install liferay

TRANSCRIPT

LifeRay - Eclipse

Ni dung:1. Cc cng c cn thit:.......................................................................................... 1 2. Cu hnh Eclipse v : ........................................................................................... 2 3. Check out Liferay Source Code .......................................................................... 5 4. Build Ext .............................................................................................................. 7 5. Deploy Ext: .......................................................................................................... 9

1. Cc cng c cn thit:a. Ci t java b. Ci t Mysql vi user/pass chng hn root/root, sau vo MySQL Command Line g lnh to database: drop database if exists lportal; create database lportal character set utf8; grant all on lportal.* to 'lportal'@'localhost' identified by 'lportal' with grant option; grant all on lportal.* to 'lportal'@'localhost.localdomain' identified by 'lportal' with grant option; c. Download eclipse bn no cng c d. Download Tomcat 6.0 v n nh, nhanh nht e. Ly Tomcat Plugins file nh km, hoc download http://www.eclipsetotale.com

Hong Mnh Hng - HTTT - K50 - BKHN

Page 1

LifeRay - Eclipse

2. Cu hnh Eclipse v :a. To th mc D:\Liferay-Portal-5.2 b. Gii nn eclipse vo th mc D:\Liferay-Portal-5.2\eclipse c. Gii nn tomcat 6.0 vo th mc D:\Liferay-Portal-5.2\apache-tomcat-6.0.20 d. Gii nn Tomcat Plugins v copy th mc com.sysdeo.eclipse.tomcat_3.2.1 vo th mc D:\Liferay-Portal-5.2\eclipse\dropins e. Khi ng Eclipse. Chn workspace cho n l: D:\Liferay-Portal-5.2\workspace f. Cu hnh Eclipse n nhn jdk: - Vo menu Windows>Preferences, click vo Java>Install JREs - Nhn nt Add, chn Standard VM ri nhn Next. Browse n th mc JDK nh hnh v.

- Nhn Finish, ri Ok.

Hong Mnh Hng - HTTT - K50 - BKHN

Page 2

LifeRay - Eclipse e. Cu hnh Eclipse n nhn Tomcat - Vo menu Windows>Preferences, click vo Tomcat - Chn Tomcat Version 6 v Browse n Tomcat Home nh hnh v

Hong Mnh Hng - HTTT - K50 - BKHN

Page 3

LifeRay - Eclipse - Click Tomcat>JVM Settings. Chn JRE l jdk1.5.0 v Thm vo u tin dng sau: -Xms128m -Xmx1024m -XX:MaxPermSize=128m. Hnh v:

-

Nhn nt Ok.

Hong Mnh Hng - HTTT - K50 - BKHN

Page 4

LifeRay - Eclipse

3. Check out Liferay Source Codea. ly c Liferay Source Code trc ht phi ly c SVN nh sau: - Bc 1: Vo menu Help> Install New Software. Nhn nt Add. - Bc 2: in vo Dialog Box cp Name/Location nh sau: Subclipse/http://subclipse.tigris.org/update_1.6.x . Nhn Ok. Hnh v

- Bc 3: Sau khi n Ok, chn c 3 la chn i Name ri n Next v tip Tc lm theo hng dn ca Eclipse. Lu vic down Subclipse thnh thong bo li. Nu c bo li phi lm li t bc 2. - Bc 4: Restart li Eclipse b. Ly Source Code ca Liferay v: -B1: Vo Windows>Open Perspective>Other>SVN Repository Exploring. Nhn Ok. -B2: Trn Khung nhn SVN Repositories nhn chut phi, chn New>Repository Location v in vo dng sau: svn://svn.liferay.com/repos/public . Sau nhn Finish

Hong Mnh Hng - HTTT - K50 - BKHN

Page 5

LifeRay - Eclipse - B3: M nt svn://svn.liferay.com/repos/public>portal>branches . Nhn chut phi vo 5.2.x ri bm Checkout nh hnh v

- B4: Nhn Finish download source code v. Kh lu, c hn ting v c th c li. Nu bo li lm li t B2.

Hong Mnh Hng - HTTT - K50 - BKHN

Page 6

LifeRay - Eclipse

4. Build Exta. Chn Java Perspective, m khung nhn Navigator thy c Project portal b. M khung nhn Ant. Li file build.xml t th mc /portal sang khung nhn Ant nh hinh di

c. Cp nht Tomcat n nhn mi trng Ext - To mt Java Project tn l Server - Chut phi vo project Server v chn New>Folder - Nhp tn folder trng vi tn th mc Tomcat cho d nh: apache-tomcat-6.0.20 - Nhn nt conf - M file catalina.properties - Tm n thuc tnh common.loader, thm vo cui dng c nh sau:common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/lib/ext/*.jar

- Save file li. Hong Mnh Hng - HTTT - K50 - BKHN

Page 7

LifeRay - Eclipse

To file setenv.bat c th gi tomcat t dng lnh v truy cp tomcat t Netbeans nh sau: - Tr ti Server>apache-tomcat-6.0.20>bin - To mt file setenv.bat vi ni dung sau:set JAVA_OPTS=%JAVA_OPTS% -Xmx1024m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 Duser.timezone=GMT -Djava.security.auth.login.config="%CATALINA_HOME%/conf/jaas.config" Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false

- Save n li. d. Chnh sa cc file properties: Gi s Username ng nhp vo my tnh l hunghm. Nhn vo th mc /portal c 3 file quan trng release.properties, build.properties, app.server.properties. Thay v chnh s trc tip trong 3 file ny ta to ra 3 file mi: release.hunghm.properties, build.hunghm.properties, app.server.hunghm.properties v ghi cc thuc tnh cn thay i vo ri copy vo cng th mc. - release.hunghm.properties cho bit th mc ext u. Ghi vo file 1 dng sau: lp.ext.dir=D:/Liferay-Portal-5.2/workspace/ext - build.hunghm.properties cho bit phin bn ca Java. Gi s phin bn Java ci t trn my l 1.6.2_16 th ch lu phn 1.6. Ghi vo file 2 dng sau:ant.build.javac.source=1.6 ant.build.javac.target=1.6

- app.server.hunghm.properties: ghi vo file cc dng di y:app.server.type=tomcat app.server.tomcat.dir=D:/Liferay-Portal-5.2/apache-tomcat-6.0.20 app.server.tomcat.version=6.0 app.server.tomcat.classes.global.dir=D:/Liferay-Portal-5.2/apache-tomcat-6.0.20/lib app.server.tomcat.lib.endorsed.dir=D:/Liferay-Portal-5.2/apache-tomcat-6.0.20/lib/ext app.server.tomcat.lib.global.dir=D:/Liferay-Portal-5.2/apache-tomcat-6.0.20/lib/ext app.server.tomcat.lib.support.dir=D:/Liferay-Portal-5.2/apache-tomcat-6.0.20/lib/ext app.server.tomcat.support.dir=D:/Liferay-Portal-5.2/apache-tomcat-6.0.20/lib/ext

e. Build: - Chuyn qua khung nhn ant. M nt portal - Bm clean. i bo BUILD SUCCESSFULLY - Bm start. i khong 14 pht bo BUILD SUCCESSFULLY - Bm build-ext. i khong 2 pht bo BUILD SUCCESSFULLY - Build xong mi trng ext.

Hong Mnh Hng - HTTT - K50 - BKHN

Page 8

LifeRay - Eclipse

5. Deploy Ext:a. Nhn Project ext: Sau khi build xong, c mt project mi trong workspace l ext. eclipse nhn project mi ny lm nh sau: - Chuyn qua khung nhn Navigator, n chut phi, chn Import - Chn General>Existing Projects into Workspace - Browse root directory n th mc D:\Liferay-Portal-5.2\workspace\ext - Nhn Finish. b. Cu hnh kt ni CSDL - Gi s bn ng nhp mysql vi user/pass l root/root - Trn khung nhn Navigator, m nt ext>ext-impl>src, m file portal-ext.properties v thm vo dng sau.jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false jdbc.default.username=root jdbc.default.password=root

- Save file li c. Chnh sa cc file properties - copy 2 file app.server.hunghm.properties, build.hunghm.properties t th mc /portal vo th mc /ext d. Deploy - Ko file build.xml t th mc /ext sang khung nhn Ant - Chuyn qua khung nhn Ant, m nt ext - Bm clean. i bo BUILD SUCCESSFULLY - Bm deploy. i bo BUILD SUCCESSFULLY - deploy xong. Bm vo biu tng Start Tomcat chy Liferay Portal

Hong Mnh Hng - HTTT - K50 - BKHN

Page 9