My Oddysey to Blogging-Land

Despite my best attempts to make this shorter and simpler, this is extremely technical. You may want to skip on down to "Lessons" at some point.

Which blogging software should I use?

After deciding to create a blog, the next question is how. I could go to blogger or some other hoster, which I've done before, but that's no fun!
So, if I'm doing this myself, the next question is, which blog software / Content Management System to use? A little bit of searching and winnowing, and I came up with this list:

Name Logo Language License Familiarity
WordPress PHP GPLv2 very
Joomla PHP GPL some
Drupal PHP GPLv2 some
TYPO3 PHP / JavaScript* GPL none
Ghost node.js MIT none

* Note that JavaScript is now officially called ECMA.

node.js is a shiny new language platform from Google Linux Foundation (sorry! Somehow got it confused with Google's JavaScript based Go) that people either swear by or at. It is written in JavaScript. Which is itself written in C/C++. They're piling the layers on really deep these days.

Apparently I like tearing my hair out. Also, I need shiny content for this blog. I choose Ghost.

Installing ghost blogging software

A "short" synopsis:

  • Go to ghost.org
  • Find installation instructions for Linux
  • Use putty to connect to my Linux VPS.
  • Installing node.js:
    • Try sudo apt-get install node - notice it's the wrong package before confirming.
    • Search for the right package (I could write a lot about dealing with apt/dpkg)
    • sudo apt-get install nodejs
  • Make the user "ghost", the directory "/var/www/ghost", chown it, cd to it, curl the zip file and unzip it.
  • npm start --productionnpm: command not found.
  • Installing npm:
    • Look up npm: "package manager for node.js", sounds harmless.
    • sudo apt-get install npm and confirm.
    • Wait!!! It's uninstalling plesk?!?! The VPS management software my host provides?!
    • I try to cancel, but it's having none of it. Before it scrolls beyond range, I manage to copy the list of the packages it's uninstalling.
    • I verify that plesk is not working, though my websites are working.
    • I spend the rest of the day and evening into the wee hours of the next morning recovering plesk enough to be usable. It's still not completely recovered, but good enough for now. I need to write to npm maintainers about this conflict, and I need to write a long letter to Parallels about the (un)usability of their "Power Panel" (which I used to recover) spend a few useless hours finding out that there is no one to report to, then write a blog post about it.
    • I still have the problem of installing npm without uninstalling plesk. Some searching finds me Tobi's Software Development Blog.
      • Method 1 simply does not work: it still wants to uninstall plesk.
      • Method 2: curl https://www.npmjs.com/install.sh | sh requires privileges, and is executing a script, sight unseen...
      • So, I download the script, examine it, it looks okay, I execute it. → npm cannot be installed without Node.js
      • But, node.js is installed. After some script debugging, I realize it is looking for "node", whereas the program is nodejs.
      • I replace "node" with "nodejs".
      • The script generates some sort of tree that scrolls off the top of the terminal, followed by "It worked." That is bad form, but okay.
  • I go to /var/www/ghost and execute npm install --production, as per instructions. → node: no such file or directory.
    • The node / nodejs problem is apparently everywhere. I add a link to fix it:
      • cd /usr/bin
      • sudo ln -s nodejs node
  • Again I go to /var/www/ghost and execute npm install --production. This time a tree scrolls off the screen with no final message - it appears to have worked.
  • First time start up:
    • I execute npm start --production → it appears to be running. In the foreground, as expected.
    • Neither www.softwareschmiede-herndon.de:2368, nor 5.35.246.86:2368 is working from my home browser.
    • I check if the firewall might be blocking it: it turns out the firewall is down since the npm fiasco (above). I put off fixing that (good choice: a five hour excursion, as it turned out).
    • Since this might be an access problem, I open another putty session and use lynx to localhost:2368. → At first an error page (hey, something is running!), but a simple refresh and: success!
    • A little searching shows that the problem accessing from the browser is that the listening port is set to 127.0.0.1: I change it to 0.0.0.0 → I can access it at www.softwareschmiede-herndon.de:2368
    • I create my admin user.
    • I reconsider the setup: a more typical setup would actually redirect from blog.softwareschmiede-herndon.de to localhost:2368, so that search engines can find it. Using the port 2368 directly should be discouraged or impossible.
  • Setting up the redirect for http://blog.softwareschmiede-herndon.de/
    • I create the plesk subdomain
    • After much searching, I find that the "Hosting type" "forwarding" seems to do what I want.
    • After much testing, I find forwarding does not do what I want: either it tells the browser a new address or it inserts it all in a frame, both of which are really bad for search engines.
    • I have a minor quest through the depths of nginx, which was not installed and when installed, made all my other websites unavailable. Uninstalled again.
    • Apache really should have options for this, so why are all the solutions pointing elsewhere? I look specifically for an Apache solution, and find one. With a little more work, I get it to work in plesk:
      • Create a normal subdomain
      • Go to the "Apache & nginx Settings" for the subdomain.
      • Under additional directives for HTTP (and HTTPS) enter:
      • RewriteEngine On
      • ProxyPass / http://localhost:2368/
      • ProxyPassReverse / http://localhost:2368/
  • I set ghost up as a service:
    • I create a script in /etc/init.d to start ghost as a service.
    • I create a conf file, /etc/init/ghost.conf
  • So, finally working, I make an Introduction post.
  • I want to test commenting... but there's no comments!
    • How I got comments working is planned as another post.

Lessons

  • Never assume that anything that should be short and simple actually is. But you already new that.
  • Always, no matter how innocuous the install, review the output of apt-get carefully before confirming.
  • Script debugging, bash -x, is your friend.
  • When developing your own package:
    • Look out for name conflicts before they become trouble.
    • Regularly test installing on various systems, to be sure things aren't broke for beginners.
  • I need to report problems, so that they get fixed and others aren't bit by them.

Resources

Related blog posts

Copyright © 2016 William David Herndon. All rights reserved.

Here be ads: