So I set myself a challenge to turn my back on The Cloud and attempt to set up a brand new Oracle XE instance running APEX and make it available online and accessible from anywhere.
And Yes, as the title states, I did it all for £20!
Why did I do it?
So why did I want to set up my own home served Oracle instance?
Mainly because cloud services like Google Cloud and Microsoft Azure are just too expensive. Not only do they charge for the server you are using but also the time you spend on it. I found myself routinely switching off my cloud server when I wasn’t using it to try and keep costs down and then having to boot it up (often taking 5 minutes plus) just to do a bit of development work.
I also felt I could do the job better myself and with more control. I could have a system with 80Gb disk space or more and hit the cpu as much as I liked without any additional charges or restrictions.
I also had to consider the issue of up-time. Could I match the SLA of a managed cloud service?
Well in the past 15 years I estimate I’ve had no more than three power cuts, all lasting less than an hour and no serious broadband outages.
Plus, I also now have high speed internet giving me 25Mb/sec download and 8Mb/sec upload. Easily enough to handle an Oracle APEX web application with quite a lot to spare.
How did I do it?
Well here’s where ebay comes into the picture.
I knew that all I needed was a basic system with a reasonable duel core processor, at least 1Gb of memory and an average sized hard drive.
It’s a Dell Optiplex 755 Ultra Small Form Factor equipped with:
- Processor: Intel Core2Duo
- Processor Speed: 2.6GHz
- Memory: 1GB DDR2
- Storage: 80GB
- Optical Drive: CD-RW/DVD-ROM Combo
- Operating System: No Operating System installed
The company on ebay was willing to sell this for £20 all in, including power adaptor and free (!) postage.
Obviously it’s not a brand new unit and deals like this don’t appear every day, but with a bit of searching there are some excellent cheap and perfectly usable systems that can handle Oracle XE.
Of course, my server will not need any peripherals either. So no need for a monitor, keyboard or mouse? Once it’s set up, it just needs to sit on your home network wired (or wireless) into your router. All root access can be done by Remote Desktop Protocol (RDP) and the rest by APEX through a browser for the majority your development needs.
The Operating System
So now I have a basic blank box server with no Operating System. I didn’t really want to spend a lot of money on an expensive OS just yet, so I’m using Windows Server 2012. The evaluation version of Windows Server 2012 will run for a full 180 days and, at least for now, is more than sufficient for my Oracle database.
Once I had downloaded the evaluation version (3.4Gb for the iso file), I had to copy it to a USB key.
First off, you need to create the bootable USB key with the Windows USB/DVD download tool. Install this program and locate your iso file, then copy it to the USB key. It’s a simple enough interface and you can’t really go wrong!
So now you have your OS on a memory key, plug it in to the USB port and go to your BIOS settings. The chances are your BIOS isn’t set to boot off a USB so you need to change that to make it the priority boot device.
While installing Windows Server, I found I had to opt to fully reformat my drive before it would let me progress.
Once that was done, the full install of Windows Server 2012 took no more than 10 minutes.
Even though I only had 1 Gb of RAM, the new system ran very well with no problems.
So next up is Oracle XE, Oracle’s very own light weight database and more than suitable for development and small applications. There are obvious restrictions in it’s configuration which you can read about here but for my purposes on this project, it’s more than adequate.
The zip file download of Oracle XE 11g is 325Mb which you can get here (you’ll need to register with Oracle), and install files are available in 32bit and 64bit versions.
Just unzip all the files to a temporary location and run the setup.exe file. The rest is mostly self explanatory since Oracle have provided a very user-friendly installer.
Post Install config
Once installed, there’s a couple of things to do to get your system ready for online use.
- If you need APEX running on a specific port (other than the default 8080) to avoid any conflicts with other applications, you will need to log on to SQLPLUS and type exec dbms_xdb.sethttpport(1010); (or whatever port you want)
- To open up your XE instance to be available to your entire network (rather than just the local machine) log on to SQLPLUS again and type exec dbms_xdb.setlistenerlocalaccess(false);
So we now have an Oracle XE database running, not only on my localhost, but also available throughout my home network, and I can test this by going to http://[my_server_internal_ip_address]:8080/apex.
By default, Windows Server 2012 is very much “locked down” with the firewall blocking most incoming traffic. You’ll need to go to your firewall settings and create a new incoming rule to allow traffic on port 8080 (or whatever port you’ve chosen).
So we’re nearly there, but the final step to creating your own personal cloud server is to open it up to the World Wide Web.
You now need to log on to your home Router Admin screen.
This will vary from one broadband provider to another, but every home router should have an admin logon page to allow you to set Port Forwarding to your home server. Check your router’s manual for details on how to log on.
Once you get logged on and can view your Router’s admin page, look for the page on Port Forwarding.
Basically what we’re doing here is telling your router to forward any traffic hitting your IP address to your internal (Oracle) server via a specified port.
Here’s a screen shot of my Port Forwarding page on my router. I had to add a new application with a specified port and then point it towards my new server.
And that’s it.
You can test the entire setup by going to a PC which is external to your home network and browse to a page like this:
You should then see an Oracle Admin page like this one below which allows you to logon with the Oracle system password you set up during the install process and create new Oracle schema’s and APEX workspaces.
So if you’re finding the cloud just a bit to expensive and restrictive give this a go!
You’ve only got £20 to lose…