Monday, February 11, 2013

Free Hosting with Dropbox

Anyone who has had an interest in creating a personal website is familiar with the awful prospect of selecting a hosting service.  Not only can hosting services be expensive, but they can also be pretty tricky when discussing their features and services.  When I was still mulling over the idea for this site, I originally wanted a Wordpress installation on my own hosted space.  It seemed that all of the hosting sites I came across were either far too expensive and fancy for my simple needs, or they were pretty sketchy and got a lot of bad reviews.
The alternatives to finding a hosting service are to build your own home server (I'm going to do this using a Raspberry Pi  as a hobby project this summer, I'll post more about it soon) or use a free service like I currently do (so far I'm loving Blogger a lot more than Wordpress, and I would strongly advise against using Wordpress' free hosting).  With a home server you have a traditional server environment (such as LAMP) and complete control over what gets installed and what doesn't, but with a free service like Blogger you get your blog and... that's it.  No storage space for hosting extra projects, no email, no bells and whistles.  Blogger is a great platform for blogging, but when I chose to use it for my personal website, I ran into a roadblock.  How am I going to host my project portfolio?  I could use my school server space at SLIS, but that's a short term solution since they wipe out all of your data when you graduate.  Surely there's got to be some way that I can get all of my web projects and files up and running for free?

There is.  If you use Dropbox (and you definitely should, its a great service that I can't live without), you can create a folder named "Public" on the root level of your account (if you try to nest it in a subfolder it won't work) and this folder behaves a lot like the traditional "www" folder on your average server (some servers may call it "html-public" or "www-data", but it's the folder you drop your web pages into for exposing them to the web). This "Public" folder should have a little earth symbol on it.  See the picture below.





Take any web pages that you want to host and put them in that folder.  This will make them publicly viewable to anyone with the URL.  To link to a file in the "Public" folder, simply navigate to the home page of the website you want to link to, highlight it, and then click "Copy public link."





Doing this will present you with a URL and you can either right click to copy the highlighted text, or click the "Copy to clipboard" button.  They do the same thing.


Pasting that URL into your browser's address bar should load the page in the same way a traditional server would, and of course it functions exactly the same if you bury the URL in a hyperlink. Dropbox accounts used to come with "Public" folders out of the box (pun intended), but they phased them out to move towards the "Share link" function available to any folder in Dropbox.  While they are similar, "Share link" does not link related documents together when served like CSS or JavaScript files, and it has an ugly "Dropbox.com" header that can't be removed.  Not the way to go for our purposes.

Now before you get too excited, there are a few drawbacks to using Dropbox as your host.  The first and most important is that server-side scripting is completely out of the question as far as I know. You can use all the CSS and JavaScript you want, but no PHP, no Python or Perl CGI scripts, and certainly no Ruby on Rails (although if web programming is your cup of tea you probably went the home server route anyway). The second main drawback to hosting on Dropbox is that it isn't 100% reliable. Although it's rare, there have been a few times where my Dropbox links have given 500 errors for no good reason, but then worked fine 15 minutes later.  This isn't a huge deal to me, but it may be to you so I'm letting you know just in case. Last but not least, Dropbox does limit the amount of traffic your links can handle. Links may not handle over 20GB of traffic per day, but this shouldn't be a problem unless you are linking to giant media files or something.  Even if you do manage to go over you traffic limit its not a big deal.  Dropbox will send you a notification that you have exceed your bandwidth limit, and that link will be temporarily disabled (usually around 24 hours). If you are just hosting simple pages without a lot of images and don't expect an insane amount of traffic, you won't ever run into this issue.

No comments:

Post a Comment