Selasa, 15 November 2011

Building Liferay on Tomcat

Introduction:

WebSynergy or Sun GlassFish Web Space Server is built on top of Liferay. The first release of WebSynergy will be built on Liferay 5.2.0. This page describes how you can checkout the source and build the core from open soruce.

Step 1: Install Apache Tomcat

  • Download Apache Tomcat (6.0.18)
  • Unzip tomcat 6.0.18
  • cd apache-tomcat-6.0.18/bin
  • chmod +x *.sh
  • Create setenv.sh
    • JAVA_OPTS="-Xms128m -Xmx1024m -XX:MaxPermSize=512m"
  • Start tomcat
    • apache-tomcat-6.0.18/bin/catalina.sh start
  • Verify http://localhost:8080/
  • Stop tomcat
    • apache-tomcat-6.0.18/bin/catalina.sh stop

Step 2: Checkout Liferay source

Step 3: Prepare build environment

Create app.server..properties in trunk (or 5.2.x) directory, where user is the user name of user logged in to the OS.

app.server.parent.dir= app.server.tomcat.version=6.0 app.server.tomcat.dir=${app.server.parent.dir}/apache-tomcat-6.0.18 app.server.tomcat.classes.global.dir=${app.server.tomcat.dir}/lib app.server.tomcat.lib.endorsed.dir=${app.server.tomcat.dir}/lib/ext app.server.tomcat.lib.global.dir=${app.server.tomcat.dir}/lib/ext app.server.tomcat.lib.support.dir=${app.server.tomcat.dir}/lib/ext app.server.tomcat.support.dir=${app.server.tomcat.dir}/lib/ext 
Hint
You can customize the build environment further by overriding more properties from app.server.properties

Step 4: Build

  • cd trunk (or 5.2.x)
  • ant start
  • ant deploy

Step 5: Test

Step 6: Customize

  • Stop Tomcat
  • To use sample data, copy lportal.script
    • cp trunk/sql/lportal.script apache-tomcat-6.0.18/bin
  • Create apache-tomcat-6.0.18/webapps/ROOT/WEB-INF/classes/portal-ext.properties
    • schema.run.minimal=false
  • Start Tomcat
Tip
Always cd to the bin directory and then start Tomcat so the lportal.script is used by HSQL, otherewise it will create a fresh one which will not have any sample data.

If you do not want the url to be opened automatically in the browser, set this in portal-ext,

browser.launcher.url= 

If you have MySQL up and running, then create a database "lportal" and add following lines to portal-ext

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= 

There are tons of properties that can be overridden in portal-ext. Look at trunk/portal-impl/src/portal.properties for what you can override.


source : http://wikis.sun.com/display/websynergy/Building+Liferay+on+Tomcat


Ant View and go to Run As > External Tools Configuration > Environment and add a new Variable:

Name: ANT_OPTS
Value: -Xmx1024m -XX:MaxPermSize=256m

Since Eclipse is invoking Ant it needs the variable.


Tidak ada komentar:

Posting Komentar