configure liferay 5 tomcat bundled

Upload: yansakhrul

Post on 30-May-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Configure Liferay 5 Tomcat Bundled

    1/10

    Configure Liferay 5.2.3 bundlet with tomcat on Windows 7

    According to Jonas. X Yuan on Liferay Portal Intranet Enterprise

    Liferay Portal is one of the most mature portal frameworks in the market and offers manybenefits. Liferay is backed by a comprehensive professional services network and it offerscustom development, training, and support across the world.

    As the world's leading open source portal platform, Liferay provides a unified web interfaceto data and tools scattered across many sources. Within Liferay portal, a portal interface iscomposed of a number of portlets self contained interactive elements that are written to a

    particular standard. Since portlets are developed independently of the portal itself, and loosely coupled with the portal, they are apparently SOA (Service-Oriented Architecture).

    In this article, i would try explain how to setup Extension Environtment for liferay development.

    I wrote this article not to teach but this is what ive done and my personal documentation for my research just incase i forgot or my computer crashes....since im lame....:D

    Before we start, we need external tools for this article.

    1. JDK, since liferay is java base portal. We need to setup JDK in our computer. Download thisJDK for free from http://java.sun.com/javase/downloads/jdk6.jsp

    1. Ant, ant is free tools for most java development. Download fromhttp://apache.eu.lucid.dk/ant/binaries/apache-ant-1.7.0-bin.zip or fromhttp://www.ziddu.com/downloadlink/7661539/apache-ant-1.7.0-bin.zip

    2. Jikes, i use 1.2.2 here http://www.ziddu.com/download/7661724/jikes-1.22-1.windows.zip.html

    3. Liferay portal source 5.2.3 download from sourceforge.net4. Liferay portal-tomcat 5.2.3 download from

    http://sourceforge.net/projects/lportal/files/Liferay%20Portal/5.2.3/liferay-portal-tomcat-6.0-5.2.3.zip/download

    After we download all file that we need, next step is to set up Environtment Variabel. I assumethat you have setup you Environtment Variabel, if not you can follow the instruction fromhere....(link my blog again here).

    Let get it on....

    Lets assume that we will create our project in drive C:> \

    Create new folder and name it Project (you can name it whatever you like)

    Open folder project in explorer and create new folder and name it as liferay

    So we have C:>\project\liferay in our windows.

    We need create new folder in liferay directory. Create tomcat and portal folder.

    http://www.packtpub.com/building-liferay-portal-enterprise-intranets/book/bh/liferay-abr/0708http://www.packtpub.com/building-liferay-portal-enterprise-intranets/book/bh/liferay-abr/0708http://www.packtpub.com/building-liferay-portal-enterprise-intranets/book/bh/liferay-abr/0708http://java.sun.com/javase/downloads/jdk6.jsphttp://java.sun.com/javase/downloads/jdk6.jsphttp://java.sun.com/javase/downloads/jdk6.jsphttp://apache.eu.lucid.dk/ant/binaries/apache-ant-1.7.0-bin.ziphttp://apache.eu.lucid.dk/ant/binaries/apache-ant-1.7.0-bin.ziphttp://www.ziddu.com/downloadlink/7661539/apache-ant-1.7.0-bin.ziphttp://www.ziddu.com/downloadlink/7661539/apache-ant-1.7.0-bin.ziphttp://www.ziddu.com/download/7661724/jikes-1.22-1.windows.zip.htmlhttp://www.ziddu.com/download/7661724/jikes-1.22-1.windows.zip.htmlhttp://www.ziddu.com/download/7661724/jikes-1.22-1.windows.zip.htmlhttp://www.ziddu.com/download/7661724/jikes-1.22-1.windows.zip.htmlhttp://sourceforge.net/projects/lportal/files/Liferay%20Portal/5.2.3/liferay-portal-tomcat-6.0-5.2.3.zip/downloadhttp://sourceforge.net/projects/lportal/files/Liferay%20Portal/5.2.3/liferay-portal-tomcat-6.0-5.2.3.zip/downloadhttp://sourceforge.net/projects/lportal/files/Liferay%20Portal/5.2.3/liferay-portal-tomcat-6.0-5.2.3.zip/downloadhttp://sourceforge.net/projects/lportal/files/Liferay%20Portal/5.2.3/liferay-portal-tomcat-6.0-5.2.3.zip/downloadhttp://sourceforge.net/projects/lportal/files/Liferay%20Portal/5.2.3/liferay-portal-tomcat-6.0-5.2.3.zip/downloadhttp://www.ziddu.com/download/7661724/jikes-1.22-1.windows.zip.htmlhttp://www.ziddu.com/download/7661724/jikes-1.22-1.windows.zip.htmlhttp://www.ziddu.com/downloadlink/7661539/apache-ant-1.7.0-bin.ziphttp://apache.eu.lucid.dk/ant/binaries/apache-ant-1.7.0-bin.ziphttp://java.sun.com/javase/downloads/jdk6.jsphttp://www.packtpub.com/building-liferay-portal-enterprise-intranets/book/bh/liferay-abr/0708
  • 8/14/2019 Configure Liferay 5 Tomcat Bundled

    2/10

    Tomcat folder is folder that we will put all extracted file from liferay-tomcat bundled and yourdirectory will contain extracted file showing here

    To test if all configuration is right, open cmd and go to C:\project\liferay\tomcat\tomcat-6.0.18\bin>

    Type startup and see what happen in your browser. If everything is set you should see liferaywelcome page....

  • 8/14/2019 Configure Liferay 5 Tomcat Bundled

    3/10

    If you want to explore liferay portal, just use test@liferay as username and test as password andhave fun with liferay....

    Lets start to build Ext Environtment

    What is Extension Environment?

    Here is brief introduction that i obtain from Liferay Portal 4 - Development in theExtension Environment

    The extension environment, also known as the ext environment, is a set of tools that allowdevelopers to build portals and portlets on top of Liferay Portal. It can be seen as a Software

    Development Kit that is independent of any IDE but integrates well with all of them thanks toits usage of ant, the most popular and supported build tool. Another way to think about theextension environment is as a wrapper for Liferay's core source because, in most cases, it mirrors Liferay's core source directories (i.e. ext-impl/ for portal-impl/, ext-web/ for portal-web/). It allows you to develop on top of Liferay portal, like a platform, providing help whenan upgrade to a new version of Liferay Portal is needed.

    Extract liferay portal 5.2.3-src into portal folder that we create before. For easy way you can extractanywhere you like and copy all the files in the extracted folder into portal folder. Do not deleteextracted folder in case we fail to build in first attemp so we can copy again without need to re-extract.

    Here is what i got in my computer :

    http://www.ziddu.com/download/7650187/liferay-extension-environment-guide-4.3.pdf.htmlhttp://www.ziddu.com/download/7650187/liferay-extension-environment-guide-4.3.pdf.htmlhttp://www.ziddu.com/download/7650187/liferay-extension-environment-guide-4.3.pdf.htmlhttp://www.ziddu.com/download/7650187/liferay-extension-environment-guide-4.3.pdf.htmlhttp://www.ziddu.com/download/7650187/liferay-extension-environment-guide-4.3.pdf.htmlhttp://www.ziddu.com/download/7650187/liferay-extension-environment-guide-4.3.pdf.html
  • 8/14/2019 Configure Liferay 5 Tomcat Bundled

    4/10

    To build Ext Environtment we need to create app.server.properties, build.properties andrelease.properties in portal folder. Keep original file and do not change the content, we can createnew file and name it as app.server.{username}.properties, build. {username}.properties and release.{username}.properties. this new file will override original file when we build ext environment.

    {username} is computer username, to see what exactly you computer username just open cmd andtype set then you will see your username and replace {username} with your username.

  • 8/14/2019 Configure Liferay 5 Tomcat Bundled

    5/10

    e.g : my computer username is yan showing in the picture. So my file properties isapp.server.yan.properties, build.yan.properties and release.yan.properties

    add this line into your app.server.{username}.properties

    app.server.tomcat.version=6.0.18app.server.tomcat.dir=C:\project\liferay\tomcat\tomcat-6.0.18/tomcat 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

    add this line into your build.{username}.properties

    ant.build.javac.source=1.6 ant.build.javac.target=1.6

    add this line into your release.{username}.properties

    lp.ext.dir=C:/project/liferay/ext

  • 8/14/2019 Configure Liferay 5 Tomcat Bundled

    6/10

    note : in app.server.{username}.properties in line

    app.server.tomcat.dir=C:\project\liferay\tomcat\tomcat-6.0.18/tomcat

    change C:/project/liferay/tomcat/tomcat -6.0.18/ tomcat into your tomcat installation folder and

    same as release.{username}.properties .

    change lp.ext.dir=C:/project/liferay/ext into you ext directory. Do not create ext directory manualy

    because liferay wont be able to copy all the files needed into ex isting ext directory. By the way,

    release.{username}.properties is to tell liferay portal which directory that ext environtment is setup.

    Next, open cmd and point to your portal directory. Mine is C:>\project\liferay\portal

    Type this command :

    ant start clean build-ext

    on your console windows you should see this

  • 8/14/2019 Configure Liferay 5 Tomcat Bundled

    7/10

    Now check your ext directory in windows explorer, see what you got there....

  • 8/14/2019 Configure Liferay 5 Tomcat Bundled

    8/10

    Ok, your ext directory has created succesfully. Now time to deploy liferay from your ext

    environtment. To do this, you need to create app.server.{username}.properties and

    build.{username}.properties . since setup between portal and ext is similar, just copy

    app.{username}.properties and build.{username}.properties into ext folder.

    Point to your ext folder in cmd, mine is C:>\project\liferay\ext

    Type

    ant clean deploy

    to deploy your liferay. But before you do this, make sure that tomcat not running.

  • 8/14/2019 Configure Liferay 5 Tomcat Bundled

    9/10

    Since liferay-portal-tomcat-6.0-5.2.3 include JRE 1.5 in tomcat directory, we need to change

    setenv.bat in tomcat/bin and point jre home to our installed jre directory.

    For testing if our configuration is correct, point your cmd into tomcat/bin and type startup. If everything ok you will see in your browser liferay welcome page and you ready to develop yourportlet project in extension environment

  • 8/14/2019 Configure Liferay 5 Tomcat Bundled

    10/10

    That all my article in Building Ext Environment on Liferay tomcat bundled 5.2.3 src

    Next, i will try to write the article about setup database on mysql and liferay 5.2.3 on externaltomcat 6.0

    Please visit my blog on http://www.learn4share.blogspot.com for more update and share

    Thank you

    Yan Sakhrul Hadian

    http://www.learn4share.blogspot.com/http://www.learn4share.blogspot.com/http://www.learn4share.blogspot.com/http://www.learn4share.blogspot.com/