Adventures in Ubuntu systems administration

Archive for February, 2009

Alfresco setup in Ubuntu 8.10 with git

Alfresco

My goal was to install Alfresco in Ubuntu-8.10 and store the Alfresco install and config in git excluding the application data in such a way that I am able to checkout my Alfresco git repo on a new Ubuntu install and have Alfresco running immediately.

This turned out to be fairly easy and makes testing new configuration changes very simple.

There is plenty of information on configuring Alfresco on the Alfresco wiki, and most of my setup is based on the install tutorial for Ubuntu-8.04. So I will only cover the differences in the way I setup Alfresco.

Alfresco dependencies in Ubuntu

I chose to use puppet for taking care of dependencies as it is already in deployment for all the servers I use. The other common way of taking way of taking care of dependencies is to create a script that installs the dependencies and store it in the root Alfresco dir managed by git. If you do not want to setup puppet then see the initialize.sh file below. My puppet rule as follows also installs lighttpd and phpmyadmin.

class alfresco_base {
        package { [
                imagemagick,
                lighttpd,
                mysql-server,
                'openoffice.org-headless',
                php5-cgi,
                swftools]:
                        ensure => installed;

                phpmyadmin:
                        ensure => installed,
                        require => [Package['php5-cgi'], Package['lighttpd']],
                        notify => File['50-phpmyadmin.conf'];

                sun-java6-jre:
                        ensure => installed,
                        require => Exec[preseed-licence-dlj];
        }

        file {
                '50-phpmyadmin.conf':
                        name => "/etc/lighttpd/conf-available/50-phpmyadmin.conf",
                        ensure => "/etc/phpmyadmin/lighttpd.conf",
                        notify => Exec[lighttpd-enable-phpmyadmin]
        }

        exec {
                "lighttpd-enable-phpmyadmin":
                        command => "lighty-enable-mod fastcgi phpmyadmin",
                        refreshonly => true,
                        notify => Exec[lighttpd-restart];

                "lighttpd-restart":
                        command => "/etc/init.d/lighttpd restart",
                        refreshonly => true;

                "preseed-licence-dlj":
                        command => "echo sun-java5-jdk shared/accepted-sun-dlj-v1-1 boolean true | debconf-set-selections";
        }
}

Initially installing Alfresco

To have something to put into the git repo we first must install Alfresco the usual way for your platform. If you are installing on a 64bit install you will need to install ia32libs first too.

  • ./Alfresco-Labs-3Stable-Linux-x86-Install --mode console

Once installed turn your install into a git repo.

  • cd Alfresco
  • git init
  • git add .
  • git commit -m "Initial install of Alfresco Labs 3 Stable"

Now we need to define some exclusions for files that are changed or defined after install such as log folders and user data.

  • echo "alf-backstop-*
    alf_data/
    alfresco.log
    tomcat/logs/
    tomcat/temp/
    tomcat/conf/tomcat-users.xml
    tomcat/webapps/alfresco/
    tomcat/webapps/share/
    tomcat/webapps/studio/
    tomcat/work/
    virtual-tomcat/logs/
    virtual-tomcat/work/
    alfresco.log.*
    tomcat/webapps/alfresco.war-*" >> .git/info/exclude

Your git repo is now ready to be uploaded to you preferred place of storing git repos such as a file server or gitosis. I’m using a file server via ssh.

  • ssh git@fileserver "mkdir Alfresco; cd Alfresco; git init"
  • git remote add origin git@fileserver:Alfresco
  • git push origin master
  • scp .git/info/exclude git@fileserver:Alfresco/.git/info/exclude

Congratulations! You now have a fresh install of Alfresco stored in git on your fileserver.

Initial configuration

Before checking out on a new server there are a few changes we needed to commit.

File: initialize.sh:

#!/bin/sh
ALF_HOME=/opt/Alfresco
# Uncomment the following line if not using puppet
#apt-get install imagemagick mysql-server openoffice.org-headless php5-cgi swftools sun-java6-jre
echo "Creating init.d links"
ln -s $ALF_HOME/alfresco.sh /etc/init.d/alfresco
ln -s $ALF_HOME/virtual_alf.sh /etc/init.d/virtual_alf
update-rc.d alfresco defaults
ln -s $ALF_HOME/alfresco.sh /etc/init.d/alfresco
ln -s $ALF_HOME/virtual_alf.sh /etc/init.d/virtual_alf
update-rc.d alfresco defaults
update-rc.d virtual_alf defaults
echo "Creating MySQL database tables - Password for MySQL root user:"
mysql -u root -p < $ALF_HOME/extras/databases/mysql/db_setup.sql
[ ! -d $ALF_HOME/tomcat/logs ] || mkdir $ALF_HOME/tomcat/logs
[ ! -d $ALF_HOME/virtual-tomcat/logs ] || mkdir $ALF_HOME/virtual-tomcat/logs

