How to install Alfresco 5.0.a Community Edition on Ubuntu 14.04 LTS

alfresco logoAfter the development of my most viewed post sharing how to install Alfresco 4.2.c on Ubuntu 10.04 LTS (more than 35.000 views) and Windows Server 2008 R2 (more that 13.000 views), it’s time to update the tutorial to the newest major version of Alfresco: Alfresco Community Edition 5.0.a. Even if the 5-th version is quite different from the 4-th version, the installation process is more or less the same… but let’s describe exactly the differences. The operating system choosen for the tutorial is Ubuntu 14.04.01 LTS.

Differently from the other post, the tutorial is separated in two parts: the installation of the dependencies and the Alfresco installation. As we like and prefer, the installation is a step by step list of commands and tasks: simpler to understand, to do and to test. Hope you’ll be agree.

Part 1 – Installation of the dependencies

Starting from a vanilla installation of Ubuntu O.S. 14.04.01 LTS, let’s update the libraries and configurations.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get purge openjdk-\*

Now it’s time to add a new user called alfresco, we will use for the installation (password: alfresco).

adduser alfresco
Enter new UNIX password: alfresco

Starting from now we will work as alfresco user.

su – alfresco

JDK 1.7u67

Even if Alfresco 5.0.a is certified with Java1.7U60, we use Java1.7U67 (nothing serious will happen). You can download the package from Oracle Java SE Downloads. In our case the package is ‘jdk-7u67-linux-x64.tar.gz’.

sudo mkdir -p /opt/java

Unzip the package in it. In our case in the ‘/opt/java/jdk1.7.0_67′. Please remember to set the permits to the folder to ‘execute’ (use can use chmod command).

sudo nano /etc/profile.d/java.sh
export JAVA_HOME=/opt/alfresco/java/jdk1.7.0_67
export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin

Save and exit.

java -version

ImageMagick

sudo apt-get install ghostscript imagemagick
convert --version

Using the command ‘whereis convert’, please check the result is ‘/usr/bin/pdf2swf’. If not, copy and use it in the ‘img.exe’ parameter into the alfresco-global.properties file.

FFMPeg

sudo add-apt-repository ppa:jon-severinsson/ffmpeg
sudo apt-get update
sudo apt-get install ffmpeg

SWFTools

sudo apt-get install libjpeg62 libgif4
wget http://archive.canonical.com/ubuntu/pool/partner/s/swftools/swftools_0.9.0-0ubuntu2_amd64.deb
chmod a+x swftools_0.9.0-0ubuntu2_amd64.deb
sudo dpkg -i swftools_0.9.0-0ubuntu2_amd64.deb

Using the command ‘whereis pdf2swf’, please check the result is ‘/usr/bin/convert’. If not, copy and use it in the ‘swf.exe’ parameter into the alfresco-global.properties file.

LibreOffice

sudo apt-get install libreoffice

Using the command ‘whereissoffice’, please check the result is ‘/usr/bin/soffice’. If not, copy and use it in the ooo.exe’ and ‘jodconverter.officeHome’ parameters into the alfresco-global.properties file.

PostgreSql

Even if Alfresco 5.0.a is certified with PostgreSql 9.2.4, we use PostgreSql 9.3.5 (nothing serious will happen).

sudo apt-get install postgresql postgresql-contrib
sudo passwd postgres
postgres

Now it’s time to prepare the (empty) database schema for Alfresco.

sudo -u postgres psql postgres
CREATE ROLE alfresco WITH PASSWORD 'alfresco' LOGIN;
CREATE DATABASE alfresco WITH OWNER alfresco;
<ctrl+d>
sudo -u alfresco psql alfresco
ALTER USER alfresco WITH PASSWORD 'alfresco';
<ctrl+d>

Tomcat

Even if Alfresco 5.0.a is certified with Tomcat 7.0.53, we use Tomcat 7.0.55 (nothing serious will happen). You can download the package from Apache Tomcat. In our case the package is ‘apache-tomcat-7.0.55.tar.gz’.

sudo mkdir -p /opt/alfresco
sudo chown alfresco:alfresco /opt/alfresco

Unzip the package in ‘/opt/alfresco’ renaming the apache-tomcat folder in ‘tomcat’.

sudo chown -R alfresco:alfresco /opt/alfresco/tomcat
/opt/alfresco/tomcat/bin/startup.sh
ps -ef | grep java

You can check the existence of the java process. Alternatively you can access to http://localhost:8080/ using your browser.

/opt/alfresco/tomcat/bin/shutdown.sh

Part 2 – Installation of Alfresco

Now that everything is ready, we can proceed to install Alfresco into the environment.

Alfresco 5.0.a

cp /opt/alfresco/tomcat/conf/catalina.properties /opt/alfresco/tomcat/conf/catalina.properties.orig
nano /opt/alfresco/tomcat/conf/catalina.properties

Set the ‘shared.loader’ parameter with the value described below.

shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar

Save and exit.

cp /opt/alfresco/tomcat/conf/server.xml /opt/alfresco/tomcat/conf/server.xml.orig
nano /opt/alfresco/tomcat/conf/server.xml

Add ‘URIEncoding=”UTF-8″‘ to ‘<Connector port=”8080″ protocol=”HTTP/1.1″…’.

 nano /opt/alfresco/tomcat/conf/context.xml

Add the line below:

<Valve className="org.apache.catalina.authenticator.SSLAuthenticator" securePagesWithPragma="false" />
mkdir -p /opt/alfresco/tomcat/shared
mkdir -p /opt/alfresco/tomcat/shared/classes
mkdir -p /opt/alfresco/tomcat/shared/lib
mkdir -p /opt/alfresco/tomcat/endorsed

Download Alfresco Community Edition from Sourceforge. The package is named ‘alfresco-community-5.0.a.zip’. Unzip the package in a temporary folder and you will find a folder named ‘alfresco-community-5.0.a’.

