Running Your Own SSL Server

March 18, 2008

For years now I’ve been paying for web space. These services are always limited in some dimension, be it either bandwidth, services allowed on their servers, disk space, admin privileges, the list goes on… and why? Most people these days have a high speed internet connections with upload speeds of 850Kbps to 219Kbps (these speeds are relevant for the UK) [1] giving an overall approximate average of 535Kbps. The average webpage five years ago was around 130KB [2] and so long as the pages you intend to serve up do not contain any ‘modern’ media which eats up all your bandwidth, you can have a safely host the site from your home connection. So let’s get some numbers in; in the UK I guestimate a throughput rate of 4.1 pages per second. Allowing an upload of 5926.2 pages per day, totalling 2,163,046.1 pages per year.

Just over 268GB later your thinking ‘hey my website doesn’t attract that much traffic’, so now you can clearly see, it’s quite feasible to host a small website from your own home.

Before we begin there are a few things that need to be taken into consideration; firstly, you need to understand that ISPs usually block incoming requests for port 80 to your IP address… port 80 being the default http port. So all we need to do is set the port listener to another integer such as 8080, 8181 or anything you want, so long as it’s over port 1024 (at least I believe its 1024, I know that the lower port numbers are reserved).

I started off by writing my own server in Java, and yes it worked, it was only a http server, i.e. it could not serve up PHP pages et cetera but it could handle simple GET and POST commands, as well as being multithreaded as to allow multiple users to connect simultaneously. But it was too simple – don’t get me wrong I’ll keep developing the code as and when I feel motivated, but for now the whole thing has been put on the back burner as it were.

I then downloaded a program called hfs.exe (HTTP File Server – Google for it) which is a small program that doesn’t even need installing which will set up a http server on your machine. All okay and all, but it just had that amateur feel to it to me. So as a Java Programmer I decided I’d look into the open source Java option. I mean why reinvent the cart wheel when you can use a Bridgestone?

It was here that I found the SDK EE, which is Java’s Enterprise Edition, where as up till now all I’ve used is the Standard Edition JDK SE. Downloading and installing the Enterprise Edition you get a Java SQL Database and a Java Virtual Server (with the option to add more). I’m not going to give you a tutorial on this, not at this time anyway, but this gives you the ability to set up a 128 bit high encryption SSL server, signed by Sun Microsystems… from your very own home PC! Pretty cool huh?

 

References:

  1. http://blogs.guardian.co.uk/technology/2008/02/20/average_uk_broadband_speed_is_less_than_3mbps_says_broadband_expert_.html
  1. http://www.optimizationweek.com/reviews/average-web-page/

 

 

Leave a Reply