Liferay Portal-Installation and Configuration
Liferay Portal-Installation and Configuration
Configuration
Liferay Portal-Installation and Configuration
Table of Contents
1. Application Servers .................................................................................................................. 1
Geronimo 1.1 with Tomcat ................................................................................................... 1
JBoss 4.04 with Jetty ........................................................................................................... 2
JBoss 4.04 with Tomcat ....................................................................................................... 5
Jetty 5.1.1 .......................................................................................................................... 8
Tomcat 5.5.17 .................................................................................................................. 10
Resin 3.0.19 ..................................................................................................................... 13
Websphere 6.0.2.5 ............................................................................................................. 14
Installation ............................................................................................................... 14
Set Up Database Service ............................................................................................. 15
Mail Configuration .................................................................................................... 19
Install Liferay ........................................................................................................... 23
Start Liferay Portal .................................................................................................... 28
2. Special Cases ........................................................................................................................ 30
Using Oracle 9 and 10 Database ........................................................................................... 30
iv
List of Tables
1.1. ......................................................................................................................................... 18
v
Chapter 1. Application Servers
This document is the expert installation and configuration guide to install Liferay Portal 4.x on top of supported ap-
plication servers. For easy installation with Liferay bundled with an application server, please refer to Chapter 1:
Getting Started [http://content.liferay.com/4.0.0/docs/quickstart/ch01.html] of the Quick Start Guide. Please note
that this documentation will be using MySQL as the database. To use other databases, please subsitute that database
JDBC driver and configure accordingly. Consult the Database section of the developers guide or your Database Ad-
ministrator for more details.
6. Populate your database with the portal schema and default data.
7. Edit $GERONIMO_HOME\bin\geronimo.bat
• Group: Liferay
• Artifact: Portal-kernel
• Type: Jar
• Click Install???
1
Application Servers
• Click Next
• Click Next
• DB Password: <none>
• Host: localhost
• Database: lportal
• Click Next
• Click Deploy
• Click Install
• Uninstall geronimo/welcome-tomcat/1.1/car
• Start -default/liferayportal/xxxxxxx.../war
13. Open your browser to http://localhost:8080. Click on My Liferay at the upper right hand corner to enter the lo-
gin screen. Your login is [email protected] and your password is test.
2
Application Servers
5. Edit $JBOSS_HOME/server/default/conf/jboss-service.xml:
7. Remove $JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar.
8. Remove $JBOSS_HOME/server/default/deploy/management.
<?xml version="1.0"?>
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/LiferayPool</jndi-name>
<connection-url>
jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8
</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name></user-name>
<password></password>
<min-pool-size>0</min-pool-size>
</local-tx-datasource>
</datasources>
11. Populate your database with the portal schema and default data.
12. Download portlet.jar and portal-kernel.jar from liferay Portal 4.1.0 Dependencies
[http://www.liferay.com/web/guest/downloads].
a. Copy to $JBOSS_HOME/server/default/lib/ext.
<?xml version="1.0"?>
<server>
<mbean code="org.jboss.mail.MailService"
name="jboss:service=MailSession">
<attribute name="JNDIName">mail/MailSession</attribute>
<attribute name="User">nobody</attribute>
<attribute name="Password">password</attribute>
<attribute name="Configuration">
<configuration>
3
Application Servers
<property name="mail.store.protocol"
value="imap" />
<property name="mail.transport.protocol"
value="smtp" />
<property name="mail.imap.host"
value="localhost" />
<property name="mail.pop3.host"
value="localhost" />
<property name="mail.smtp.host"
value="localhost" />
</configuration>
</attribute>
</mbean>
</server>
c. Go to JBOSS_HOME/server/default/deploy/liferay-portal.ear/lib
<attribute name="Debug">false</attribute>
17. In $JBOSS/server/default/deploy/jbossws14.sar/META-INF/jboss-service.xml
line 36-40
<!--<mbean name="jboss.ws:service=WebServiceDeployerJSE"
code="org.jboss.ws.server.WebServiceDeployerJSE">
<depends-list optional-attribute-name="Interceptables">
<depends-list-element>jboss.web:service=WebServer</depends-list-element>
4
Application Servers
</depends-list>
</mbean>-->
lines 45-49
<!--<mbean name="jboss.ws:service=WebServiceDeployerEJB21"
code="org.jboss.ws.server.WebServiceDeployerEJB21">
<depends-list optional-attribute-name="Interceptables">
<depends-list-element>jboss.ejb:service=EJBDeployer</depends-list-element>
</depends-list>
</mbean>-->
lines 72-75
<!--<mbean name="jboss.ws:service=WebServiceDeployerNestedJSE"
code="org.jboss.ws.server.WebServiceDeployerNestedJSE">
<depends optional-attribute-name="MainDeployer"
proxy-type="attribute">jboss.system:service=MainDeployer</depends>
<depends>jboss.ws:service=WebServiceDeployerJSE</depends>
</mbean>-->
<?xml version="1.0"?>
<server>
</server>
19. Start JBoss. Open your browser to http://localhost:8080. Click on My Liferay at the upper right hand corner to
enter the login screen. Your login is [email protected] and your password is test.
5. Edit $JBOSS_HOME/server/default/conf/jboss-service.xml:
6. Delete $JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/ROOT.war.
7. Edit $JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/conf/web.xml:
5
Application Servers
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
with:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>input</param-name>
<param-value>4096</param-value>
</init-param>
<init-param>
<param-name>output</param-name>
<param-value>4096</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<datasources>
<local-tx-datasource>
<jndi-name>jdbc/LiferayPool</jndi-name>
<connection-url>
jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8
</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name></user-name>
<password></password>
<min-pool-size>0</min-pool-size>
</local-tx-datasource>
</datasources>
6
Application Servers
10. Populate your database with the portal schema and defult data.
11. Download portlet.jar and portal-kernel.jar from liferay Portal 4.x Dependencies
[http://www.liferay.com/web/guest/downloads].
a. Copy to $JBOSS_HOME/server/default/lib/ext.
<?xml version="1.0"?>
<server>
<mbean code="org.jboss.mail.MailService"
name="jboss:service=MailSession">
<attribute name="JNDIName">mail/MailSession</attribute>
<attribute name="User">nobody</attribute>
<attribute name="Password">password</attribute>
<attribute name="Configuration">
<configuration>
<property name="mail.store.protocol"
value="imap" />
<property name="mail.transport.protocol"
value="smtp" />
<property name="mail.imap.host"
value="localhost" />
<property name="mail.pop3.host"
value="localhost" />
<property name="mail.smtp.host"
value="localhost" />
</configuration>
</attribute>
</mbean>
</server>
c. go into $JBOSS_HOME/server/default/deploy/liferay-portal.ear/lib
7
Application Servers
<attribute name="Debug">false</attribute>
<?xml version="1.0"?>
<server>
</server>
17. Start JBoss. Open your browser to http://localhost:8080. Click on My Liferay at the upper right hand corner to
enter the login screen. Your login is [email protected] and your password is test.
Jetty 5.1.1
1. Download and install JDK 1.4 or 1.5 [http://java.sun.com/javaee/]. Set an environment variable called
%JAVA_HOME% to point to your JDK directory.
3. Download and install Jetty 5.1.11 [http://jetty.mortbay.org/jetty/index.html]. Note: Only this version of Jetty is
supported by Liferay. Others may work but will not be covered in this documentation. From now on the home
directory where you installed Jetty will be called $JETTY_HOME.
a. Create a $JETTY_HOME/lib/ext directory and copy these two files there. If the files do not extract to this
directory, make sure they are in the correct directory by moving them there.
6. Populate your database with the portal schema and default data.
7. Edit $JETTY_HOME/extra/etc/start-plus.config.
$(jetty.home)/lib/ext/
8
Application Servers
$(jetty.home)/lib/ext/*
<Call name="addService">
<Arg>
<New class="org.mortbay.jetty.plus.JotmService">
<Set name="Name">TransactionMgr</Set>
<Call name="addDataSource">
<Arg>jdbc/LiferayPool</Arg>
<Arg>
<New
class="org.enhydra.jdbc.standard.StandardXADataSource">
<Set name="DriverName">com.mysql.jdbc.Driver</Set>
<Set
name="Url">jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8</
<Set name="User"></Set>
<Set name="Password"></Set>
</New>
</Arg>
<Arg>
<New
class="org.enhydra.jdbc.pool.StandardXAPoolDataSource">
<Arg type="Integer">4</Arg>
<Set name="MinSize">4</Set>
<Set name="MaxSize">15</Set>
</New>
</Arg>
</Call>
</New>
</Arg>
</Call>
<Call name="addService">
<Arg>
<New
class="org.mortbay.jetty.plus.MailService">
<Set name="Name">MailService</Set>
<Set name="JNDI">mail/MailSession</Set>
<Put
name="mail.smtp.host">localhost</Put>
</New>
</Arg>
</Call>
PortalRealm {
com.liferay.portal.kernel.security.jaas.PortalLoginModule
required;
};
9
Application Servers
b. Create run.bat (Note, this is for Windows platform. For other platforms, configure accordingly)
@echo off
if "" == "%JAVA_HOME%" goto errorJavaHome
%JAVA_HOME%/bin/java -Xmx512m -Dfile.encoding=UTF8 -Duser.timezone=GMT
-Djava.security.auth.login.config=../etc/jaas.config
-DSTART=../extra/etc/start-plus.config -jar ../start.jar ../etc/jetty.xml
goto end
:errorJavaHome
echo JAVA_HOME not defined.
goto end
:end
Note: If you get a java.lang.OutOfMemoryError exception while starting up Jetty, give your JVM more
memory by setting -Xmx512m.
16. Start Liferay by running run.bat. Open your browser to http://localhost:8080. Click on My Liferay at the upper
right hand corner to enter the login screen. Your login is [email protected] and your password is test.
Tomcat 5.5.17
1. Download and install Tomcat 5.5.17 [http://tomcat.apache.org/] into your preferred directory. From now on, the
directory where you installed Tomcat will be referred to as $TOMCAT_HOME.
Note: If you are using JDK 1.4, you must download and install the JDK 1.4 Compatability Package at tom-
cat.apache. For JDK 1.4 users: delete
$TOMCAT_HOME/webapps/ROOT/WEB-INF/lib/xercesImpl.jar. For JDK 5 users: move
$TOMCAT_HOME/webapps/ROOT/WEB-INF/lib/xercesImpl.jar to TOM-
CAT_HOME/common/endorsed.
10
Application Servers
<Context path="">
</Context>
a. Create a $TOMCAT_HOME/common/lib/ext directory and copy these two files there. If the files do
not extract to this directory, make sure they are in the correct directory by moving them there.
7. Edit $TOMCAT_HOME/conf/catalina.properties.
common.loader=
${catalina.home}/common/classes,\
...\
${catalina.home}/common/lib/ext/*.jar
8. Configure data sources for your database. Make sure the JDBC driver for your database is accessible by Tom-
cat.
b. Copy to $TOMCAT_HOME/common/lib/ext.
9. Edit $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml.
<Context...>
<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=""
password=""
maxActive="100"
maxIdle="30"
maxWait="10000"
/>
</Context>
10. Populate your database with the portal schema and default data.
<Context...>
11
Application Servers
<Resource
name="mail/MailSession"
auth="Container"
type="javax.mail.Session"
mail.transport.protocol="smtp"
mail.smtp.host="localhost"
/>
</Context>
<Context...>
<Realm
className="org.apache.catalina.realm.JAASRealm"
appName="PortalRealm"
userClassNames="com.liferay.portal.security.jaas.PortalPrincipal"
roleClassNames="com.liferay.portal.security.jaas.PortalRole"
debug="99"
useContextClassLoader="false"
/>
</Context>
PortalRealm {
com.liferay.portal.kernel.security.jaas.PortalLoginModule
required;
};
15. Edit $TOMCAT_HOME/bin/catalina.bat so that Tomcat can reference the login module.
19. Run Tomcat, point browser to http://localhost:8080. Sign in as [email protected] and password test
12
Application Servers
Resin 3.0.19
1. Download and install Resin [http://www.caucho.com/] into your preferred directory. From now on, the direct-
ory where you installed Resin will be referred to as $JBOSS_HOME.
4. Edit $RESIN_HOME/conf/resin.conf.
<class-loader>
<tree-loader path="${resin.home}/lib"/>
<tree-loader path="${server.root}/lib"/>
</class-loader>
with
<class-loader>
<tree-loader path="${resin.home}/lib"/>
<tree-loader path="${server.root}/lib"/>
<compiling-loader path="${server.rootDir}/common/classes"/>
<library-loader path="${server.rootDir}/common/lib"/>
</class-loader>
add:
<database>
<jndi-name>jdbc/LiferayPool</jndi-name>
<driver type="com.mysql.jdbc.Driver">
<url>jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8</url>
<user></user>
<password></password>
</driver>
<prepared-statement-cache-size>8</prepared-statement-cache-size>
<max-connections>20</max-connections>
<max-idle-time>30s</max-idle-time>
</database>
<resource jndi-name="mail/MailSession" type="javax.mail.Session">
<init>
<mail.store.protocol>imap</mail.store.protocol>
<mail.transport.protocol>smtp</mail.transport.protocol>
<mail.imap.host>localhost</mail.imap.host>
<mail.pop3.host>localhost</mail.pop3.host>
<mail.smtp.host>localhost</mail.smtp.host>
</init>
</resource>
<system-property
javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactory
/>
<system-property
javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"
/>
<system-property
13
Application Servers
javax.xml.transform.TransformerFactory="org.apache.xalan.processor.TransformerFactoryIm
/>
<system-property
org.xml.sax.driver="org.apache.xerces.parsers.SAXParser" />
6. Populate your database with the portal schema and default data.
12. Start Resin. Open your browser to http://localhost:8080. Click on My Liferay at the upper right hand corner to
enter the login screen. Your login is [email protected] and your password is test.
Websphere 6.0.2.5
Note: Throughout this installation and configuration process, Websphere will prompt you to Click Save to apply
changes to Master Configuration. Do so intermittently to save your changes.
Installation
1. Download Liferay Portal Professional 4.1.0 WAR , unzip and compile.
3. Install MySql.
14
Application Servers
• portal-ear\mysql-connector-java-3.x.x-bin.jar (MySQL
[http://dev.mysql.com/downloads/connector/j/3.1.html])
4. Click Next.
15
Application Servers
8. Click OK.
16
Application Servers
17. Create 3 custom properties by entering Name, Value and clicking OK for each row on this table.
17
Application Servers
Table 1.1.
name value
1. user root
2. serverName localhost
3. databaseName lportal
18. When done correctly, custom properties should look like this:
18
Application Servers
19. Download Liferay Portal 4.1.0 SQL Scripts [http://www.liferay.com/web/guest/downloads] and extract cre-
ate-mysql.sql.
20. In command prompt, run mysql script by entering mysql < trunk\sql\create\create-mysql.sql
Mail Configuration
1. Click Resources, Mail providers.
4. Click New.
a. Name: liferaymail
19
Application Servers
5. Click OK.
6. Click Security.
20
Application Servers
21
Application Servers
19. Enter Insert into User_ (companyId, userId, password_) values ('system',
'system', 'password');
22
Application Servers
Install Liferay
1. Click Applications, click Install new applications
4. Click Next
23
Application Servers
5. Select Generate Default Bindings>Override default bindings>Use default viral host name for web mod-
ules:
6. Click Next. Click Continue. For Steps 1 to 4, click Next to apply defaults.
24
Application Servers
25
Application Servers
8. Click Next.
26
Application Servers
9. Click Finish.
27
Application Servers
11. Save this configuration to master configuration by clicking on System administration and Save Changes to
Master Repository.
28
Application Servers
2. Open up browser and point to http://localhost:9080. Liferay portal home page should be seen.
3. Edit your Stop the Server shortcut to set the user id and password. If you don't do this, you will not be able to
stop the server after you restart WebSphere: "C:\Program
Files\WebSphere\AppServer\bin\stopServer.bat" server1 -user system -
password password
4. Stop Websphere and retart it. Login on with 'system' for username and 'password' for password.
29
Chapter 2. Special Cases
Using Oracle 9 and 10 Database
For Oracle 9 and 10 use jdbc driver ojdbc14.jar
[http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html]
hibernate.jdbc.batch_size=0
30