Liferay 6.0.5 on Amazon EC2
October 5, 2010 8:40 PM
Today I've released images for Amazon EC2 with Liferay 6.0.5.
Images Info
| region | arch | root store | ami | |
| us-east-1 | 32bit | ebs | ami-82ae5aeb | |
| us-east-1 | 32bit | instance | ami-54a95d3d | |
| us-east-1 | 64bit | ebs | ami-4c956125 | |
| us-east-1 | 64bit | instance | ami-be9460d7 | |
| | | | | |
| ap-southeast-1 | 32bit | ebs | ami-98750bca | |
| ap-southeast-1 | 32bit | instance | ami-5a720c08 | |
| ap-southeast-1 | 64bit | ebs | ami-82750bd0 | |
| ap-southeast-1 | 64bit | instance | ami-5c720c0e | |
| | | | | |
eu-west-1
| 32bit | ebs | ami-c80336bc
| |
| eu-west-1 | 32bit | instance | ami-940336e0 | |
| eu-west-1 | 64bit | ebs | ami-be0336ca
| |
| eu-west-1 | 64bit | instance | ami-960336e2 | |
How to run
To run these instances use command line:
ec2-run-instances <ami-image-id> --instance-type <instance-type> --region us-east-1 --key <your-keypair-name>
Where:
- ami-image-id - id of image you want to run (get from table);
- instance-type - m1.small for 32bit arch (micro-instance has not enough memory to run Liferay), at least m1.large (or higher) for 64bit arch;
- your-keypair-name - name of your security keypair
How to login
After instance started you can see it's domain-name via ec2-describe-instances command. To login you should use command
ssh -i <path-to-keypair-file> ubuntu@<instance-domain-name>
Where:
- path-to-keypair-file - path to your security keypair file;
- instance-domain-name - domain name instance received after initialization;
After logging in as ubuntu user you will able to do administrative tasks with using sudo command
Installed Software
Software installed in this images (all software expect Liferay installed from ubuntu repository and has almost standard ubuntu configuration)
- Ubuntu Server 10.04 LTS with latest (for moment of creation) updates;
- Apache 2.2.14 as front-end server (listen port 80 and redirected all requests to tomcat via mod_jk);
- OpenJDK 6b18-1.8.1 (sun jdk required to accept user agreement, so, if you like you can isntall it by yourself);
- Tomcat 6.0.24;
- MySQL 5.1.41 (see mysql configuration details below);
- Liferay 6.0.5 (downloaded from SourceForge) with all portlets shipped by default (7cogz, kaleo, opensocial, wspr and so on).
Tomcat settings
Tomcat installed from standard ubuntu package, most files located in /var/lib/tomcat6. Log written into /var/log/tomcat6/catalina.out.
Liferay specific jars installed into /usr/share/tomcat6/lib/ext
start-up script /etc/init.d/tomcat6 changed to give tomcat more memory as well as set some settings used by liferay in standard tomcat bundle (-Xmx1024M -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -Duser.timezone=GMT). But for 64 bit arch you can give Liferay more memory, since even m1.large has almost 8Gb RAM.
/etc/tomcat6/context.xml configured to create JNDI DataSource to MySQL database (jdbc/lportal). It is used later in Liferay.
MySQL setting
MySQL also installed from standard ubuntu package.
root password is "changeme". Please change it if you are going to use it for production! (Also do ot forget to change password in /etc/tomcat6/context.xml)
Database for liferay is lportal. Created with settings to use UTF-8 characterset.
Please Note: If you use "instance store" - mysql data stored in instance storage and will be lost if instance will be terminated. It is usually OK for demonstrations, but, if you want to keep the data, you will need configure MySQL somehow (to store data in EBS or master-slave replication or any other way).
Liferay Settings
Liferay installation is amost standard. It is only configured via /var/lib/tomcat6/webapps/ROOT/WEB-INF/classes/portal-ext.properties to:
- use /opt/liferay for liferay-specific files;
- use jdbc/lportal datasource for connection to DB;
- disable captcha (it is know issue in jcaptcha and OpenJDK. To avoid this problems you can install Sun JDK or configure Liferay to use ReCaptcha)
7Cogz Hook
In this image I've kept 7Cogz Hook installed. As result, it creates demo users and demo organization. If it useful for demonstration - and since these images first of all designed for easy demonstration of Liferay and playing with it - I decided to keep 7Cogz.
To remove 7Cogz Hook you need:
- Stop Liferay (sudo service tomcat6 stop);
- Remove 7Cogz Hook (rm -rf /var/lib/tomcat6/webapps/sevencogs-hook/);
- Recreated DB and start liferay again.
To recreate DB connect to mysql:
mysql -u root -p
and perform
mysql> drop database `lportal`;
mysql> create database `lportal` CHARACTER SET utf8 COLLATE utf8_general_ci;
I hope these images will be helpful for you.