I recently installed Ubuntu Jaunty Jackalope and hadn't yet got around to putting Rails on to it.
Installing Ruby and Gems and Rails and getting them all to work nicely together can be a pain, so i'm happy to say i managed to go from nothing to Rails installed and working in 14 minutes this time! Thanks very much to Installing Ruby on Rails on Debian/Ubuntu for most of the tips. Here's how it panned out for me:
(more…)
Posted: June 12th, 2009
Categories:
geeky,
linux,
ruby on rails,
ubuntu
Comments:
View Comments.
Most of my life is spent coding Ruby on Rails, but occasionally i venture into the world of PHP. When i do, i sometimes need to configure Apache because, unlike Rails, it does not happen automagically! To save myself always looking things up on the Internet, here is a little summary of the things i have learnt.
Don't do this!
When i very first started using Linux, i discovered that you could put files into /var/www and access them through http://localhost. This is a very bad idea because you don't have permissions to the /var directory (for good reason!) so i used to end up chmodding everything. Also, keeping anything outside your home directory is bad news because you're liable to forget to back it up before you do an upgrade! WHOOPS!
A perfectly good solution
The next thing i learnt was symlinking, or creating shortcuts. So you can set up a shortcut from the /var/www directory to an appropriate place in your home directory. For example:
sudo ln -s /home/aimee/websites /var/www/html
Now if i have a directory called mac2 under my websites directory i can go to http://localhost/html/mac2/index.php. Nice!
More advanced: VirtualHosts
Later on i started experimenting with Apache's RewriteRule and RewriteBase for nice 'pretty' URLs. You'll soon find out that the symlink method is no longer suitable because you're not using relative URLs anymore. It's time to learn about VirtualHosts, so that i can access my local files with a URL like http://mac2.aimee.
Apache2 keeps a list of available configurations under /etc/apache2/sites-available. I have one called aimee.conf because i am egotistical like that!
sudo vim /etc/apache2/sites-available/aimee.conf
It must start with this line:
NameVirtualHost 127.0.0.1
Then, for each site that i want, i add a VirtualHost like this:
<VirtualHost 127.0.0.1>
ServerName mac2.aimee
DocumentRoot /home/aimee/websites/mac2
CustomLog /var/log/apache2/mac2.log combined
DirectoryIndex index.php
</VirtualHost>
It really just needs to know where to find the source files. The log and directory index are not especially important. It's probably fairly obvious why i added them. There are plenty of other options you could use if you wanted to, but this is about all i use.
Next we need to enable the configuration. It's as simple as symlinking the file from the sites-available directory. You only need to do this once per .conf file (and i only use one for simplicity).
cd /etc/apache2/sites-enabled
sudo ln -s /etc/apache2/sites-available/aimee.conf .
The next step is to configure the hosts file such that when i type http://mac2.aimee into a browser it knows to look on my actual computer rather than on the Internet.
I enter a line like this:
Finally, restart Apache and all should be very well!
sudo /etc/init.d/apache2 restart
The best of both worlds
If you want it both ways (and hey, why shouldn't you?!) it is quite simple to set up another VirtualHost for localhost. Just add it in like this:
<VirtualHost 127.0.0.1>
ServerName localhost
DocumentRoot /home/aimee/websites
</VirtualHost>
Restart Apache again and now the same site is accessible at both http://mac2.aimee and http://localhost/mac2/index.php.
Happy day! :)
Disclaimers
This is how i made it work on Ubuntu Linux in a development environment. Other operating systems may behave differently. I have no idea about setting up production servers!
If Apache is in a different place on your computer, you can find it like this:
To find your hosts file:
I am not an Apache expert, so if you have any questions, chances are i can't answer them! Scroogle is your friend! :)
Posted: January 26th, 2009
Categories:
amusing,
computer,
geeky,
linux,
spirituality,
ubuntu
Comments:
View Comments.
I installed Windows 7 Beta for a few reasons:
- Because it's free! (as in free beer)
- In order to test things under Windows and IE8
- To get SecondLife / OpenLife which are kinda dodgy on Linux
- Just for curiosity because all the reviews have been good
I think Microsoft have done a really good thing here, generating such an interest and making it available to as many people as want to try it. From the looks of things it's a good release both in looks and in functionality, and they should get a lot of great publicity that should lay the disastrous year of Vista to rest. Plus loads of free testing and feedback of course!
Fear not, i am still a great big Linux fan, and i will continue to use Ubuntu as my operating system of choice. But you know, if Windows 7 is really worth it, i might just cough up the money for the real thing when it comes out and the beta expires.
I followed the instructions here: How to dual-boot Vista with Linux (with Linux installed first) to create some space for Windows 7, install it to the new partition, and then fiddle with GRUB to make the two play nicely together. In fact they did not play together to start with. Windows 7 tried to hide Ubuntu, and then i fixed that, and Ubuntu refused to let Windows 7 have a turn. I got "BOOTMGR is missing" and had to run the Windows 7 fix program on the DVD twice before it came back to life.
Anyway, i got it working now and there are some pretty cool things that have impressed me. This is not going to be a full review; that has already been done by plenty of other people … but here are some snapshots of my experience.
I was delighted to see that it comes with a "United Kingdom" theme, possibly because i entered United Kingdom as my location. How very thoughtful and welcoming! The background changes every 30 minutes with nice scenes from around the UK.