cd .../alfresco-community-5.0.a
cp -R bin /opt/alfresco
cp -R web-server/endorsed/* /opt/alfresco/tomcat/endorsed
cp -R web-server/shared/* /opt/alfresco/tomcat/shared
cp -R web-server/lib/* /opt/alfresco/tomcat/lib
cp -R web-server/webapps/* /opt/alfresco/tomcat/webapps/

You can remove the folder named ‘alfresco-community-5.0.a’.

nano /opt/alfresco/start_oo.sh
#!/bin/sh -e

SOFFICE_ROOT=/usr/bin
"${SOFFICE_ROOT}/soffice" "--accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager" --nologo --headless &

Save and exit.

chmod uga+x /opt/alfresco/start_oo.sh
/opt/alfresco/start_oo.sh
ps -ef | grep soffice

You can check the existence of the soffice process.

killall soffice.bin
nano /opt/alfresco/alfresco.sh
#!/bin/sh -e

# Start or stop Alfresco server

# Set the following to where Tomcat is installed
ALF_HOME=/opt/alfresco
cd "$ALF_HOME"
APPSERVER="${ALF_HOME}/tomcat"
export CATALINA_HOME="$APPSERVER"

# Set any default JVM values
export JAVA_OPTS='-Xms512m -Xmx768m -Xss768k -XX:MaxPermSize=256m -XX:NewSize=256m -server'
export JAVA_OPTS="${JAVA_OPTS} -Dalfresco.home=${ALF_HOME} -Dcom.sun.management.jmxremote"

if [ "$1" = "start" ]; then
 "${APPSERVER}/bin/startup.sh"
 if [ -r ./start_oo.sh ]; then
  "${ALF_HOME}/start_oo.sh"
 fi
elif [ "$1" = "stop" ]; then
 "${APPSERVER}/bin/shutdown.sh"
 killall -u alfresco java
 killall -u alfresco soffice.bin
fi
chmod uga+x /opt/alfresco/alfresco.sh
sudo nano /etc/init.d/alfresco
 #!/bin/sh -e

ALFRESCO_SCRIPT="/opt/alfresco/alfresco.sh"

if [ "$1" = "start" ]; then
 su - alfresco "${ALFRESCO_SCRIPT}" "start"
elif [ "$1" = "stop" ]; then
 su - alfresco "${ALFRESCO_SCRIPT}" "stop"
elif [ "$1" = "restart" ]; then
 su - alfresco "${ALFRESCO_SCRIPT}" "stop"
 su - alfresco "${ALFRESCO_SCRIPT}" "start"
else
 echo "Usage: /etc/init.d/alfresco [start|stop|restart]"
fi
sudo chmod uga+x /etc/init.d/alfresco
sudo chown alfresco:alfresco /etc/init.d/alfresco
mkdir /opt/alfresco/alf_data
cp /opt/alfresco/tomcat/shared/classes/alfresco-global.properties.sample /opt/alfresco/tomcat/shared/classes/alfresco-global.properties
nano /opt/alfresco/tomcat/shared/classes/alfresco-global.properties

Below the lines to replace or add to the properties file.

dir.root=/opt/alfresco/alf_data
...
db.username=alfresco
db.password=alfresco
...
# OpenOffice
ooo.exe=/usr/lib/libreoffice/program/soffice.bin
ooo.enabled=true
jodconverter.officeHome=/usr/lib/libreoffice
jodconverter.portNumbers=8100
jodconverter.enabled=true
# ImageMagick installation
img.root=/usr/share/doc/imagemagick
img.exe=/usr/bin/convert
# SWFTools exe
swf.exe=/usr/bin/pdf2swf
...
db.schema.update=true
...
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/alfresco
...
index.recovery.mode=AUTO
...
authentication.chain=alfrescoNtlm1:alfrescoNtlm

Now everything is ready to start alfresco but, please, pay attention now. Check very carefully the log during the first run. Pay attention to the ERRORS and the reasons why the errors are thrown.

service alfresco start
tailf /opt/alfresco/tomcat/logs/catalina.out

For example, the lines below are caused by the missing configuration of FTP and CIFS. Enjoy!

2014-09-22 22:01:32,203 ERROR [org.alfresco.fileserver] [FTP Server] [FTP] FTP Socket error : java.net.BindException: Permission denied
...
2014-09-22 22:01:32,210 ERROR [org.alfresco.fileserver] [CIFS Server] [SMB] Server error : org.alfresco.jlan.server.config.InvalidConfigurationException: Error initializing TCP-IP SMB session handler, Permission denied

How to analyze your custom properties, types and aspects with A.A.A.R.

A.A.A.R. v2.1As you probably know, Alfresco is able to extend it’s data model with one or more custom models. This is incredibly powerful because you can store your own metadata (called properties) together with your documents. Also the folders could be stored (and retrieved) together with custom properties.

So, once you have stored the documents and folder with success into your Alfresco, how to know how many of them are in a certain state instead of another? How to develop and share reports and analytics about it? Last but not least, how to analyze and control the status of your workflows instances?

Easy like a 1… 2… 3!

If you want to analyze your custom properties organized in types and aspect, starting from the A.A.A.R. v2.1 you can do it. Read here to understand how do develop it in three easy steps.

A.A.A.R. not showing buttons (SOLVED)

After the installation, if your AAAR is not showing Configure/Install/Use buttons, please update Pentaho with the latest “Community Graphics Generator” and “Community Dashboards Framework”. The solution is described here.

aaar_not_showing_buttons

AAAR_for_marketplaceI have received few contacts on that problem so I think would be useful to share the solution one time for all. Thank you to jservajean and kossel for sharing the experience.

The order of the Bee. Something is happening in the Alfresco community.

Order of the BeeSomething interesting is happening in the Alfresco’s community.

I’m not talking about the Alfresco Community (Edition) of the software but the Alfresco’s community composed by people and skilled professionals.

Few weeks ago a brand new organization has been created and is called Order of the Bee. Why that name? Everything was born in the past Alfresco Summit with a Community Keynote by Jeff Potts (here the complete speech).

In my opinion, and not only in my opinion, this is a good news for the (pure) open source developers and professionals. I personally decided to join the organization together with the AAAR solution but I feel like something more interesting will happen in the nearest future. :-)

Below I would like to submit to your attention some key concepts to better understand this organization.

A lesson from old Casino giants. The three key points of casino software development.

They say that those who do not learn from history are doomed to repeat it, and in the case of casino software developers, this could not be more true. As with other congested markets, innovation is key to being successful in the online casino industry, and to be able to bring something totally new to the market, one must look back at what has already been done before.

One cannot blame developers and operators for wanting to enter the online casino industry, as global projections have estimated that the industry will grow by 79% by the end of 2014. The market has been steadily growing, from earning $7.4 billion in 2003 to $37.6 last year. Casino software has undergone great changes since it was first launched in 1996, and it has become increasingly important to stay up to date on these changes.

Security
Casino software developers have done well to build on the security measures pioneered by Cryptologic when they launched Intercasino in 1996. Advanced for its time, Cryptologic had been the first to develop a payment method that wasn’t just safe and secure, but also fast and reliable. To this day, a safe and secure payment method is still the first thing that players check when visiting an online casino. A great idea is to link your payouts to Paypal accounts, but idealware also has some great ideas for safely processing credit card payments.

Innovation
Nobody likes playing the same games over and over again, and while every gamer will have a favorite slot game or a card them they’ll always fall back on, new games rake in the cash. This is the reason why some casino operators have resorted to developing and releasing new games every Wednesday – with great rewards. When developing new slots, vary the style and gameplay of each slot, making sure to create something for every kind of gamer imaginable out there.

Open Communication
Perhaps one of the most underrated aspects of designing or upgrading software is user feedback. Many have debated the saying that “The customer is always right,” but when it comes to a heavily user-driven network like the online casino market, listening to user feedback is essential. Many casinos have, in the past, experienced sit-outs and protests, as they struggled to implement measures that their players were vehemently against. Of course, this also means striking a balance between giving customers what they want, and still making a profit.

Developers of casino software may think that there is very little they can offer to the next generation of gamblers, and the idea that everything has been done before may be truer than we’d like to admit. But by listening to customer feedback and building on already-established strengths, casino software could still be revolutionary.

Author bio
Brian James Smith has been an active player in online casinos since the dawn of the empire. While he has retired his hopes of ever winning big money in online gambling, he still continues to watch out for the latest updates from casino software developers from his Sin City apartment.

online-casino

Building Hadoop clusters review

Building_Hadoop_Clusters

If you are interested in Hadoop technology probably this is an interesting video course you should evaluate. As you probably know, Apache Hadoop is an open-source software framework for storage and large-scale processing of data-sets on clusters of commodity hardware. All the modules in Hadoop are designed with the assumption that hardware failures are common and thus should be automatically handled in software by the framework.

Talking about the video course, we can divide the content in three main macro-sections:
1. how to create and set up a three machines cluster using Amazon EC2,
2. how to install an Hadoop cluster using Apache Ambari,
3. how to start using Hadoop cluster, in particular with Apache Hadoop User Interface (HUE).

The description of all the topics is clear and well done (Sean Mikha, the author, did a good job). All the relevant topics are always detailed before with an explanation of the logic structure and approach and only after with a demostration on how to do it in practice.

Useful also for other purposes, the creation of the virtual machines on Amazon EC2. The practical description and the step by step creation, is not limited to the server’s creation but is detailed also in what concerns the security and connection using, for example, putty ssh client.

apache hadoopIn my opinion the most relevant value of this video course is on the hidden details of the Hadoop cluster installation process. As you will see if you will decide to follow it, the tasks are quite easy to do (probably this a Sean’s merit) but the configuration details and settings are very important if you want to make it work in practice. Following the hints I’m sure every neophyte will gain days of work and lot of nights in googling. ;-)

Enjoy your Hadoop Cluster video course… as usual by Packt Publishing.

Francesco Corti

Solr doesn’t return more than 1,000 objects in Alfresco.

lucene_apacheOnce upon a time Alfresco used Apache Lucene as search engine….

This was great until you had particular needs like, for example, a long duration query or a query that retrieves a huge amount of objects. It was more than a year ago when I wrote a post talking how Alfresco retrieves 1,000 results maximum or query for a couple of minutes.

solrAs you can read in the post, the most suggested solution to the problem was to migrate the indexing engine to Apache Solr. At that time, Alfresco supported both the engines and considered Solr as its future.

Today Lucene and Solr are always supported and Solr is probably the most used, but regarding the same issue, probably something is coming back again.

>> https://issues.alfresco.com/jira/browse/ALF-20567(*) <<

As you can read from the JIRA issue, in Alfresco 4.2.e SOLR also returns a maximum of 1,000 results and to solve the issue is suggested to set the parameters below in the alfresco-global.properties file.

solr.query.maximumResultsFromUnlimitedQuery=10000
system.acl.maxPermissionChecks=10000

This could have a high impact on “big” queries or “long” queries so I would like to share this information with all of you to prevent problems or nights spent on the debugger. ;-)

I hope this will help you.

Francesco Corti

(*) Thanks to Francesco Fornasari and Christian Tiralosi for the hint.