Saturday, 26 December 2009

Installing SubVersion with Apache2 on Ubuntu 9.10

First start off by installing Apache:

sudo apt-get install apache2

Enter the root password and follow the instructions. Check that is it installed correctly by going to http://localhost and checking that you see the standard Apache "It works!" message. Then install subversion and the subversion Apache module:

sudo apt-get install subversion libapache2-svn

Then create a directory to store repositories in:

sudo mkdir /var/svn/
sudo mkdir /var/svn/repositories


and create a test repository:

sudo svnadmin create /var/svn/repositories/test

So that Apache can read and write the repository its user (www-data) needs to be given ownership of it:

sudo chown -R www-data:www-data /var/svn/repositories/test

To be able to authenticate users who access the repository a password file is needed:

sudo htpasswd -c /etc/subversion/passwd paul

Enter a password for the user paul. For additional users repeat the command without the -c option to make sure the existing file is appended to rather than replaced.

Then edit the Apache config file:

sudo gedit /etc/apache2/apache2.conf

Add the following to the end of the file:

<Location /svn>
DAV svn
SVNParentPath /var/svn/repositories/
AuthType Basic
AuthName "Test"
AuthUserFile /etc/subversion/passwd
Require valid-user
</Location>


Save the config file and restart Apache:

sudo /etc/init.d/apache2 restart

The Test repository can now be accessed via http://localhost/svn/test

Reference

https://help.ubuntu.com/9.10/serverguide/C/subversion.html

Installing Eclipse Galileo on Ububtu 9.10

Before installing Galileo on Ubuntu it is worth making sure you have a decent and reasonably recent Java SDK. Open a command prompt and enter:

sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk

enter the root password and follow the instructions. Once the SDK is installed, check the version:

java -version

This should give you something along the lines of:

java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Server VM (build 14.1-b02, mixed mode)


If you get something that suggests a different SDK is install run the following command to remove it and try again:

sudo apt-get autoremove

Then download Eclipse from the Eclipse download page: http://www.eclipse.org/downloads/

Once downloaded unarchive it:

tar xvfz eclipse-jee-galileo-SR1-linux-gtk.tar.gz

and move the eclipse directory into /opt:

sudo mv eclipse /opt

It is now possible to run Eclipse with the following command:

/opt/eclipse/eclipse

however, as Eclipse uses the latest version of GTK and this is not installed in Ubutntu 9.10 by default, a number of dialog buttons will not work. To work around this problem create the following script in the eclipse directory:

gedit /opt/eclipse/launch.sh

#!bin/sh
export GDK_NATIVE_WINDOWS=1
/opt/eclipse/eclipse


Then use the chmod command to make it executable:

sudo chmod +x /opt/eclipse/launch.sh

Noe Eclipse should be launched by calling the script:

sh /opt/eclipse/launch.sh

and all buttons should work correctly. Finally to create a desktop icon, right-click on the desktop and select Create Launcher. Enter Eclipse as the name and the above line as the command and click OK. Then right click on the desktop icon and select Properties. Click on the icon and navigate to /opt/eclipse and open the icon.xpm file. Then click OK to close the properties dialog.

Tuesday, 22 December 2009

Java Dependency Management with Ivy - Part II

In Part I of Java Dependency Management with Ivy I looked at basic Ivy usage and configuration using Ant and the Ivy Eclipse plugin, IvyDE. I demonstrated how Ivy can be used to download modules (dependencies) from a repository, such as the Maven Repository and cache them locally, negating the need to check them into a source control system.

However there are some scenarios where the Maven repository is not suitable:

1.Your development team may not have direct access to the Maven repository or you want to prevent each module from being downloaded more than once.
2.You may want to restrict or specify the modules your development team has access to.
3.You want to use libraries such Microsoft's SQL Server JDBC driver or your own propriety JARs that are not hosted in the Maven repository.

Ivy and IvyDE can be easily configured to look at custom repositories. In this article I will discuss a way of setting up a local public repository and a shared repository, and how to reference them from Ivy and IvyDE.

In my previous article I also explained the difference between a repository and a cache. As I am going to look at repositories in a little more detail it is worth repeating the distinction. A cache is usually local. When you do a build, Ivy checks the cache to see if you already have the required modules. If you do, it uses them, otherwise it looks in one or more repositories for them and downloads them. Repositories can be local, but tend to be remote on the internet or on a central server in an organisation. Maven is a repository and stores a large number of modules.

More

Saturday, 19 December 2009

House of Suns

House of Suns
by Alistair Reynolds
ISBN: 978-0575082373

This is much more like it! Reynolds' best work outside of his Revelation Space series. I loved the characters, their interaction and the way he swapped the first person between the two main characters and the young Abigail Gentian.

From reading the back of the book, which describes Abigail Gentian splitting herself into multiple clones, two of whom fall in love, I was expecting the two lead characters to both be female. Maybe that would have been a step too far?

Reynolds describes this book as stand alone on his website. I'm really rather hoping there will be some more.