#Dreamhost With Jekyll (and moodle)
I am doing some web hosting on Dreamhost, and I’m using their cheap, cheap, shared hosting plan. This means that I’m given a user slot on one of their shared (virtual?) machines. That means I’m rootless, and in the shell world, that sucks!
Also I wanted to install Jekyll, Pygments, and do that with an up-to-date version of Ruby. Now, I’m sure the following instructions will be outdated within a year and a half (my references for this blog: like this and this), but here goes. From here on out LM> is Local Machine and RM> is Remote Machine when you see the shell snippets.
So from your terminal that should look like:
LM> ssh myUser@myDomain.com
If you haven’t set up authorized_keys
yet, don’t worry, we’ll get to that.
Installling rvm should be trivial:
RM> bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
This is where it got tricky for me. I encountered a problem after trying to install ruby-2.0.0.
RM> rvm install ruby-2.0.0
RM> ERROR: Missing required packages: libreadline6-dev, libyaml-dev, automake, libtool, libffi-dev
Grr. This was maddening. Finally I hunted down some information that recommends that you NOT do the following because it’s not a very thoroughly tested option. Oh well, I prefer working at this point, so onward:
RM> rvm autolibs rvm_pkg
Now you should be able to install a newer Ruby!
RM> rvm install ruby-2.0.0
NOTE: If this looks like it’s just hanging (on libtool maybe), check your logfile - it’s probably not hanging, it’s just waiting for you to press a key to continue.
Now, after installation, verify your Ruby version with ruby -v
and then source your *rc file (.bashrc/.zshrc) with source ~/.bashrc
.
This seemed to be the easiest part of the install
This is just from the Dreamhost wiki. You should probably verify that the correct key is cat’d into your authorized_keys file after you do it…
To do that, we have to set up our repos locally and remotely (thanks to this blog)… also don’t forget to modify the myUser
parts below!
This is the part that I really wanted. I love how GitHub Pages allows you to just push a markdown post to the server and boom, it’s published as a blog post. Again, these tips are thanks to the blog linked to in step 5. We need to navigate to /home/myUser/gitprojects/repo.git/hooks
and edit the post-receive
file. Here’s what you should put in there (you may also need to chmod ug+x
according to it and mods by me)
Dreamhost offers some old version of Moodle as a one-click install, but it’s so old and ugly there’s no way you’d ever want to use it. But I ran into issues trying to install v2.0+ on Dreamhost because the web setup kept dying on me. After a lot of looking around, the answer is: turn off FastCGI. After the install is complete you can turn it back on, but for the installation it has to be off for the domain you’re installing Moodle on.
That’s it! You made it! And hopefully this saves you some of the headache I went through!