The "important message" is Windows 7 anxiously urging me to install a virus checker. Welcome back to the world of insecure operating systems, hah! I have installed the Kaspersky preview for Windows 7 which annoys me with popups every time i try to do anything. Rubbish, hey!
My first piece of feedback to Microsoft, if i could be bothered to give it … the Start button has a spiky highlight. It looks a little bit threatening, to me.

Previews are pretty awesome, especially in Internet Explorer 8 where each tab becomes a separate preview. When you hover over the preview, the full-size image appears. It's neat!

The hover colours themselves are actually really stunning! It seems to take colours from the icon, and apply a beautiful glassy effect, for example the Firefox one is mostly orange:

The 'show desktop' now works both as a click and a hover.

I've already done that a couple of times tonight to have a check on the time and temperature. It's quite nice that a quick mouse gesture (to the bottom corner) can quickly minimize and bring back again. However, the gadgets are not always visible, which may be a glitch or maybe i've just not understood when they show and when they don't.
Finally, Second Life! I was initially disappointed because Second Life claimed that it didn't like the video card driver. So i went to Control Panel – Hardware and Sound – Device Manager, right-clicked on my Display adapter and requested an update. Windows 7 found a good one for me!

YAY! :D
Posted: January 11th, 2009
Categories:
computer,
second life,
ubuntu,
windows
Comments:
View Comments.
I had a little trouble installing both Flash and Second Life on Ubuntu, since they seemed to want to use different versions of one particular library. But in the end the solution was astonishingly simple.
Download Second Life from getdeb.net. Choose your OS version and search for 'Second Life'. I got it working nice and fast, graphics looking wonderful, and with streaming music! For ages my experience has been 'choose any two of the three' making Second Life not so enjoyable. I'm looking forward to Esperanto lessons again, and hoping that the voice chat will work now.
In the end, Flash was as easy as:
sudo apt-get install nspluginwrapper flashplugin-nonfree
I tried all sorts of crazy wrapping techniques with 32-bit libraries and symbolic links, none of which worked. But the apt-get just did it all for me, very nicely. It's better than the Debian Lenny out-of-the-box Flash support which required me to press a ginormous PLAY button before Flash would load. This just works exactly as you'd expect it to.
Delighted though i am with Ubuntu, i have just today been informed of Dreamlinux which is another Debian-based distribution, but tweaked up to resemble Mac OSX. I think i might just have to try out the Live USB of that! :)
Update: Oh, and by the way, here's how to install Skype on a 64-bit Ubuntu Hardy Heron:
sudo apt-get install ia32-libs lib32asound2 libasound2-plugins; wget -O skype-install.deb http://www.skype.com/go/getskype-linux-ubuntu; sudo dpkg -i --force-all skype-install.deb
Thanks very much to the Ubuntu forums for that piece of magic! :)
Posted: October 6th, 2008
Categories:
computer,
linux,
ubuntu
Comments:
View Comments.
My gosh, all these rumours about Ubuntu being super-easy to use … they are absolutely entirely justified! You can colour me heartily impressed! I am, from today onwards, an Ubuntu user!
To start with, the live CD was fast and responsive. It had plenty of nice examples to show off its features. I was very happy that i could install right from within the live CD, and i could keep browsing the internet whilst it installed, which took a super-speedy 10 minutes.
Installing Nvidia graphics card drivers was as simple as ticking on an option under proprietary drivers. It already found the right driver for me, and alerted me that it was available to use if i wanted it. It worked straight away, and i was immediately blessed with some nice subtle visual effects.
All 'root access' stuff has been completely hidden from the end user. Before i change any system settings it asks me for my password to authorise, not the root password. What a good idea.
Installing a Flash player worked right from within Firefox. It popped up the message box "Install missing plugins" and there were actually three options for me to choose. I've never seen even one appear under Linux before! I chose one called 'Gnash' which was probably the wrong option, because it doesn't yet work for Youtube, but i'm sure i'll figure out a good one.
Ubuntu comes with Firefox, Evolution, OpenOffice, Pidgin, the Gimp, F-Spot photo manager, a whole stack of games, Movie player, Rhythm box, Sound Juicer … and a totally awesome Add/Remove Applications.
It has some beautiful themes, and very impressive screen savers.
I think i was worried about losing geek credibility if i switched to Ubuntu. Now i don't care. Right now i need something that Just Works. It's still Linux, but really, really nice Linux! :D
Posted: October 5th, 2008
Categories:
computer,
linux,
ubuntu
Comments:
View Comments.