Friday, November 11, 2016

Liferay 7 Portal Installation

Liferay 7 is latest portal version from Liferay Inc. Liferay 7 we can get it in two types. Liferay 7 EE and Liferay 7 CE.

Liferay 7 EE:

Liferay 7 Enterprise Edition is paid subscription from Liferay Inc. and we can call it as Liferay Digital Experience Platform (Liferay DXP).

Liferay 7 CE:

Liferay 7 Community Edition is open source and it’s completely free.
Liferay 7 have many exciting features and lots of changes from its previous release.


The latest Liferay 7 CE release is Liferay 7 GA3

Liferay 7 Portal Installation Steps

Install Java 1.8
Download Latest Liferay 7 Portal Release
Start Liferay 7 Portal
Complete basics steps after Portal Started.

Install Java 1.8

Liferay 7 Portal compatible with JAVA 1.8 and we must install JAVA 1.8 in our machine.

Steps Install JAVA 1.8 in Windows

Download JAVA 1.8 from Oracle

The following is link to download JAVA 1.8 and based on your Operating system, you need to download relevant installation files. For windows we can download JAVA 1.8 installer .exe file.


Install JAVA 1.8 by following installation steps.

Once you downloaded the installer just double click on .exe file and follow installation steps then java 1.8 will be installed in your machine.
Once it installed then you can see Java installation directory in your system “Program Files” directory.


Set “JAVA_HOME” and “PATH” environment variables

Once java installed in our machine we need set JAVA_HOME and PATH environment variables.

Set JAVA_HOME

Go to computer properties




Click on “Advance System Settings” then you can see window popup.




Now click on “Environment Variable” button then it will open another popup window. Click on “new” button then it will alert with Variable Name and Its value. Finally click on the OK button then JAVA_HOME environment variable will be created.

Provide Following Details


Variable Name: JAVA_HOME
Variable Value : C:\Program Files\Java\jdk1.8.0_102



Note:

Java home is directory path where your java is installed and this environment variable used by java applications which are running in our machine.

Set “PATH” Environment Variable

PATH variable will be used to start java commands from anywhere from command prompt.
Follow the below navigation

ComputeràPropertiesà Advance System Settingsà Environment Variable

In the list of environment variable select PATH variable and edit then append JAVA bin path value.

PATH variable already available in the list of environment variables so we just edit the variable and need to append the java path to existed value.

We need to append the following value to the existed path value


;%JAVA_HOME%\bin;





Note:

Each path should be end with semi-colon (;) and all java commands will be available in bin directory of java home and java path should include until bin directory.

Check JAVA 1.8 Available in our machine

Open window command prompt and issue the following command then it will shows the installed JAVA version in your machine otherwise java not installed properly.


java –version


The following is screen shows JAVA 1.8 installed in the machine




Download Latest Liferay 7 Portal Release

Go to Liferay.com download page and download latest Liferay 7 Portal Bundle.


Liferay 7 Bundle consist Liferay 7 Portal and Application Server so we can download and directly start the portal.

Liferay 7 Portal bundles are available with different application servers like Tomcat, Wildfly.



Best way to start with Liferay bundle that we can download Liferay 7 Bundle with Tomcat. Now click on download button then we can download bundle zip file.



Start Liferay 7 Portal

Once downloaded the bundle zip file then extract in your desired directory then you can see the following sub-directories in the extracted zip file.




data: this directory consist of default data base that is HSQL. Liferay Portal will use HSQL database. It also consist the document library repository.



license: This directory will have information related to portal licence.

osgi : This directory will provide Liferay OSGi run time environment to the portal. Liferay 7 have used modular development framework that is OSGi.


Server Directory: This name will be changed based on the application server, we have downloaded the tomcat bundle and its name is “tomcat-8.0.32”. Liferay 7 is using Tomcat 8 version server. This is actual server where Liferay 7 was deployed.



If you look at webapps directory then we can see the directory called “ROOT” and this is actual Liferay 7 Porta that deployed in the server.



tools: this directory consist the libraries which will be useful at the time of database upgrade.


Once Liferay Portal Started we can see few more directories like deploy and logs.

deploy: This is Liferay auto deploy directory where we can place .war  .lpkg and .jar files and it will be automatically deployed into the server.

logs: This folder contains Liferay log files. This will be important when portal have issues or errors.

Liferay Home

Liferay Home is portal directory where application server and other required sub-directories are available.

The following is Liferay Home Directory (C:\MeerPrince\Liferay7\liferay-ce-portal-7.0-ga3)



Start Liferay 7 Portal

Open command prompt and navigate to the portal server bin directory that is tomcat server bin directory then issue following start up command then Liferay 7 portal will be started.


startup.bat



Once server is started it will open another Liferay 7 console window there we can see log information

The following is server console log window



Complete basic configuration steps after Portal Started.

Once portal server successfully started then it will automatically open the browser and we have to complete the basic configuration page. Once portal is started then you can see the message in server console says that sever started and minutes the took to start server.

When the first time portal is started then we have to complete the basic configuration steps and its only one time.

If portal automatically not open in the browser then use following local host to see portal page. The default port of tomcat server is 8080




The following is basic configuration page


If you would like to change the details like portal name, first name, last name and email you can fill in the form otherwise we can go with default populated details in the form.

As we know that Liferay default database is Hypersonic that we can observed in the database section. If we would like to change to other data base click on change link then it will ask database connection details. Now we are not going to change anything.

Just click on “Finish Configuration” button then it will shows you the “Terms of Use” page just click on “I Agree” button.


Once we Agree then terms of use it will navigate “password” page there we can create Portal Admin Password. Provide your desired password then click on save button.

Once we completed password creation step then it will ask your security question and it will be useful at time of password retrieval process.


Once you select the security question then provide relevant answer finally click on save button.

Now we have completed the all basic portal configuration page now we can see Liferay 7 Portal Welcome Page.

The following screen shows portal welcome page



Once we completed the basic configuration steps, in the back-end Liferay have created configuration file called “portal-setup-wizard.properties” in the Liferay Home directory.


You can find the below configuration details in the “portal-setup-wizard.properties”.


admin.email.from.address=test@liferay.com
admin.email.from.name=Test Test
liferay.home=C:/MeerPrince/Liferay7/liferay-ce-portal-7.0-ga3
setup.wizard.add.sample.data=on
setup.wizard.enabled=false


Note:

Portal Already login with Portal Administrator so that you have complete access on the portal. You should remember Admin user name and password for next time login into the portal. Usually test@liferay.com is default Admin user name.

Basic configuration steps are only one time for the first time when we start Liferay portal.

Important Points to other Operating Systems

We can follow the same steps to other Operating systems but only difference is to install java and setting environment variables like JAVA_HOME and PATH.

If it is Linux operating system then we can use ./startup.sh command in the terminal to start Liferay 7 Portal server. To see logs in the console we can use tail -f catalina.out from portal logs directory.

Author

Tuesday, November 8, 2016

Apache Felix Gogo Shell Introduction

Apache Felix GoGo Shell provides the command line interface to manage bundle in the OSGi container. We can use Gogo shell to interact with OSGi bundles and we can manage its lifecycle like install bundles, start bundles, stop bundles and uninstall bundles. Apache Felix implementing the OSGi RFC 147, which describes a standard shell for OSGi-based environments.

More information


Felix Gogo Shell implemented as three bundles and the following are three bundles which should be available in OSGi container then only we can use Apache Felix Gogo shell.


runtime - implements the core command processing functionality.

shell - provides a simple textual user interface to interact with the command processor.

command - implements a set of basic commands.



When we start Apache Felix OSGi container Gogo shell automatically started and available for use. These three bundles are alredy deployed in auto deploy directory of Apache Felix, so that as soon as Apache Felix started then Gogo shell will be available.

The following three bundles, which are available in Apache Felix “bundles” directory and its auto deployment directory for Apache Felix OSGi container.




Once we started Apache Felix then Gogo shell, it will be available as command line interface where we can use defined commands to interact with OSGi container to manage bundles.

Once you started Apache Felix then you can see “Welcome to Apache Felix Gogo” message with g! , this is Gogo shell.

We can list available bundle in the OSGi container by using lb command.

The following are few important GoGo Shell commands which we can use regularly.



felix:headers : To see available Bundle headers in OSGi container

OR

headers : To see available Bundle headers in OSGi container



The following screen shows available bundles headers in the OSGi container



felix:help : To get help related to available commands. We can see all available commands in the shell.

OR

help : To get help related to available commands. We can see all available commands in the shell.



The following screen shows the help command




felix:install : Install OSGi bundles

OR

install : Install OSGi bundles

Note:

We need to specify the bundle path to install bundle. Once bundle is installed then it will show the bundle ID.



The following screen shows the install a bundle



felix:start : This command will use to start installed bundle in the OSGi container. it means activate bundle in the OSGi container

OR

start : This command will use to start installed bundle in the OSGi container. it means activate bundle in the OSGi container.

Note:
This start command will expect the bundle ID to start the bundle. When we list the bundles, we can see Bundle IDs or when we installed the bundle then it will return the current installed bundle ID.


The following screen shows the start bundle



felix:stop : This command will stop bundle or deactivate bundle from OSGi container

OR

stop : This command will stop bundle or deactivate bundle from OSGi container.

Note:

This stop command will expect the bundle ID to stop the bundle. When we list the bundle then we can see Bundle IDs. When bundle is deactivated then it goes to resolved state it means bundle is installed but not in use.


The following screen shows stop bundle




felix:uninstall : This command uninstall the bundle from container

OR

uninstall : This command uninstall the bundle from container

Note:

We need to specify the bundle path to uninstall bundle. Once bundle is uninstalled then it will disappear from the bundles list, it means it’s not available in the OSGi container.


The following screen show uninstall bundle


Apart from above commands we can find many commands in the Gogo shell and all we can see by using help command.

Liferay 7 already deployed Apache Felix Gogo Shell bundles in the OSGi container and it will start when we start Liferay 7 portal. We can see complete details about Apache Felix Gogo Shell usage in the Liferay 7 portal in the future articles.
Author

Java Package Manager (JPM)

Java package manager is managing libraries and application regardless platform. We can easily install application and libraries with help of JPM. Jpm4j is java implementation which use the power of java so that we can write once and deploy anywhere.

We can develop java libraries and application, publish in internet then notify to JPM4J so that we can deploy from anywhere in any platform with help of Jpm4j.

Install JPM4J in windows

We have two options to install JPM4J in windows

Using JPM4J JAR File
Using JPM4J Installer

Prerequisite:

Before install JPM4J we must install Java in our machine. If not please download JAVA from oracle then install in your machine. JDK 1.7 or JDK 1.8 is recommended.

Using JPM4J JAR File

You can use following download link to download JPM4J JAR file. Once you have downloaded then we can use java jar command to start JPM4J application.


You can Place downloaded JAR file in your desired location


Open command prompt and navigate to the directory where you have placed the JAR file.

Use following command JAVA JAR command.


java -jar biz.aQute.jpm.run.jar [options] init

We can pass following parameters

-u/--user: Install in the user's home directory (e.g. ~\.jpm\windows).

-g/--global: Install in c:\JPM4J, where c: is the system drive.


We can use –g so that it will be installed in C:\JPM4J directory.
Use following installation jar command in command prompt


java -jar biz.aQute.jpm.run.jar -g init




Once we run the above command then it will be created JPM4J directory and it consisted few sub directories.


Bin directory having all the commands which we can use to install java libraries and applications.

Now navigate to bin directory using command prompt then we can use all jpm4j commands.
Use following help command to see all available commands in JPM4J


jpm help





jpm install

The above command will be used to install other artifacts like java libraries and applications.

Example:

jpm install bnd

The above command will install bnd tools in our machine.


Liferay 7 need JPM4J to install BLADE CLI to develop Liferay 7 modules and applications. We will going through more details about BLADE CLI in the next articles.

The following command will install "BLADE CLI"


jpm install com.liferay.blade.cli


Setting PATH Environment variable for JPM4J

In the above case to run JPM4J commands we need to navigate JPM4J bin directory then have to use available commands.

To use these commands from anywhere from commands prompt then we have to set PATH environment variable for JPM4J bin directory.

Go to system properties


Click on Advanced System Setting then it will open window pop-up where we need to click on Environment Variables



Now select path variable and click on edit then add following JPM4J bin path at end of the string. Finally click on OK then JPM4J path will set as environment variable.


;C:\JPM4J\bin;



Once we completed the above steps, now we can run commands from anywhere and we don’t need to navigate to bin directory from command prompt.



Using JPM4J Installer

JPM4J is available as windows installer so that we can simply download and install .exe file as we generally doing in windows.

The following is Install Download link


Once you download installer just double click on file then follows steps to complete the installation. Once installation successful then it will create JPM4J directory. We need to set PATH environment variable for JPM4J then we can use all available commands from command prompt.

Reference Links

Author

Recent Posts

Recent Posts Widget

Popular Posts