Thursday, May 13, 2010

Liferay-5.2.3 setup

Hello All,
I am also new to Liferay5.2.3, started some days before. While Installing Liferay I faced so many issues.

Here is the output of that one
We can install liferay in three ways,
a . Using Liferay with bundle
b. Using deploying src/ext
c. Using war file

I worked on all the above three

a. Using Liferay with bundle
no need of any configuration. only download the Liferay from the below mentioned link and unzip it

b. Using Source


  1. Download the liferay-portal-src-5.2.3 from the below link

http://www.liferay.com/downloads/liferay-portal/additional-files/ under Files for Developers section (at the end) download “Liferay Portal 5.2.3 Source”

  1. Download Tomcat-6.0.20 – zip format

  2. Download Mysql.5.0 and install

  3. Make sure ANT_HOME is defined in the Environment variables.

  4. unzip the Tomcat-6.0.20 to the location in your local dirve.

Ex: D:\SVN_INTEGRAL\tomcat6_withoutbundle

  1. unzip the Liferay-source to the location in your local dirve.

Ex: D:\SVN_INTEGRAL\liferay-portal-src-5.2.3

  1. copy the app.server.properties as app.server.{username}.properties (keep the original file as it is) username – System login name

Ex: app.server.abc.properties

  1. In app.server.{username}.properties set the TOMCAT_HOME path for the following variable app.server.tomcat.dir

Ex: app.server.tomcat.dir=D:/SVN_INTEGRAL/tomcat6_withoutbundle

  1. in command prompt, Go to liferay_soruce location where you have unzipped. And provide the following command

ant clean

ant start

ant deploy


Ex: D:\SVN_INTEGRAL\liferay-portal-src-5.2.3> ant clean

  1. Make sure that you can see the following dir in /webapps/tunnel-web and /webapps/ROOT/ dtd, errors, html, layouttpl and wap

  2. Copy the web.xml file from /portal-web/docroot/WEB-INF/web.xml to /webapps/ROOT/WEB-INF dir

  3. Create a file portal-ext.properties and add the below lines: (This file is used to override the properties defined in portal.properties file which is existing in portal-impl.jar)

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

  1. place the portal-ext.properties file in the \webapps\ROOT\WEB-INF\classes folder

  2. run the sql script from the location /sql/create/create-mysql.sql

  3. make sure that “lportal” database is present.

  4. Create a New File “setenv.bat” under the directory /bin

and add the below line.


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


Randomly you may get “Out of memory error”

The above piece of code is to ensure that you wont get “Out of memory error”.


  1. start tomcat server

  2. Check for the URL: http://localhost:8080/web/guest



c. Using war

  1. Download and install Tomcat 6 and above to your preferred directory. From now on, the directory where you installed Tomcat will be referred to as $TOMCAT_HOME.


  1. Download and install JDK 6 update 18 . Set an environment variable called %JAVA_HOME% (in Windows) or $JAVA_HOME (in Linux/UNIX) to point to your JDK directory.


  1. Download following files from the below link

http://www.liferay.com/downloads/liferay-portal/additional-files/

Liferay Portal 5.2.3 WAR

tunnel-web.war

Liferay Portal 5.2.3 Dependencies


  1. Create and edit $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml to set up the portal web application. Add the below lines and configure data sources for your database

className="org.apache.catalina.realm.JAASRealm"

appName="PortalRealm"

userClassNames="com.liferay.portal.kernel.security.jaas.PortalPrincipal"

roleClassNames="com.liferay.portal.kernel.security.jaas.PortalRole"

/>

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=""

password=""

maxActive="100"

maxIdle="30"

maxWait="10000"

/>

name="mail/MailSession"

auth="Container"

type="javax.mail.Session"

mail.transport.protocol="smtp"

mail.smtp.host="localhost"

mail.store.protocol="imap"

mail.imap.host="localhost"

/>


  1. Edit $TOMCAT_HOME/conf/catalina.properties.

common.loader=

${catalina.home}/common/classes,\

...\

${catalina.home}/lib/ext/*.jar

  1. Obtain the JDBC driver for your version of the database server. In the case of MySQL use mysql-connector-java-{$version}-bin.jar. And copy in the below location

$TOMCAT_HOME/lib/ext.

  1. To add support for accessing Liferay's services remotely and to access the document library using WebDAV follow these steps:

Create a dir tunnel-web in $TOMCAT_HOME/webapps folder

Unzip the tunnel-web.war file in $TOMCAT_HOME/webapps/tunnel-web folder

  1. Create a copy of ROOT.xml (Created in step 4) rename as tunnel-web.xml

  2. Create $TOMCAT_HOME/conf/jaas.config.

PortalRealm {

com.liferay.portal.kernel.security.jaas.PortalLoginModule required;

};

  1. Create a New File “setenv.bat” under the directory /bin

and add the below line.

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

  1. Delete contents $TOMCAT_HOME/webapps/ROOT directory

  2. Ensure below two jars are there in $TOMCAT_HOME/lib/ext folder. If not download from the respective sites

jta.jar

mail.jar

  1. Unpack liferay-portal-5.2.3.war to $TOMCAT_HOME/webapps/ROOT.

  2. In in the file $TOMCAT_HOME\webapps\ROOT\WEB-INF\classes\portal-ext.properties, copy the below lines to configure MySQL DB


jdbc.default.driverClassName=com.mysql.jdbc.Driver

jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false

jdbc.default.username=

jdbc.default.password=


  1. Make sure your database server is installed and is working. Create a database for Liferay. If the DB configured then Liferay will automatically create the tables and populate it the first time it starts.

  2. Run Tomcat, point browser to http://localhost:8080. Sign in as test@liferay.com and password test



Link:

http://www.liferay.com/downloads/liferay-portal/additional-files/


Hope this will help people.