I am interested in rewriting some personal websites using ASP.NET MVC because that is the technology I’m most comfortable using at the moment. Those sites are written in PHP and are hosted on a shared Linux hosting.
After I heard about the open sourced ASP.NET 5 and various recent advancements done in the field of running .NET code on Linux, I felt like it’s a good time to do some research. Because I feel that using Azure or some other Windows hosting is too overkill for the websites I have in mind.
So, let’s see what we need for hosting an ASP.NET 5 MVC site on Linux:
a server. Ok, so let’s pick something cheap and good enough to play with: the cheapest DigitalOcean droplet, at 5$ / month.
a Linux distribution. Generally, when I use Linux, I choose Ubuntu because it’s very largely used and there’s lots of help available for it. The instructions below assume that Ubuntu version >=14 is used.
access to the server’s command line. DigitalOcean provides a nice in-browser HTML5 command console for quick access, but you are not able to copy and paste text and it disconnected itself for many times while I was using it. So, it’s nice to quickly access your Linux VM, but for the long run, a remote console through SSH is the better choice.
install a .NET runtime. This is where many paths can be taken. And that’s why I am going to go a bit into detail below.
develop & deploy a web app to the server
see it work (phew!)
Setting up an Ubuntu VPS
I like DigitalOcean very much for their clutter-free and minimalistic experience and good performance/price ratio. If you look around the web or ask friends who may work with something like it, you may find some discount vouchers. The VPS-es they create are called “droplets”. The cheapest one is 5$ / month and offers you (at the moment) 512 MB RAM and 20GB SSD disk. For a lightweight Linux server used for prototyping, this is very good and I was quite happy with the VPS’s responsiveness. Also, the Linux distributions on the droplets are pre-configured to use the best mirrors for downloading packages and indeed they are downloaded very quickly.
I chose the Ubuntu 14.04 distribution for creating a new droplet.
jquery.skillset.js is a jQuery extension that helps you showcase your skills with nice progress bars and also group them by headings and sub-headings. You can also showcase other items, like project tasks completion and so on.
You probably already saw this script in action on the home page of this website. If not, head over there now. ;)
Supports headings, subheadings, rows without progressbars
Accepts input data in a clean and simple JSON format
Optionally collapses the container to a specified height and expands it on click.
jquery.readmore.js is a “read more” implementation on top of jQuery with verbose comments. It supports animation on expanding and the optional use of jquery-dotdotdot for smart text trimming.
I feel it has quite an educational purpose and it also has some functionality to help you achieve a nice state of the “collapsed” mode.
This is done by:
toleranceHeight parameter. If the height difference between the expanded and the collapsed element is not that big, maybe you want to not have “Read more” link shown.
using the jquery.dotdotdot library in conjunction with jquery.readmore. That library nicely trims a block of text and adds an “ellipsis” at the end. It also has some other useful parameters. jquery.readmore could use the trimming offered by that library to show the “collapsed” state.