initialize.sh links alfresco into /etc/init.d, sets it to start at boot time and creates the alfresco mysql user. If you are using the puppet recipe above then the default mysql root password is blank and should be changed either at the command line or from phpmyadmin (http://localhost/phpmyadmin/). If you are not using puppet then uncomment the apt-get line at the top of the file and customise the dependencies for your needs.

File: alfresco.sh and virtual_alf.sh

Change @@ALFRESCO_DIR@@ to your install dir, eg: /opt/Alfresco
Change @@JAVA_HOME@@ to your jvm dir, eg: /usr/lib/jvm/java-6-sun/

File: tomcat/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties

There is a conflict with the port used by the virtual server that needs to be changed else the virtual server will not start a second time and complain that the port is already in use (and it is).

Change avm.rmi.service.port=50501 to avm.rmi.service.port=50509

Commit

First get a list of files you have changed:

  • git status

If you want to commit all those changed files then commit like:

  • git commit -a -m "You commit message"

Or if you only want to commit a couple of the changes, eg:

  • git add initialize.sh alfresco.sh virtual_alf.sh
  • git commit -m "Your commit message"

Now push the changes:

  • git push origin master

And you will find you use that process fairly often to start with. I also found myself using branching to test larger changes or changes I wanted to keep separate for now. But documenting all of those commands is beyond this post. Other changes I made were changing the database backend to mysql and authentication to active directory.

Checkout Initialize Run

Now lets test it. Lets assume your using a clean install of Ubuntu again (with a puppet client setup already).

  • sudo git clone git@fileserver:Alfresco /opt/Alfresco
  • sudo scp git@fileserver:Alfresco/.git/info/exclude /opt/Alfresco/.git/info/exclude
  • sudo /opt/Alfresco/initialize.sh
  • sudo /etc/init.d/alfresco start

Your Alfresco server should start after a few minutes and be ready for testing. You can commit and push changes from any checkout too.

There may be other files or directories you need to add to the exclude file too. You will see most of these after starting Alfresco the running git status.

Stay tuned for: Active Directory integration


Creating JeOS virtual machines in Ubuntu

The two tools I use for creating new vm’s with libvirt are virt-install and vmbuilder. I use virt-install when I will be installing an OS from installable media or using an existing disk image, and vmbuilder when I need to create JeOS based vm’s.

After following the guides at wiki.ubuntu.com I ended up with two fairly long template commands:

sudo virt-install --hvm -n <hostname> -r <memory> -f <hdd_image> -s <image_size_in_gb> \
-c <iso> --accelerate --connect=qemu:///system --vnc --noautoconsole
sudo vmbuilder kvm ubuntu --suite intrepid --flavour virtual --arch amd64 -o --libvirt qemu:///system \
--part vmbuilder.partition --user myname --name 'My Name' --pass default --addpkg puppet \
--addpkg unattended-upgrades --addpkg acpid --mirror http://apt/ubuntu --tmpfs - \
--firstboot vmbuilder.firstboot.sh --hostname <hostname> --mem <memory> --dest <hdd_image_basedir>

The command for virt-install is pretty lean compared to the command for vmbuilder. But vmbuilder allows for most of the configuration to be stored in ~/.vmbuilder.cfg. It did take a bit of digging as not a lot about it was on the ubuntu wiki though. (more…)


Retheaming Ubuntu – Part 3

Last in the series of retheaming Ubuntu is application customisation. While the desktop themes you use change the way you see your desktop and can make or break the your desktop experience, the applications you choose to use also play just as large a part. The applications determine the way you interact with your PC. The number of times you have to click to open a favorite folders, where you place your application shortcuts, the way your windows get stacked or tiled, and also to what extent accessories work automatically. (more…)


Retheaming Ubuntu – Part 2

Last time we I covered the themes that were common to all users on a PC – machine specific themes. Themes applied this time will only affect you, but will compose your main experience with Linux. There are three components that define a desktop theme. The window borders, window contents, and icons. (more…)


New theme online: evenflow-intelmac – grub/usplash/gdm

Just a quick announcement that the theme seen in the preview is now finished. Link.

preview-gdm-allcolor

GDM Composite Preview

The usplash theme only supports Ubuntu Intrepid and there still appear to be some issues with widescreen support in Usplash.


Virgin wireless broadband with Ubuntu notes

Under Ubuntu-8.10 two changes are needed for Virgin wireless broadband USB adaptors to work with NetworkManager.

First is that NetworkManager does not save chap/pap settings. This is a NetworkManager bug. But it can be fixed in /etc/ppp/options:

sudo sed -i 's/#-chap/-chap/' /etc/ppp/options

This will disable chap authentication globally for all connections that do not override the option (such as NetworkManager).

Second thing is that the APN is wrong. I don’t know if this is only for pre-paid, as that is all I have tried.

After plugging in the USB adaptor and selecting your internet provider:

  • Right click the NetworkManager icon in the system try
  • Select the Mobile Broadband tab
  • Click on your connection then click Edit
  • Change the APN from VirginInternet to VirginBroadband
  • Click Ok, then Close

To start and stop data sessions now, left click the NetworkManager icon.

If your are asked for a password to connect, anything can be entered.

(ref)


Usplash WIP theme preview

After a day of learning how to create a usplash theme this is a semi final screenshot:

usplash_800_600

The usplash template is based on usplash-smooth and the background is by evenflow. The usplash-smooth package from its PPA is required to be installed for this theme to work. The progress bar timing should be correct from the second reboot on.

The usplash theme supports the following resolutions (both 4:3 and 16:10 in one theme file):

  • 4:3
    • 640_480
    • 800_600
    • 1024_768
    • 1280_960
    • 1600_1200
  • 16:10 (widescreen)
    • 640_400
    • 1024_640
    • 1280_800
    • 1440_900
    • 1680_1050
    • 1920_1200

I have only compiled the theme for amd64 so far and only in one color. They will take me a while to upload too as per color/platform bz2′d is 4.6mb.

Once I fnish installing an x86 guest I will put up both the themes for testing and think about creating the rest of the colour schemes later.

BTW: usplash-smooth is nothing short of what usplash should have been to begin with if you havnt checked it out yet. Even if it does have some downfalls when a boot fails. Cant wait to see plymouth make it into Ubuntu either.


Windows XP p2v conversion with KVM

After all of the Windows and Linux virtual machines I have setup I decided to try a Windows p2v (Physical to Virtual) conversion. After bracing for the worst it ended up being fairly straight forward. Steps as follows:

  1. Create a disk image of sufficient size
  2. Copy the Windows HDD to the disk image
  3. Boot the image with KVM

Yip. Only three steps. Beware that Windows p2v images have all run quite slow for me compared to Windows images that were originally installed in KVM. This I guess is just because of the cruft buildup in Windows and all the driver changes that Windows seems to balk at so much.

Although these instructions are written using Window XP as the guest image, it will work equally (extremely) well for Linux too. The only exception with linux being that you can substitute the clonezilla step for a straight tar copy of the images. Using clonezilla for Windows and Linux though reduces the number of different steps to remember. (more…)


Mobile Internet via Bluetooth on Ubuntu-7.10

My old instructions on setting up internet access from Ubuntu-7.10 via a mobile phone from Telstra or Optus on Ubuntu Linux. Connecting to wireless internet plans via bluetooth. Tested with Next G, (HSDPA) and GPRS.

Tested phone hardware:

  • iMate JasJam
  • Nokia 6110 Navigator
  • Nokia 6120 Classic (ref)

Drop me a note if you have successfully (or not) tested this guide with other phones (more…)


PostBooks install tutorial for Ubuntu Linux 7.10

PostBooks is an excellent cross-platform commercial open source ERP / accounting software suite. These are my old instructions from installing PostBooks in Ubuntu-7.10.

This document will give you setup instructions for installing PostBooks from scratch. Ie, no previous install of postgresql or PostBooks on the system. You will need to read between the lines if your install does not fit that description. (more…)


Adjusting mouse and touchpad speed in xorg.conf

My Dell XPS M1210 had received an install of Ubuntu *the* day it arrived. But the mouse and touchpad always accelerated at different speeds. The problem is that when I go to Mouse Preferences, I can only adjust cursor speed, not the speed of individual movement sources. After a lot of searching here are the samples from my xorg.conf file.

I only use two devices for cursor movement. The trackpad, and a Logitech bluetooth mouse. After booting with an Ubuntu live cd, the trackpad moves at a medium-quick pace, and once I connect to the mouse, the mouse moves at a very-fast pace. (more…)


Retheaming Ubuntu – Part 1

The default look of Ubuntu can sometimes be a bit off-putting for a new user who is used to the flashy looks of OSX and Vista. And to customise the look of Ubuntu from boot to desktop can be a daunting task for new users.

From boot time there are three main themes that you see until you arrive at your desktop. Grub, Usplash and GDM themes. These themes are machine specific not user specific. That means that it affects all users, but only until their desktop is displayed. Then they will not see these two themes again until they log out or shutdown.

For user specific (desktop) themes the main components that govern you look are GTK2 engines and themes, Metacity, Icons, Wallpaper, Fonts and Splash Screen images.

After changing user themes the interface can also be customised by configuring existing applications (ie, gnome-panel and nautilus) and by adding new applications (ie, gnome-do). There is a thin line between configuring applications to change you desktop look and applications that change the themes used.

Although there is much more to cover than I will list, I will limit my content to just the changes I use most and separate the topic into three posts. (more…)