Installing Scala on Debian Based Systems (e.g Ubuntu)

Having followed instructions from here, which I thought was really easy, I put together a little bash script to do exactly that. And being a sucker for the latest I went with the 2.9.0.1 installation. I am honestly not sure why Ubuntu still has 2.7.7 in its repository. Ubuntu 11.10 (oneiric)  now has scala 2.9.x so you may want to use that instead of this script but if you want to keep up to date with the latest Scala release then:

Simply copy this and paste into a file, name it whatever you want, and make it executable with chmod +x

#!/bin/bash

cd ~

echo --------------------------------------------------------------------------------------------
echo - Getting Scala 2.9.0.1
echo --------------------------------------------------------------------------------------------
wget http://www.scala-lang.org/downloads/distrib/files/scala-2.9.0.1.tgz

echo --------------------------------------------------------------------------------------------
echo - Decompressing
echo --------------------------------------------------------------------------------------------
tar zxf scala-2.9.0.1.tgz

echo --------------------------------------------------------------------------------------------
echo - moving scala to /usr/share/scala
echo --------------------------------------------------------------------------------------------
sudo mv scala-2.9.0.1 /usr/share/scala

echo --------------------------------------------------------------------------------------------
echo - Symlinking executables
echo --------------------------------------------------------------------------------------------
sudo ln -s /usr/share/scala/bin/scala /usr/bin/scala
sudo ln -s /usr/share/scala/bin/scalac /usr/bin/scalac
sudo ln -s /usr/share/scala/bin/fsc /usr/bin/fsc
sudo ln -s /usr/share/scala/bin/sbaz /usr/bin/sbaz
sudo ln -s /usr/share/scala/bin/sbaz-setup /usr/bin/sbaz-setup
sudo ln -s /usr/share/scala/bin/scaladoc /usr/bin/scaladoc
sudo ln -s /usr/share/scala/bin/scalap /usr/bin/scalap

Mod_Rewrite and Zend Framework 1.10.x and Ubuntu

So all the tutorials on configuring your development server to run Zend Framework successfully say that you need to enable mod_rewrite in apache2 so that .htaccess and Zend_Router* works well.

What they all say is to make sure it’s loaded and enabled. I will raise my hand and say it wasn’t that easy for me to find because Ubuntu lays out Apache2 a little differently from say Fedora. First of all in the /etc/apache2 folder there are a few folders to take note of.

sites-enabled and mods-enabled actually tell you what has been enabled or not and not an uncommented list in some httpd.conf file. Basically the folders in there have symbolic links that come from sites-available and mods-available. This perhaps is a better idea as you can add new mods and not have to recompile apache or whatever.

I digress, to enable mod_rewrite in apache2 in Ubuntu 10.04.1 you need to create a symbolic link from mods-available to mods-enabled to do this you can either use the command:

sudo ln -s /etc/mods-available/rewrite.load /etc/mods-enabled/rewrite.load

or if you prefer GUIs you have to run nautilus as root so you can try

sudo nautilus

and navigate to “/etc/mods-available”, right-click on rewrite.load and select “make link” and the cut the new file created called “link to rewrite.load” paste it in mods-enabled and rename it to “rewrite.load ”

Now all you need to do is restart your web server and you’re all set to reroute anyhow you want.

sudo /etc/init.d/apache2 restart

Ubuntu Karmic Beta

First Attempt

First thing I had to do on my laptop (an old compaq evo N410c), is to disable visual effects because the first install window would just not draw. Once I filled in my details set up how I wanted my hard disk partitioned and clicked on install the window closed and nothing happened. (Thank God I got into work early so I could start it again).

Second Attempt

The second attempt saved me time because some of the information I put in the first time had persisted so that was not a problem. I selected the guided partition option when it got to the file system business and clicked on install again. For the second time the installer just closed down and that was the end of that.

Third attempt

At this point I think either this image I downloaded is corrupt. Or beta is not ready for my laptop. I’m going to download another image and this time run an MD5Checksum on it to make sure that it’s the right image. After which I will install. On trying out the new image of my downloaded and checked image, using unetbootin to extract/decompress onto my USB stick, I still get the same trouble.

Fourth Attempt

I am going to install a clean copy of jaunty (hopefully that works) seeing as I currently use crunchbang with openbox window manager. For all I know it might be a GNOME problem but I suppose I will find out this evening. I did also notice a crash report for metacity, I am not sure how concerned I should be because of this but I am acutely aware of my laptop’s graphic inadequacies, but it should be able to run jaunty and ultimately karmic without disastrous effects on productivity.

Progress!!!

So after installing Jaunty and then bumping it up to karmic it went off without a hitch and it’s actually working much better than any ubuntu worked on this laptop, bearing in mind the restrictions I have on this machine