Easy Liferay Installation and Setup

I wanted to write an easy installation guide among other things. This is how to install Liferay's Tomcat Bundle on your system and to get it running with ease.

Linux & OSX

1) Download and install Java JDK (sudo apt-get install sun-java6-jdk for Ubuntu). For Macs, the Sun website states

Apple Computer supplies their own version of Java. Use the Software Update feature (available on the Apple menu) to check that you have the most up-to-date version of Java for your Mac.

2) Download the Liferay Tomcat Bundle. Go with the Liferay 6.0.3 bundle with Tomcat 6.0 -- it's the newest one at time of writing.

3) Extract to a place of your choosing. Open a terminal and cd to that directory. Then

cd liferay{version}/tomcat-{version}/bin

./catalina.sh run

Your terminal should now be spitting out lots of stuff. Sit tight and wait for Liferay to open your browser and it will automatically go to http://localhost:8080/web/home/guest. Your Liferay is now working.

Windows

Windows installation is just as easy (if not easier). You need to install the <a href="http://java.sun.com/javase/downloads/widget/jdk6.jsp">Java JDK</a>. Then you download the Liferay Tomcat Bundle, and extract it to anywhere (even your Desktop). Open the folder, browse to tomcat-{version}\bin and double-click startup.bat.

Alternatively, if you know how to use the command line, open it (Start -> Run -> type "CMD" with no quotes)

In the command line, type (replace bracketed items with actual values):

cd C:\{Path-to-liferay-directory}\tomcat-{version}\bin

catalina.bat run

 

Database Configuration

Now, if you've followed either set of instructions above, you'll realize that you're using a database called hypersonic, for development. It's not good if you want to run an actual site using Liferay. To switch to MySQL, Linux users must install the mysql package. Mac users can either install this with macports or by going to the mysql site. Windows users need to install it also. In every case, you will need mysql-server.

Assuming you have mysql server installed, if you want to get your MySQL database working, there are other steps that you must take. Create this file, or modify it if it exists:

liferay-portal-{version}\tomcat-{version}\webapps\ROOT\WEB-INF\classes\portal-ext.properties

Insert into it these lines (or modify them if they exist for some reason), and put the correct credentials after the equal signs.

jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/sandbox?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=YOURUSER
jdbc.default.password=YOURPASSWORD

Also, you need to comment out hypersonic's configs

# Hypersonic MUST BE COMMENTED OUT
#jdbc.default.driverClassName=org.hsqldb.jdbcDriver
#jdbc.default.url=jdbc:hsqldb:${liferay.home}/data/hsql/lportal
#jdbc.default.username=
#jdbc.default.password=

Caveats and Warnings

Currently Liferay Portal requires a minimum of 1gb of RAM. If you purchase a hosting instance that is less than that, you will notice that it takes a long time to start Liferay Portal. In addition, the portal instance will probably be relatively slow. You'd want at least 2gb of RAM to run Liferay Portal comfortably. It can be kind of expensive to run an instance of Liferay, but once it's running it scales very well (a single instance can handle many users at once).

 

FAQs
that aren't so easy to find in the docs

1) What's the default admin user and password?

Liferay 6.0: bruno@7cogs.com / password: bruno
Liferay 5.2: test@liferay.com / password: test

2) Why can't I delete these organizations?

You must delete all users of specific organizations before you can delete the organizations themselves. That, or you can remove the users from those organizations.

0