Friday 20 January 2012

Installing and setting up Liferay on Tomcat 7

Liferay is distriuted under a LGPL licence.

Author used Tomcat 7.0.23  & Liferay 6.1.0
This is an abreviated version of a very usefull article on installing LifeRay into an existing Tomcat container. (See...)
  • Ensure Tomcat already runs and has no other webapps;
  • Install the Liferay Dependencies bundle in your Tomcat installation (See...);
    There are three JARs and they go in tomcat-x.x.x/lib/ext.If you do not have the ext directory, create one. This folder is for JARs that are loaded by the Bootstrap class loader.
  • Add " Java transaction manager " jta.jar (Available here; download class files and rename the ZIP file jta.jar.) (Software License Agreement);
  • Add mail.jar (Available here; located in root of the downloaded ZIP file.) (JavaMail License Agreement);
  • Delete all the contents in /ROOT;
  • Move the files from the .war to the now empty ROOT folder. The simplest way to do this is to open it with an archiver program such as 7zip or WinRAR, then copy/extract all of the files into ROOT. 
  • Add a file version.txt to the folder as a reminder of the version of LifeRay in use.
    ie. "liferay-portal-6.1.0-ce-ga1-20120106155615760"
  • Edit the file and add the line
    set "JAVA_OPTS=%JAVA_OPTS% -Xmx1024m -XX:MaxPermSize=256m"
    
    Somewhere near the top.;
  • Inside eclipse change the VM tomcat settings for the Sysdeo plugin.
    This is under Window-->Tomcat-->JVM Settings [Append to JVM Parameters][Add]...
    -Xmx1024m 
    -XX:MaxPermSize=256m
Which may not work at this time as there do not seem to be enough JARs in the ext folder.

OR
  • This version comes with data and a set of plugins which appear as webapps;
  • Start up Tomcat and the start up triggers a browser window titled "Basic Configuration";
  • Set the portal name;
  • Set the default language to English (UK);
  • Don't forget to set up the admin user;
  • Finish the configuration;
  • The configuration will be stored in a file called portal-setup-wizard.properties located at the same level as the tomcat server folder;
  • Click Goto my Portal and see the portal;
  • Shut down tomcat and edit the tomcat server.xml  file change "<Connector port="8080"" to "<Connector port="80"";
  • Re-start tomcat to check the new port;
  • Next we need to set up the email client.Liferay's default configuration looks for a mail server on the same machine on which Liferay's running, and it tries to send mail via SMTP to this server. If this is not your configuration, you'll need to modify Liferay's defaults. To do this, you'll use a portal-ext.properties file.
    The file that is used to override the configuration is portal-ext.properties. This file should be created in your Liferay Home folder.

No comments:

Post a Comment