Monday, October 17, 2011

Start Ubuntu in text mode


Running the desktop/X11 is very resource intensive, you probably don't want to do it all the time or on production server. Follow the instructions here to start your ubuntu in text mode only.

Install X11 on Ubuntu 10.04 LTS

By default, Ubuntu server 10.04 LTS is text mode only. Follow the stesp below to install X11 (or full desktop).
  1. sudo apt-get update
  2. sudo apt-get install ubuntu-desktop
  3. sudo reboot
After restart, the login screen should show up.

Friday, October 14, 2011

Enable Alfresco JavaScript Debugger

Reference http://aboutalfresco.blogspot.com/2009/11/enable-javascript-debugger.html
The debugger will open in a Java swing window. So it won't work if the server doesn't have GUI, for example, ubuntu without X-windows.

Thursday, October 13, 2011

Alfresco JavaScript Web Script Logging

Add logging in web script JS file
logger.log("whatever");

Change log4j setting in custom-log4j.properties
log4j.logger.org.alfresco.repo.jscript=debug
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug

Restart tomcat.

Friday, October 7, 2011

Where are the tags saved in Alfresco

You can use Node Browser to navigate to where the tags are saved.

  1. Login alfresco
  2. Open node browser
  3. workspace://SpaceStore > children categoryRoot > children taggable
You may not see taggable if no tag exists. Credits goes to
https://forums.alfresco.com/en/viewtopic.php?f=12&t=18091

Alfresco Tomcat JVM Tuning

I have an Alfresco installation with Tomcat server. Which file shall I use to setup JAVA_OPTS for tomcat?

The JAVA_OPTS is not set in alfresco.sh or catalina.sh. Instead, it is in tomcat/scripts/ctl.sh. Stop tomcat, make necessary changes and restart tomcat. You can verify it by

sudo ps -ef | grep java

Wednesday, October 5, 2011

Start CentOS without GUI

I have a VM with CentOS 6.0. It runs quite slow. To speed it up, I decide to turn off X11 GUI. Following the instructions here, this can be done by editing /etc/inittab. Just change from 
id:5:initdefault:
to
id:3:initdefault:
and restart.

Install VirtualBox Guest Additions on CentOS

Follow these steps to install VirtualBox Guest Additions for a CentOS VM.

1. Download guest addition.
This is done by by VirtualBox menu Devices > Install Guest Additions. This will download the file to /media folder.

2. Install dkms
According to this, you need to install dkms before installing guest addition. On CentOS, this is done by "yum install dkms". However, new installation does not have RPMForge repository configured. Follow the instructions here to add RPMForge then go back to install dkms.

3. Install guest additions
Open terminal, change to /media/CentOS-6.0-x86_64-LiveDVD, then run "sh ./VBoxLinuxAdditions.run".

4. Restart

Note run the commands as root by su -c 'your command'.



Alfresco Mimetype & Transformer

Alfresco has a web script that lists the registered mimetypes. http://localhost:8080/alfresco/service/mimetypes. Clicking one of the mimetype also shows the transformer and to/from formats it supports.




Create a CentOS 6 VM with VirtualBox

The steps to create a CentOS 6 VM using VirualBox.
  1. Download CentOS 6 Live DVD X86_64
  2. Start VirtualBox and create a new virtual machine. Select  RedHat (64 bit) as OS. Make sure to allocate > 512M RAM to the VM.
  3. Power on VM. In First Run Wiard, browse to the downloaded Live DVD iso file.
  4. After the system starts, hit "Install to Hard Drive" on the desktop to start installation.
  5. Follow the instructions to install CentOS
  6. The hard drive for the VM will need partition. Select "Re-initialize" when prompted
  7. Restart after installation is complete (in VirtualBox VM settings, make sure it boots from hard disk instead of CD/DVD. Or it will still use the Live DVD)
It is important for the VM to have more than 512M RAM. Otherwise, the "Install to Hard Drive" won't run in GUI mode.