Sunday, April 14, 2013

Liferay 6.1.1 GA2 on Ubuntu 12.04

My, my how time flies.

Well now playing about with the latest versions of Ubuntu LTS server version and Liferay on Tomcat. On initial install of Ubuntu I didn't install any Java S/JDKs and thats why the Liferay Tomcat bundle didn't work at all. So, I accidentally forgot to install the SUN (Oracle JRE) and installed the Open one which worked fine except that I am now getting all sorts of errors and unexpected things happening including stack traces when uploading logos and going to maintain my personal account details, which requires a repeat sign-on.

So, I decided to try switching to the Glassfish bundle but first realised I may as well fix the JRE first and see if that solves the problem.  First then, how to figure out which version you're running:

..:~:$ java -version

... I got this:


java version "1.7.0_15"
OpenJDK Runtime Environment (IcedTea7 2.3.7) (7u15-2.3.7-0ubuntu1~12.10.1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

I think I need the Oracle/Sun version to be sure so uninstalled it:


sudo apt-get remove openjdk-7-jre



Now I need to install the correct version, which should be done via these commands (from HERE)


# Step 1: Add the repository for JDK 7.
sudo apt-add-repository ppa:webupd8team/java

# Step 2: Update
sudo apt-get update

# Step 3: Install JDK and associated utilities
sudo apt-get install oracle-java7-installer

# Step 4: Set the default java interpreter used by the system.
sudo update-alternatives --config java

Unfortunately I got this message:

"sudo: apt-add-repository: command not found"

So first I have to fix that!

Best guess so far is from HERE: which indicates that I need to install Python things:


sudo apt-get update && sudo apt-get install python-software-properties

and:

sudo apt-get install software-properties-common


So now I can try the command I was going to try earlier:

sudo apt-add-repository ppa:webupd8team/java

which gave me scary message:

You are about to add the following PPA to your system:
 Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK6 / JDK7 / JDK8). There are no actual Java files in this PPA. More info: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
 More info: https://launchpad.net/~webupd8team/+archive/java
Press [ENTER] to continue or ctrl-c to cancel adding it

so I added it of course, and continued with:

# Step 2: Update
sudo apt-get update

...which updated loads of things and so I thought it would be worth the next step:

# Step 3: Install JDK and associated utilities
sudo apt-get install oracle-java7-installer

And now it's installing, in fact I get a "YOU MUST AGREE TO..." screen from Oracle.  So I hit Ok and now it's connected to oracle and downloaded stuff, then cleaned up a cache then set up fonts or something and triggers....

Now finished and seems to be all done.  So I'll try my Tomcat/Liferay install again.

Now trying out the Proof-of-concept site www.histiocytosis.org.uk again, its taking a very long time to load... Hmmm, is it broke?  I wonder....

Well, typically, the site is up but we have the same damned problems with the saving of changes to My Account and the logos.  This seems to be the same as THIS ISSUE on Liferay forums:

Of course, the sharp-eyed amongst you will have realised by now that I missed out on Step 4:


# Step 4: Set the default java interpreter used by the system.
sudo update-alternatives --config java


Me, being somewhat less sharp-eyed just noticed.  So I'll try it now..

I got this:


  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-oracle/jre/bin/java          1072      auto mode
  1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
  2            /usr/lib/jvm/java-7-oracle/jre/bin/java          1072      manual mode


which sort of suggests I already have the oracle version running.  I selected 2 anyway and rebooted and restarted Tomcat to see if the issues are fixed, with little confidence I have to say.








Thursday, March 29, 2012

Updating Liferay Tomcat Bundle to use MySQL instead on HSQL

Though we are still on Glassfish because of Java development issues, here are a few notes made whilst mucking about with Tomcat. We created another site (www.centralsup.com) with Liferay on Tomcat using this approach 'cos we don't intend to do any development on that site
===
WARNING
This is all very standard, there are additional security precautions that should be taken at the network, OS, Db, WAS and application layers.
===
FYI: I've used Daily.co.uk and Rimuhosting.com as VPS providers. Rimu are little more expensive but better; Daily had some weird thing with their Virtualisation model which fouled up my Java memory somehow when they "patched" it (and incidentally, they rebooted my VPSs far too often for my liking...) - this issue broke two of my websites and I chose to move elsewhere. So, you get what you pay for and I'm with Rimu again - in fact, if you want a really shortcut just ask the guys there to install Liferay when you buy the server!

- On new server you will just have an IP address.
- you will have root access and have a password
- putty to that IP address port 22 and log in as root
DOWNLOADS
1. mkdir /usr/local
2. mkdir /usr/local/downloads
3. mkdir /usr/local/downloads/liferay
4. From the new directory use wget to download the Liferay Tomcat bundle
5. (maybe) if the name of the file that is downloaded is not called 'liferay-portal-tomcat-6.0.6-20110225.zip' then rename it using 'mv liferay-portal-tomcat-6.0.6-20110225.zip
6. mkdir /usr/local/downloads/mysql
8. if necessary rename the file correctly to mysql-connector-java-5.1.18.zip
9. Unzip it.
10. You should have new directory called /usr/local/downloads/mysql/mysql-connector-java-5.1.18
11. ..in there is a file called 'mysql-connector-java-5.1.18-bin.jar' This is important, you will need to copy it to a new location later.
INSTALLATION Step 1 - Default bundle
1. from within /usr/local/downloads/liferay 'cp liferay-portal-tomcat-6.0.6-20110225.zip /usr/local/
2. cd /usr/local
3. unzip liferay-portal-tomcat-6.0.6-20110225.zip
4. ls
- - should see a new directory 'liferay-portal-6.0.6' and the zip file.
5. Delete the zip file: 'rm liferay-portal-tomcat-6.0.6-20110225.zip'
6. cd /usr/local/liferay-portal-6.0.6/tomcat-6.0.29/bin
- - in here you should see a script called 'startup.sh'
7. bash startup.sh
8. in a browser goto :8080
- - you should see Liferay with the 7 Cogs set up and default demo users.
- - if all is well shutdown 'bash shutdown.sh'
INSTALLATION Step 2 - Prepare MySQL
The server should have MySQL installed already (that should happen on installation of Ubuntu). so check:
1. sudo netstat -tap | grep mysql
- - you should see something like this:
- - 'tcp 0 0 localhost.localdo:mysql *:* LISTEN 9276/mysqld'
2. reset the root password, you do this using the statement dpkg-reconfigure mysql-server-5.1'
- - the MySQL shuts down and a dos-like dialog box opens up and you can enter a new password (write it down, it's important!).
3. Create a new database called 'lportal'.
- log on to mysql using 'root' and your new password: 'mysql --user=root --password='
4. create the database: and the command prompt, mysql> create database lportal;
- - (NB you need the semi-colon in that statement.
5 confirm the database is created: 'show databases;'
mysql> show databases;
- you should see a list of databases including 'lportal'.
NOTE - this does not create all the tables for the portal, just the empty database. On start up, if Liferay doesn't find the tables it creates the whole database from scratch inside the empty lportal database - Or at least it SHOULD do. If it doesn't you will have to run the script held in the Liferay Dependencies files (see liferay.com for that).
INSTALLATION Step 3 - Connect to MySQL Database
1. cd /usr/local/downloads/mysql/mysql-connector-java-5.1.18
2. cp mysql-connector-java-5.1.18-bin.jar /usr/local/liferay-portal-6.0.6/tomcat-6.0.29/lib/ext/
3. cd /usr/local/liferay-portal-6.0.6/tomcat-6.0.29/lib/ext/
4. ls
- - should see your filed copied there, amongst other stuff.
5. navigate to /usr/local/liferay-portal-6.0.6/tomcat-6.0.29/webapps/ROOT/WEB-INF/classes
6. In here you need to create, and update, the portal-ext.properties file (this is what tells Tomcat to use the MySQL database)
7. vi portal-ext.properties
8. paste in the following:
#
# MySQL
#
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=
9. .. then :w and :q to save the information.
10. cd /usr/local/liferay-portal-6.0.6/tomcat-6.0.29/bin
11 bash startup.sh
12 go to :8080 and wait for it to boot up into the default area again. This time, it should be using the MySQL database. You can check this by creating a new portal user and using the MySQL commands to list the users in the lportal database.
You have a production server ready to go.

Monday, January 09, 2012

Installing Liferay on Glassfish and MySQL and Ubuntu Server (again)

Starting Point
Ubuntu 10.04LTS

(Why we are) Installing Liferay on Glassfish and MySQL and Ubuntu Server (again)

Well, strangely enough we have to start again on a new server. A brief history of how we got there is as follows:

* All working fine on our own hosted servers in a garage
* Router issues
* Electricians in for unrelated maintenance so lots of annoying reboots and shutdowns
* VPS ordered with cheap provider
* Cheap provider upgraded virtualisation software and fouled up java memory allocation then asked for more money for more memory (Grrrr...).
* Lots of wailing and gnashing of teeth and swearing
* VPS ordered with Rimuhosting
* VPS with Cheap provider cancelled.

...which, to cut that long and tortuous story short is why i'm here again to explain how to install Liferay on Ubuntu/MySQL/Glassfish.

Please note: if you want Liferay on Tomcat and don't have anything other than vanilla Liferay in mind then ask the nice people at Rimuhosting to install it from the bundle when you commission the server - they have a script for that sort of thing and you will save yourself much grief (be sure to ask for the MySQL stuff though as the Derby/HSQL is not for productive systems, etc.)

Monday, November 14, 2011

Going Beta


Well Auditioners.Com is going live this week with some users from a further education college - our target early adopters.

Notice that the theme is different to that we originally envisaged -this is because we had a bunch of red herrings and wild geese running around on our servers and to eliminate suspects we switched to the standard Liferay theme. In the end its clear that our chose theme (Spurt, I think) was not the culprit but we quite like the simplicity of this whitened (see CSS) version of the standard one and kept it. Spurt is also a non-standard one so its one less thing to worry about, and Lord knows we have enough to worry about without that.

After signing up and logging in the users get to see the "Main Stage" and the odd instruction about what the site does and how to use it.







For the record: Google Analytics has been quite brutal in its results such that it's clear that aside from something from Brazil that alighted on the site for 0 seconds and me (in Paris, France) the only people to visit the site are those of us working on it. I'm sure that as the next few weeks go by I should be able to report on a few dozen more users around the midlands!

Sunday, May 22, 2011

A Bit More Progress

A few more things have been done now:
  • We are now Auditioners.COM
  • Default themes and template for new users ( you can join up for free and check this out)
  • Audition Pieces portlet is done with search functionality that enables users for find pieces
  • Can export the selected Audition Piece to PDF
Also, we now have a proper Dev server (from Dell) although not yet commissioned

Our sights are now set on a go-live for some pilot users in August/September - when we've done a bit of tidying up and finished one more important bit of functionality.

Sunday, February 20, 2011

Social Auditioners

After several more weeks of faffing about we now have the Social side of Liferay working so that our users can request friendships and once "friended" they can post on walls, get updates on activities, etc. We also have an Amazon bookshop, Google Adsense, YouTube integration and a conceptual model of the main default communities. Also, email notifications for new users and password resets, etc. and Chat are working nicely. We now have to play around with site and ensure that the default behaviour is appropriate and, sadly, begin to find the limitations of out-of-the-box Liferay portlets.

Aside from that, we've been busy updating an "Audition Pieces" database and a database of specialist Drama Schools in the UK along with the audition fees, main requirements, etc.

Oh, and the auditioners.co.uk and the auditioners.com are both now registered with our ISP and pointing to our server; and we have the router routing to dev and production boxes based on port numbers.

We have our own "FavIcon" too, thanks to the advice on the Liferay forum about this. And it does look much nicer.