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 a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781849517003
Languages :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Dec 01, 2011
Length: 396 pages
Edition :
Language : English
ISBN-13 : 9781849517003
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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.