How to get Theme Context path in Liferay CMS velocity template

This is how you  get the theme context path in a velocity webcontent template in Liferay.

#set ($pathThemeImages = $xmlRequest.replaceFirst('(?s).*<path-theme-images>(.*)</path-theme-images>.*', '$1'))
#set ($themeContextName = $pathThemeImages.replaceFirst('http.*//(.*)/(.*)/images', '/$2'))

Enable HTTPS on Liferay/Apache

Today Im going to explain you how to secure your site in Liferay6.1 (HTTPS enabled)
Apache – Liferay Integration

SSLCertificateFile "D:/Apache2.2/conf/server.cer"
SSLCertificateKeyFile "D:/Apache2.2/conf/server.key"
  • We created necessary certificates for apache web server, now add the following configuration at the bottom of {APACHE_HOME}\conf\httpd.conf file.
Include conf/ssl.conf

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin

RewriteEngine On

RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

ProxyRequests On
ProxyPreserveHost On
ProxyPass /
ProxyPassReverse /

Note : Include all modules realted to Rewrite and Proxy in httpd.conf file

  • You ar done, just restart the Apache web server now!!.