Saturday 28 April 2012

Running Liferay 6.1 CE on Non Root Context

By default Liferay 6.1 CE runs on root context after installation. Sometimes this may not be possible. Assuming that we would like Liferay 6.1 CE to work as http://<hostname>/myportal instead of http://<hostname>/, just make the following changes.

1. Under liferay-portal-6.1.0/tomcat-7.0.23/webapps directory
  • Rename directory ROOT to myportal
2. Under liferay-portal-6.1.0/tomcat-7.0.23/conf/Catalina/localhost directory
  • Rename file root to myportal
  • Edit myportal file and change  <Context path=""...> to  <Context path="/myportal"...>
3. Under  liferay-portal-6.1.0 directory
  • Edit (create one if it does not exist), add in portal.ctx=/myportal
4. After restarting Liferay, it is very important to perform the following additional step. Without making this change, a number of portlets such as message board would not work properly.
  • Login as portal administrator
  • Bring up "Control Panel" and click on "Portal Instances" under "Server" tab
  • Change the default value "localhost" at "Virtual Host" to the domain where Liferay is hosted.
5. Liferay should be working on http://<hostname>/myportal

Wednesday 18 April 2012

Adding Apache document root permission to SELinux

On redhat linux with SELinux enabled, merely changing the document root path in the /etc/httpd/conf/httpd.conf file is not enough to make Apache work with the new location. Apache will give "File Not Found" error. To fix this problem, just use the following script. Make sure to change $HTTP_DOC to the location of the new apache document root.



setsebool -P httpd_enable_homedirs on
chmod 755 $HTTP_DOC
chown -R apache.apache $HTTP_DOC
chcon -R -t httpd_sys_content_t $HTTP_DOC

Sunday 15 April 2012

Running multiple Tomcat 7.0 as services on Windows

On a Window system with more than 8G of RAM, it is more beneficial to run multiple Tomcat 7.0. This can easily be achieved by following the steps outlined below.

1. Edit <TOMCAT_HOME>\bin\services.bat

2. Edit <TOMCAT_HOME>\conf\server.xml

Saturday 14 April 2012

Getting vTiger to work with Postgresql

Recently while looking at vTiger CRM, decided to spend some time getting it to work on Postgresql 9 database. It turned out to be a lot more work than I have initially anticipated. Someone has make quite a significant contribution to make vTiger working with Postgresql database. However, there is still a lot of work to be done. Most of the the problems are due to SQL syntax. I'm quite surprise at the syntax that works with MySQL. The list below contains the SQL syntax that are broken in Postgresql but works in MySQL.
  • Joining character field to integer field
  • Using '0000-00-00 00:00:00' as default date
  • Using limit min, max
  • Using duplicate index name
  • Using non standard GROUP BY syntax
  • Using double quote to enclose character data
  • Inserting NULL into integer field
  • Updating character field without enclosing it in single quote
  • Using MYSQL specific build-in functions
  • Comparing true/false on integer field
IMHO, some of these syntax should never be allowed in the first place. If only the developers were using standard SQL syntax, most of this problems would have been avoided. For more details on the work done, checkout  vTiger Postgresql Patch