Saturday, June 4, 2011

Installing Apache2 on Ubuntu 11.04 in VirtualBox

Install with:

sudo apt-get install apache2

Setup port forwarding so that Apache can be accessed from the host:

"C:\Program Files\Oracle\VirtualBox\VBoxManage" modifyvm "Ubuntu-11.04" --natpf1 "apache,tcp,,8080,,80"

Then from the host access:

http://localhost:8080/

Installing Java on Ubuntu 11.04

I followed the instructions here:

http://oracamp.com/installing-java-ubuntu-1104-natty-narwhal

java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)

Installing Oracle XE on Ubuntu 11.04 Desktop in VirtualBox

Download Oracle XE (oracle-xe_10.2.0.1-1.0_i386.deb) from:

http://www.oracle.com/technetwork/database/express-edition/downloads/102xelinsoft-102048.html

Make sure you have 1GB of swap, or add more as described here:

https://help.ubuntu.com/community/SwapFaq

then:

wget -c http://oss.oracle.com/debian/dists/unstable/main/binary-i386/libaio_0.3.104-1_i386.deb
sudo dpkg -i libaio_0.3.104-1_i386.deb
sudo dpkg -i oracle-xe_10.2.0.1-1.0_i386.deb

Oracle XE can be silently installed, by creating a file (e.g. xe-install.txt) containing:

8080
1521
<sys password>
<system password>
y

Then executing:

sudo /etc/init.d/oracle-xe configure < xe-install.txt >> xe-install.log

Open the database home page at:

http://127.0.0.1:8080/apex

To access the database from the Windows host, issue the following command to setup port forwarding:

"C:\Program Files\Oracle\VirtualBox\VBoxManage" modifyvm "Ubuntu-11.04" --natpf1 "oracle,tcp,,2521,,1521"

A JDBC like the following can then connect from the host:

hr@//localhost:2521/xe