Hands on your first portal (I)
First of all, Happy 2011 to everyone.
It’s been a long time since I last wrote but after holidays and a couple of hectic weeks, it’s been impossible to write a single line, also I must say that I’ve been quite uninspired.
I’ve written already a few posts talking about general aspects on portals and content management, but never got hands on an installation, so that is what I’ll be doing in this series of posts.
I’ve been thinking lots on which Portal / CMS to use for this tutorial, and as I said before I have no experience on .Net or PHP, so I’ve decided to con on a JAVA based solution, just in case I need to do any extension or customization.
From all the different suites available, I’ll be installing Liferay, as I consider it is quite a complete one, offering CMS, Portal, Web 2.0 features. Maybe sometime I’d like to do an Alfresco installation and make them work together.
Well, getting to the techie side, for its installation I’ll be using Liferay latest release of their community edition, which is the free version, bundled with Tomcat. I’ll be downloading it from here (link to http://www.liferay.com/products/liferay-portal/download/ce-vs-ee).
For all of you who don’t know what Tomcat is, it is an open source application server from Jakarta project, here you can find further information, as I’ll assume you already know about it http://en.wikipedia.org/wiki/Apache_Tomcat.
After the over 200 Mb download you obtain a zip file that you should uncompress in the folder that you want. If using windows I recommend uninstalling in C:\, D:\ or any of your drives, not under your user folder.
Tomcat, as said before is a application server running in Java, so it needs Java Runtime Environment (JRE) to run, so it’s is strongly recommended to have it installed previous to continue with Liferay installation, hopefully, if you’re a windows user and don’t have it installed, you can go on your liferay folder and there is a jre folder that can be used. If you don’t know if you have installed, go into a terminal window and just type java, if the command is not recognised, you don’t have it installed, or path is not correct, so please look for some information on the internet.
Once uncompressed, just go on the tomcat folder and then in the bin one and run startup.bat, if using windows, or startup.sh, if using linux/unix and all the magic will startJ. This startup makes the application server start, and under it installation the liferay application is made available.
Now just open your favourite browser and type this url http://localhost:8080 and here we go, liferay is installed, up and running.
This is just a basic liferay installation, without using an external database, but in case you’re a more advanced user, you might want to use your own db just in case you want to perform any customization, integration or extra development. I will use mysql to keep on the open source, I’ve installed 5.1 version. I will assume that you already have yours installed
First step will be stopping the application server, so same as we did for starting it up, in the same folder there are 2 scripts, one for windows, shutdown.bat and one for linux/unix, shutdown.sh that will perform this action.
Access your database with sufficient permissions as to create a new database and perform this creation with utf8 as the charset encoding, for those who don’t have enough sql skills this will be the syntax:
CREATE DATABASE <name> DEFAULT CHARACTER SET utf8;
<name> should be changed for the name you decided to use. I’ve chosen lportal
Once this is done it is time to tell Liferay that it won’t be using its default storage and it will use our brand new database. In order to do that we will need to go on our liferay installation folder and navigate to the following folder tomcat-6.0.26 / webapps / ROOT / WEB-INF / classes. Once you’re in classes directory, you’ll need to create a new file to indicate liferay where to store information, so you’ll need to create a file called portal-ext.properties that will contain the following information:
#
# MySQL connection information
#
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/<name>?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=<password>
schema.run.enabled=true
schema.run.minimal=true
Save the file with the previous information but be careful to change <name> for the name chosen for your database and <password> for your MySQL root password, the one you created on installation.
If all these steps had been followed, once you perform the same startup explained before you should be getting the liferay main page.
It’s all by now, I’ll start to check some information on how to customise your liferay portal so you can use it for your initiatives and will get back to you soon.