Alfresco: redirect to HTTP port 80

By default, Alfresco or any other Tomcat application will run on HTTP port 8080. Because of this, users would need to go to, for example, http://alfresco:8080/share to reach the Alfresco Share website.

We can make this easier by configuring Apache proxy_ajp which will redirect port 80 to Tomcat and will make the "/share" path optional.

Install Apache and enable the necessary modules:

apt-get install apache2
a2enmod proxy_ajp rewrite

Create a virtualhost configuration file at /etc/apache2/sites-available/alfresco-reverse-proxy with the following content:

Alfresco Share: default AND search

It's weird that Alfresco Share uses an OR search by default. If we want to find files related to the budget of the marketing department we would have to search for

budget AND marketing

There's an article and a bug report with information on how to change the default behavior to an AND search, but they require you to modify the Java code, which is quite complicated.

As long as this problem is not fixed in Alfresco, you may find it easier to make some JavaScript changes. Just edit file /opt/alfresco-4.2.b/tomcat/webapps/share/components/search/search.js and modifiy the _performSearch function as following:

Installing Alfresco 4.2 on Debian 6

Installing Alfresco 4.2 on Debian 6 is not so hard. Just make sure you install the necessary libraries for LibreOffice and pdf2swf, otherwise the thumbnails and previews won't work properly.

We need the packages listed at http://docs.alfresco.com/4.2/topic/com.alfresco.enterprise.doc/concepts/install-lolibfiles.html but also a few others:

apt-get install libice6 libsm6 libxt6 libxrender1 libfontconfig1
apt-get install libgif4 libjpeg62 libpng12-0 libstdc++5 libxinerama1

After that, you can simply run the binary installer:

wget http://dl.alfresco.com/release/community/build-04480/alfresco-community-4.2.b-installer-linux-x64.bin
chmod +x alfresco-community-4.2.b-installer-linux-x64.bin
./alfresco-community-4.2.b-installer-linux-x64.bin

SQL: year of an ISO week

In MS-SQL you can get the ISO 8601 week date easily by using something like:

SELECT DATEPART(isoww, '2012-01-01')

This will tell you that January 1st of 2012 belongs to week 52. But it doesn't tell you that it belongs to year 2011! The shortest way to get the correct year is:

SELECT YEAR(DATEADD(day, 26 - DATEPART(isoww, '2012-01-01'), '2012-01-01'))

This will add some days to the date if it belongs to a week with a low number. It will subtract some days if it belongs to a week with a high number. The year of that date will always be the correct "ISO week year".

Tweet tweet!

Integrating my website with my @JoeriCapens twitter account.

Versio CloudBox

This website is hosted on a Virtual Machine provided by Versio.

Pros:

  • very cheap - only € 9.99 for a machine with 1 CPU, 1 GB ram and 100 GB storage
  • nearly complete control over the machine - root access, remote console
  • very fast - I didn't do any measurements but it's definitely faster than my old PriorWeb shared hosting

Cons:

  • poor uptime - less than 99.9% according to my Pingdom reports: stats
  • machine templates - it is not possible to do a fresh install from an ISO file (but luckily there are lots of good templates)
  • formatting a disk manually instead of using the CloudBox manager is not recommended, you won't be able to backup an ext4 filesystem for example

capens.net 3.0

This is the third version of my website. The first one was a hand-written PHP website and the second one a Drupal 6 website which got messed up after blindly upgrading to Drupal 7.

I now have a lot more experience with Drupal so I decided to start over with a fresh installation.

Pages

Subscribe to capens.net RSS