Sunday, 4 January 2009

Setting up Ubuntu on VMWare Server as Web dev env

This morning got up about 8.50am, so just had time for breakfast, then had to go to church.

After church I went on Animal for a bit, but Ben had a mardy because Mac was going on his PC so Ben wanted to go on the Wii, so I let Ben use the Wii. I had got a bit of a headache so I just lay on the sofa bed and floor for a few minutes until Jin the Pinner thyme.

After dinner I went on my comp and tried a few more times to get Ubuntu (installed on a Microsoft Virtual PC 2007 virtual machine) to work at a decent resolution, but still couldn't do it. I gave up and downloaded VMWare Server 2.

After installing VMWare Server 2, I started it up, it opened Firefox but had an error about an invalid security certificate. So I googled about this, and found a troubleshooting page on the VMWare website, that says to add an exception. But there wasn't an option to add exception, just an okay button on the alert box to tick.

So next I tried it in Opera. This time it just said it couldn't find the page. I looked at the VMWare troubleshooting page again, and changed the url it was trying to connect to to 127.0.0.1 (local loopback address) instead of my PC's name. That got me into the VMWare Server.

The first problem I had was that it wanted a username and password to login, but it hadn't given me a choice of setting any when installing. I read some of the VMWare Server User's Guide about how to set up a machine, install an OS etc and found it was just my username and password for the host OS.

Next I tried setting up a virtual machine. I wanted to use an ISO file for the CD drive, but when I went to locate the ISO file it wouldn't let me browse my computer, and just had a datastore called 'standard'. What I had to do was exit the create a new VM procedure, then on the right hand side of the screen in the 'Commands' box, I needed to 'Add Datastore', then select the directory where the Ubuntu ISO was saved. After that I could create a new Virtual Machine and choose the ISO file from the new datastore I'd just created.

While VMWare Server 2.0 can handle 64 bit OSes (unlike Microsoft Virtual PC 2007 it seems), I decided to just install the 32 bit of Ubuntu as I figured it might have more compatible programs than the x64 version.

When my virtual machine was set up, I booted it up, but nothing happened (other than the machine showing as being switched on in the browser). I read the user guide a bit more, then tried it in IE7. It needed to install a plugin, but then it worked and loaded up the Virtual Machine okay. First thing I tried after it had loaded the live version of Ubuntu, was to change the resolution. There was a large choice of resolution options, I chose the same one that I currently have Vista (the host OS) set at (1280x960) and it worked fine. I guess I should have just installed VMWare Server yesterday and saved myself all the trouble trying to mess around getting it to display at a decent resolution in Microsoft Virtual PC 2007.

I had set the networking option on the Virtual Machine to bridged, which should make the machine appear on the network. When I was using VMWare before (Workstation/player I think) bridged networking didn't allow me to connect to the internet (from Win XP anyway), but I tried the internet and it worked. I installed Ubuntu, and then had to install the updates, which takes quite a while.

While Ubuntu was updating itself and I was installing some other programs I checked Luminous Landscape, Moose News Blog and Andy Rouse's blog.

The other programs I installed were:
  • Konqueror (sudo apt-get install konqueror)
  • Java 6 JDK (sudo apt-get install sun-java6-jdk)
  • Netbeans 6.5 IDE PHP (download from http://www.netbeans.org/downloads/, then right click on file and on permissions tick execute, then okay and open the file.)
  • Apache2, PHP5, MySQL (sudo aptitude install apache2 php5 php5-gd mysql-server php5-mysql)


I was following the Netbeans guide to Installing and configuring PHP, Apache, and MySQL for PHP development in Ubuntu. As soon as I finished installing those programs, I checked http://127.0.0.1 in Ubuntu, and it came up with a message saying 'It works!'. So that was good. The next thing I needed to check was that it would be accessible from my host machine, as there's not much point going to the hassle of developing my site in Ubuntu on a virtual machine if I can't test how the site's working in Internet Explorer.

So I got the IP address of the virtual machine by ifconfig in the terminal. I typed the IP in from my host machine, and got the same 'It works!' message, so looking good. What I would like to do is get a web development environment setup in Ubuntu the same as my web server, then this should make developing my site easier, since it should work the same in my local environment as it does on the webserver.

After tea I played on Animal for a bit, and caught a string fish. I also made another good snowman, and caught 2 Football fishes in a row.

After that I installed VMWare tools to the Ubuntu guest OS, then when that was installed I added a drawer to my taskbar and put Konqueror and a fish inside it:


I checked ebay for Lowepro bags, but couldn't see any at a decent price that would hold the 450d + 100mm/2.8 macro or MP-E 65mm/2.8 macro + MT-24EX attached, ready to take out and shoot. I installed Vista SP1, but haven't checked if it's broken anything yet. Ben and Mac went to bed a while ago, so I think I'll go to bed now and see what Vista SP1's broken tomorrow.

Food
Breakfast: Grapefruit marmalade toast sandwich; cup o' tea.
Dinner: Ham quiche; half a sausage; potatoes; peas; butter. Pudding was: flapjack; dried tropical fruit pieces. Coffee; Belgian milk chocolate.
Tea: Beef Pastrami with mustard sandwich; apple; slice of victoria sponge cake with jam; small bag of milk chocolate buttons; cup o' tea.

No comments: