Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Liferay Beginner's Guide
Liferay Beginner's Guide

Liferay Beginner's Guide: Quick and easy techniques to build, deploy, and maintain your own Liferay portal with this book and ebook

eBook
€25.99 €28.99
Paperback
€37.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Liferay Beginner's Guide

Chapter 2. Installing a Liferay Portal Instance

In the first chapter we learned what Liferay is all about and how it caters to various needs across domains. In this chapter we will see how to install Liferay in different servers.

With any web application, one of the major pain points is how to install the application in various servers. Many a time it happens that to just start-up the application, we spend lots of days' worth effort.

Luckily for us Liferay has provided bundles for various open source servlet containers and application servers and you would see how easy it is to start up Liferay on any of these servers.

By the end of this chapter, we will learn how to start up Liferay on the following servers:

  • Apache Tomcat

  • JBoss Application Server

  • GlassFish

  • Oracle WebLogic

We will see how to deploy Liferay in an existing Tomcat server.

Also, we will learn how to change the default database of Liferay from Hypersonic to MySQL.

Looking above it seems like an uphill task. So go grab a cup of coffee so...

Getting started


Before we start, please see that you already have the following:

  • Download the latest JDK and create an environment variable named JAVA_HOME and set the path to the JDK (you should have done this in the previous chapter).

Liferay with Apache Tomcat


Apache Tomcat is an open source servlet container which is developed by the Apache Software Foundation. We will be using Tomcat server for the rest of our chapters.

Time for action – deploying on Tomcat


To start with, you will need to download the latest community version of the Liferay Tomcat bundle from the download page of Liferay (http://www.liferay.com/downloads/liferay-portal/available-releases). At the time of writing, the latest Liferay bundle that is available is Liferay 6.0.6. Next, follow these steps to configure Tomcat with Liferay:

  1. Extract the zip file that you downloaded to the folder called bundles.

  2. We will call the extracted folder LIFERAY_HOME.

  3. There will be a tomcat folder inside LIFERAY_HOME which we will refer to as TOMCAT_HOME.

  4. Navigate to TOMCAT_HOME/bin and double-click on startup.bat.

  5. Your server should start up properly and you should see the console as shown in the following screenshot:

  6. Open a browser and type http://localhost:8080; this will open the Liferay home page.

What just happened?

We have got Liferay up and running in Tomcat. We will be using this configuration for the rest of the chapters.

Now, we will see how to deploy Liferay...

Liferay with JBoss Application Server


JBoss Application Server is a Java EE-based, free, and open source application server.

Time for action – deploying on JBoss AS


You can get the latest community version of the Liferay JBoss bundle from the download page of Liferay: (http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-portal-jboss-6.0.6-20110225.zip/download).

Next follow these steps to start up JBoss Application server with Liferay:

  1. Extract the zip file that you downloaded to the folder called bundles (which we created for the last exercise).

  2. We will call the extracted folder LIFERAY_HOME.

  3. There will be a jboss folder inside LIFERAY_HOME, which we will refer to as JBOSS_HOME:

  4. Navigate to JBOSS_HOME/bin and double-click on run.bat.

  5. Your server should start up properly and you should see the console as shown in the following screenshot:

  6. Open a browser and type http://localhost:8080 and this will open the Liferay home page.

What just happened?

We have deployed Liferay with JBoss Application server.

Now we will install Liferay with GlassFish Application server.

Liferay with GlassFish


GlassFish is an open source application server for Java EE platform.

Time for action – deploying in GlassFish


You can get the latest community version Liferay GlassFish bundle from the download page of Liferay (http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-portal-glassfish-6.0.6-20110225.zip/download).

Next follow these steps to deploy Liferay with Glassfish:

  1. Extract the zip file that you downloaded to the bundles folder (created earlier).

  2. We will call the extracted folder LIFERAY_HOME.

  3. There will be a tomcat folder inside LIFERAY_HOME, which we will refer to as GLASSFISH_HOME:

  4. By default, when we install GlassFish, a default domain named domain1 is created. Our Liferay is inside this domain.

  5. So to start Liferay, navigate to GLASSFISH_HOME/bin from a command prompt.

  6. Issue the command asadmin start-domain domain1.

  7. Wait for the domain to start. After the domain is started, it takes some time to deploy the application for the first time.

  8. You can check the log at GLASSFISH_HOME/domains/domain1/logs/server.log.

  9. You can also navigate to the...

Liferay with Oracle WebLogic


Oracle WebLogic is a proprietary application server for building and deploying enterprise Java EE applications.

Time for action – configuring Weblogic


You can get the latest version of Oracle WebLogic from their download section: http://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html.

We are going to use WebLogic 10.3.4 for Windows in this particular exercise. Besides that, since we don't have any bundle for Oracle WebLogic, we would need to download the standalone Liferay Portal war and the dependencies jar that are required for starting up Liferay. You can download the standalone war and dependencies from the following locations:

http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-portal-6.0.6-20110225.war/download.

http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-portal-dependencies-6.0.6-20110225.zip/download.

Since here we don't have a bundle, we will see how to install Liferay from scratch in a plain vanilla Weblogic server. So the configuration steps can be divided into two as follows:

  • Configuring Oracle WebLogic

  • Deploying Liferay...

Configuring Oracle WebLogic


Follow these steps to configure Oracle WebLogic:

  1. Double-click the executable file you downloaded for Oracle WebLogic. You will be presented with the following screen:

  2. Click on Next and when it asks you for a path, select the option Create a new Middleware home and then provide the location where you want to install the server. We will refer to this as WEBLOGIC_HOME.

  3. Click on Next until it shows you the screen where you see the installation progress as follows:

  4. Once Weblogic is done with the installation it will show the following screen, with the option checked to Run Quickstart. Quickstart is a one stop point for creating new domains and upgrading domains from the previous version. It also provides online documentation to get started with.

What just happened?

We have installed WebLogic. Now we will see how to deploy Liferay on WebLogic.

Deploying Liferay on WebLogic


In this section, we will go through the steps needed to deploy Liferay on WebLogic:

  1. Continuing from where we left off, when we click on the Done button, we are presented with the QUICKSTART screen as I mentioned earlier.

  2. Let us create a domain for Liferay. Click on Getting started with WebLogic server . This will bring up a screen with two options for creating a new WebLogic domain or extending an existing WebLogic domain. Select the option to create a new WebLogic domain and click on Next:

  3. Provide the name of the domain. It would be good if we name it Liferay. Also, you will have to provide the location of the domain. This is where our Liferay would go. So we would call this DOMAINS_HOME for future reference.

  4. When you click Next it will give you an option to set the name and password for the administrator user. Provide the credentials you would like to have and click on the Next button:

  5. This will bring you a screen from which you can select the mode as well...

Liferay on existing Tomcat


In the beginning of this chapter, we saw how easy it was to run Liferay with Liferay Tomcat Bundle. However, most of the production environments will need to have Liferay in existing Tomcat. Before moving on, please download the following files that are required for our exercise:

Tomcat 6: http://apache.mirrors.timporter.net/tomcat/tomcat-6/v6.0.33/bin/apache-tomcat-6.0.33.exe.

Liferay Portal WAR: http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-portal-6.0.6-20110225.war/download.

Liferay Portal Dependencies: http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-portal-dependencies-6.0.6-20110225.zip/download.

Time for action – deploying Liferay


Next, follow these steps to configure Liferay with Tomcat:

  1. Create a folder called Liferay, which we will refer to as LIFERAY_HOME from now on.

  2. Extract the Tomcat zip file you have downloaded earlier to LIFERAY_HOME. You should see a folder named apache-tomcat-6.0.33 inside LIFERAY_HOME. From now on this folder will be referred to as TOMCAT_HOME.

  3. Create a folder called ext inside TOMCAT_HOME/lib. Extract the Portal Dependencies jars zip that you downloaded earlier to this ext folder.

  4. Copy the jars like mysql.jar, jta.jar, and mail.jar inside the TOMCAT_HOME/lib folder, which has been provided to you in the code folder of this chapter.

  5. Create a file called ROOT.xml inside TOMCAT_HOME/conf/Catalina/localhost. Add the following content inside ROOT.xml:

    <Context path=””>
    </Context>
    
  6. Open the file TOMCAT_HOME/conf/catalina.properties and find a property called common.loader. Append ${catalina.home}/lib/ext/*.jar at the end as follows:

    common.loader=${catalina...

Database configuration


Liferay ships with Hypersonic database, by default. Now this is fine, as long as you are using it for a demo. However, for the production environment, it is not advisable to use Hypersonic. In this section, we will see how to configure Liferay to use the MySQL database. MySQL is an open source RDBMS which is used widely in production environments.

Time for action – creating the database


MySQL from the following URL: http://dev.mysql.com/downloads/mysql/5.1.html. Let us first install MySQL:

  1. Double-click on the installable file that you just downloaded, which will show the following screen:

  2. Click on the Next button and accept the terms of use and again click Next, which will bring up a screen as shown in the following screenshot to select the type of setup:

  3. Select the radio button next to Complete, again click on Next, and then click on Install, as shown in the following screenshot:

  4. This will start the installation of MySQL and after it is done it will show a couple of screens on which you have to click Next again:

  5. Once installed, it will bring up the following screen, which will ask for configuring MySQL server:

  6. Make sure you have ticked the checkbox against Configure the MySQL Server Now and then click on Finish, which will show up the starting screen. Click on the Next button to reach the following screen:

  7. Select Detailed Configuration...

Time for action – changing the file


So first create a property file called portal-ext.properties, within the LIFERAY_HOME directory and add the following properties into it:

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

jdbc.default.url=jdbc:mysql://localhost/neighbourhood_portal?useUnicode=true&characterEncoding=UTF8&useFastDateParsing=false

jdbc.default.username={your_username}

jdbc.default.password={your_password}

Replace {your_username} and {your_password} with your actual credentials for MySQL.

Note

Downloading the example code for this book

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

What just happened?

Restart your server and Liferay will now be using MySQL instead of Hypersonic database.

For Oracle WebLogic, place the portal-ext.properties in WEBLOGIC_HOME...

Summary


In this chapter, we have seen how Liferay Portal can be installed on various servers:

  • Liferay comes pre-bundled with many open source application servers and servlet containers such as Tomcat, JBoss, and GlassFish

  • Liferay can also be installed on a proprietary server like Oracle Weblogic

  • We also saw how to deploy Liferay on an existing Tomcat server

  • The default Liferay bundle ships with a Hypersonic database, which is not recommended for production use

  • Liferay is database agnostic and can support many databases such as Oracle, SQL Server, MySQL, and so on

Though we have seen how to install Liferay in most of the application servers and servlet containers, we will be using Tomcat as our web server for the rest of the exercise.

So you're all set with Liferay up and running on your Tomcat, and it's time to get started with some Portal Basics and changing the whole look and feel of your portal with themes in Liferay.

Left arrow icon Right arrow icon

What you will learn

  • Set up and run Liferay portal in an application server of your choice and configure with MySQL Database Apply a theme to portal pages and change their layouts Create communities, organizations and User groups Add users, create portal pages and apply permissions Create web content and publish content on portal pages Build community pages using out of box and custom portlets Set up social collaboration applications in the portal Configure and run an online store

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 01, 2011
Length: 396 pages
Edition :
Language : English
ISBN-13 : 9781849517010
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 01, 2011
Length: 396 pages
Edition :
Language : English
ISBN-13 : 9781849517010
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 86.98
Liferay Beginner's Guide
€37.99
Liferay Portal Systems Development
€48.99
Total 86.98 Stars icon

Table of Contents

10 Chapters
Planning Your Portal Chevron down icon Chevron up icon
Installing a Liferay Portal Instance Chevron down icon Chevron up icon
Understanding Portal Basics and Theming Chevron down icon Chevron up icon
Tips and Tricks-Advanced Configuration Chevron down icon Chevron up icon
Building your First Liferay Site Chevron down icon Chevron up icon
Managing Pages, Users, and Permissions Chevron down icon Chevron up icon
Creating and Publishing Content Chevron down icon Chevron up icon
Exploring Communities Chevron down icon Chevron up icon
Setting up an Online Shop Chevron down icon Chevron up icon
Liferay Server Administration Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.8
(5 Ratings)
5 star 20%
4 star 40%
3 star 40%
2 star 0%
1 star 0%
Marc-Andre Rost Oct 02, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
das buchcover stellt den wahrheitsgemäßen inhalt dar. es ist ein buch für den absoluten anfänger, schnell merkt man aber das man mehr informationen zu diesem thema benötigt
Amazon Verified review Amazon
B. Carson Apr 11, 2012
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I've been working with Liferay 6.1 for about 3 months now and bought this book in the hopes that it would help me understand how to better administer our company's new Liferay portal. While not perfect, it has DEFINITELY helped to fill in many of the knowledge gaps I have in my self-directed learning. I wouldn't let the fact that this book is designed for 6.0 throw off anyone that is working on 6.1. The biggest relevant changes are the placement of some of the icon and menu options and Liferay now uses the word 'Site' instead of 'Community'.Given that I've been working with the portal for a few months, I was able to follow along with the book from cover-to-cover without much issue.I did skip some chapters, mostly the server install & setup chapters in the beginning(already done that), and the shopping portlet & social networking chapters that appear in the end(don't need those features).The chapter on users and permissions was very helpful. I have a much better understanding of how I need to organize our users within our portal.The main criticism I have about this book would be Chapter 7. Kind of an important chapter (Creating and Publishing Content) and whomever wrote was not really in sync with the other authors. It references pages, files, and images that haven't been created. Additionally, there are no files for this chapter in the supplementary book download from packtpub.com either. I couldn't create the content the author intended even if I tried to guess what he/she meant.The rest of the book is readable and should be able to be easily followed by anyone familiar with Liferay 6.0 or 6.1.In summation, good book for liferay 6.x beginner, but buy it at the Kindle price.
Amazon Verified review Amazon
PETER J TOWNSEND Nov 30, 2012
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
As a newcomer to Liferay I am finding this book useful in familiarizing me with the platforms features and capabilities. Would recommend it.
Amazon Verified review Amazon
Ranx0r0x Feb 17, 2012
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
This book isn't bad, per se, and it is fairly clear to read. The problem is that it covers the 6.0 version and not the 6.1 version. That isn't as minor a difference as a "dot" release number would indicate. There are some significant shuffling around of structures between the two versions. Really, the 6.1 version should be the 7.0 version
Amazon Verified review Amazon
Amazon Customer May 02, 2017
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
Some practical scenario not mentioned properly
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.