swamp.io

We are just gators in the swamp.

Second Crack with Linode and Ubuntu

First and foremost, getting Linode up and running with an Ubuntu 13.04 LAMP setup is as easy as just following the first four Quick Start Guides (Getting Started, Securing Your Server, Hosting a Website, and Adding DNS Records) provided in the Linode Library.

Setting up the Second Crack static-file weblog system was a bit more challenging. Everything you need to know to get it up and running is outlined on Marco’s GitHub site, but it is not easy to digest without a bit of work (probably by design, given the profuse warnings).

As I worked to get my installation configured, I found a couple of good write-ups (Wynja, Gibbs, Egan, and Stewart), but none of them were tailored to the Ubuntu setup that I was using.

Nick Wynja’s Deploy Second Crack (and the associated GitHub Project) was the most valuable of those articles, but it leveraged CentOS and made some assumptions about the system setup that I didn’t like, specifically needing a special ‘blog’ user and disabling the firewall.

Although I didn’t end up actually running the DeploySecondCrack setup scripts, looking through the included files like deploysecondcrack.sh and the other config files provided a wealth of assistance for an ex-sysadmin who hadn’t worked with command-line Unix in a couple of years.

When I first went through this, I skipped setting up Dropbox, and I got secondcrack working with a local source folder /home/myuser/blog-src. In retrospect, I was just being impatient. Ultimately, you will setup Dropbox because it makes this system wonderful to use. If you choose to not set Dropbox up from the beginning, you’ll have to move your existing blog source folder, and change your config.php file to point to it. Given my experience, and if I had to do it over, I would recommend setting up Dropbox prior to Step 2 below.

Steps I used to get Second Crack running:

  1. Copy the secondcrack files to /home/myuser/secondcrack/

  2. Ensure the Paths and Blog Metadata sections are correct in /home/myuser/secondcrack/config.php config.php example

  3. Add a line to /etc/crontab to run the secondcrack engine. crontab example

  4. Verify PHP and Apache configs. config file examples

  5. Install ‘inotify-tools’:

    sudo apt-get install inotify-tools
    
  6. Enable ‘mod_rewrite’:

    sudo a2enmod rewrite
    sudo service apache2 restart
    
  7. At this point you should be able to save an example test-draft.md file to your equivalent of /home/myuser/blog-src/drafts/ folder and see a preview html output in /home/myuser/blog-src/drafts/_previews/

  8. Install Dropbox. (I shared a server Dropbox folder to my main Dropbox account for easy access.)

  9. Update /home/myuser/secondcrack/config.php with new paths because I moved my blog-src location into Dropbox folder.

Notes: