Friday, October 10, 2014

[Liferay] [Apache] Setting up Apache as web server in front of Liferay using mod_proxy


Setting Apache as web server for Liferay front is so easy. Thanks Alpesh Sir ji for help.

Once Apache is installed, open httpd.conf and add the lines like below-


Make sure you enable mod_proxy and mod_proxy_http before starting apache.
Piece of cake. Isn't it?

Until next time.

[Liferay] Setting up Liferay 6.2 on vFabric TC Server 2.6

Sometimes, Tomcat is not enough to run Liferay- reasons may include performance, client's wish etc.

So here are the steps on how to configure Liferay instance on tc server 2.6. Same steps can be followed for liferay version below 6.2, at least for 6.1 I have verified.

We have D:\pFiles\LR\tc-instance\ directory where vFabric tc server is installed. And we will use D:\pFiles\LR\tc-instance\liferay62.local\ to install our lifeary instance.

  1. Lets download liferay from sourceforge
    - Liferay Portal 6.2 CE GA2
    Download portal war file - liferay-portal-6.2-ce-ga2xxx.war
    Download Dependencies - liferay-portal-dependencies-6.2-ce-ga2xxx.zip

  2. Unzip/Install tc server to a location of your wish. I installed to D:\pFiles\LR\tc-instance. This directory will be called TCSERVERHOME

  3. Now we need to create a instance of server lets say this name as liferay62. Use the following command.
    tcruntime-instance.bat create -i D:\pFiles\LR\tc-instance\liferay62 liferay62
    This will create a new instance for liferay62 in the  D:\pFiles\LR\tc-instance\liferay62.

  4. Now, lets install Liferay. Extract the dependencies files which we downloaded to
    D:\pFiles\LR\tc-instance\liferay62\liferay62\lib

    NOTE: You might want to know why liferay62\liferay62, In case you want to install multiple instances, you will need multiple data folders for each and similarly deploy folder. Now deploy and data folders will be created in liferay62\data and liferay62\deploy rather than tc-instance\data and tc-instance\deploy.

  5. We need some more files to be copied to lib directory. You can copy them from liferay tomcat bundle. Check the image below and copy those files as well. You need not to copy all the files for your db connector. Just add the one you want.
  6. Now we need to modify some configuration. For ex. memory configs etc.
    Modify the file
    D:\pFiles\LR\tc-instance\liferay62.local\liferay62.local\conf\wrapper.conf
    Change the following lines as per needed configuration
    Last 2 lines may not be present, so you can add them to the file.

  7. Create a directory in conf and add ROOT.xml
    D:\pFiles\LR\tc-instance\liferay62.local\liferay62.local\conf\Catalina\localhost\ROOT.xml


  8. Change common.loader and port number of your choice in catalina.properties file. Make sure you modify both base.jmx.port and bio.http.port 

    common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/lib/ext,${catalina.home}/lib/ext/*.jar

  9. Extract lifeary war file to
    D:\pFiles\LR\tc-instance\liferay62.local\liferay62.local\webapps\ROOT

  10. Starting liferay as windows service, go to D:\pFiles\LR\tc-instance\liferay62.local\liferay62.local\bin and run tcruntime-ctl.bat install

Start your liferay instance, go to D:\pFiles\LR\tc-instance\liferay62.local\liferay62.local\bin and open command prompt. tcruntime-ctl.bat start

To stop server
tcruntime-ctl.bat stop

Your liferay server should be up and running at the port you configured. 

That's all for now.