From Away

The tales of a nomadic Islander

Installing Simplelog on A Small Orange

Having recently installed Simplelog on my A Small Orange hosting account, I thought I’d go through the install process here for the benefit of those that might be running into problems getting it set up. I’ll also throw in a few other general tips and tricks for those that may be setting it up on a similar setup.

First things first, you’ll need to download the latest version of Simplelog from the Simplelog website: or, if you’re feeling adventurous you can download the latest development version from Simplelog SVN: using the username and password ‘anonymous’.

Next, you’ll want to set up a new database for Simplelog by logging into cPanel and creating a new database in the MySQL area. Make sure to take note of your DB name, username, and password, we’ll need these a little later on.

Now we’re going to set the chmod (permissions) for a few files and configure Simplelog. Personally, I like to do both of these steps before I upload Simplelog to my server even though I have SSH access. If you have SSH access or now how to set permissions using your FTP program of choice, you could do it after uploading Simplog. For setting permissions, I’m going to use Terminal (since I’m using OSX) and navigate to the folder that I’ve downloaded/unzipped Simplelog on my local machine.

Computer:~/Downloads/simplelog_2.0.2 username$ chmod 755 log/
Computer:~/Downloads/simplelog2.0.2 username$ chmod 755 themebackup/
Computer:~/Downloads/simplelog_2.0.2 username$ chmod 755 public/dispatch.fcgi

Input the above commands into Terminal (or your command line tool of choice) while in the unzipped Simplelog directory.

Next we’re going to set up our database and configuration settings. First, open config/database.yml and edit it to match your database details (using the DB name, username, and password we set up earlier). For those that are setting up Simplelog on a host other than A Small Orange (or those wanting to use a PostgresSQL DB) there are a couple of other example database.yml files in the config directory. If your MySQL server address is anything other than ‘localhost’, you’ll want to use the database_dreamhost.yml for your example. It contains a ‘host’ field that will allow you to type in a named MySQL address for your server (i.e. mysql.mydomain.com).

One last thing before we upload everything to our A Small Orange server, since ASO is running Rails through FCGI, we’ll need to force Simplelog to run in production mode. Running in production mode will speed things up for us and will put a lot less strain on our shared server (Rails apps should always be run in production mode on your shared server, development should be done locally or on your own development server). So to force production mode, we’re going to open up the environment.rb file in the config directory and add this line to it around line 39: ENV['RAILS_ENV'] ||= 'production'.

Another step that you’ll notice that I’ve skipped (that you would normally have to take care of for most Rails apps) is opening the .htaccess file in the public folder of Simplelog to point to dispatch.fcgi instead of dispatch.cgi. The reason that I’ve skipped over this is because Simplelog is already configured this way when downloaded, so you don’t have to worry about it.

Now that we’ve done all this, we’ll upload Simplelog to our server. Since this isn’t a normal HTML/PHP/etc. application, we’re going to be uploading it to our main user directory (/home/username/). I prefer to keep all my Rails applications in one directory by themselves, so I’ve created a rails folder in my home directory. Change to that folder and upload the Simplelog folder from your local machine.

Once everything is finished uploading, we’re going to SSH into the server to bootstrap our database (bootstrapping includes importing the database schema and a bit of sample data). To bootstrap our database we’ll want to run these commands once we’re logged in to our server:

username@Server [~]# cd rails/simplelog_2.0.2
username@Server [~]# rake simplelog:install

You should now get a message that rake tasks have been completed if the install was successful.

Just one last step before we can start blogging using Simplelog. Since we’ve put Simplelog somewhere other than in our public_html folder, we need to create a symbolic link to the public folder of Simplelog so that visitors will see something when they reach our website.

This next step will delete all of the data that currently resides in your publichtml directory. Make sure to make a complete backup of publichtml before continuing with the next step!

While still logged in to our server via SSH, we’re going to cd back to our home directory:

username@Server [~]# cd ../..

After making a complete backup of our public_html folder we’ll run the following commands:

rm -rf ~/public_html
ln -sf ~/rails/simplelog/public ~/public_html

There, now we can log out of our server and visit our website (http://yourdomain.com/) to make sure that everything went as it should. The first time that you visit your Simplelog install, it will take a little longer than normal for your site to load. This is because Simplelog is running through FCGI, so the extra load time is to wait for the dispatch.fcgi process to start up. After a brief wait you should see the default template for Simplelog show up and now you can visit http://yourdomain.com/admin and log in using the default email/password for Simplelog: Email: temp@email.com/Password: !@gonow (make sure to change this when you log in for the first time).

Now we’re all set to start blogging!

This article is merely a guide. If you’re having problems getting Simplelog installed properly, please visit the Simplelog Wiki or the Simplelog Forums for more help and support.

  • Simplelog Version: 2.0.2
  • Last Updated: March 26, 2007

Post a job. Find one. authenticjobs.com

Comments

There are 6 comments on this post. Post yours →

  • Michele
  • Website
  • March 26, 2007 at 01:34 PM

Great to hear you managed to have it working fine, because it only worked for a couple of hours before throwing errors when I tried it for The Wonsys Blog. It might just be me, but I’ve never managed to have a Rails app working smoothly on ASO.

And BTW, I LOVE ASO! Simply, I think Rails is not meant to be used in a shared environment, yet. I’ll keep an eye here to see how it goes! :)

  • Jeff Smith
  • Website
  • March 26, 2007 at 05:34 PM

I’ve only seen one 500 error since I relaunched using Simplelog. I was a little skeptical at first as well about using Rails in a shared environment, but it’s been handling the meagre 300+ visitors I get per day, so I can’t really complain.

I’d love to move the site to a VPS or a dedicated, but I just can’t justify the added cost at the moment.

  • David P
  • Website
  • May 26, 2007 at 06:57 PM

Jeff, Well written article. I’m not on ASO, but I used most of what you’ve compiled to install Simplelog in my shared environment.

Thanks for taking the time to write this.

  • Jeff Smith
  • Website
  • June 14, 2007 at 09:31 AM

No problem David, I’m glad this helped you out.

  • Geof Harries
  • Website
  • June 22, 2007 at 08:16 PM

I am curious why you posted this about ASO but your site is apparently hosted by MT. I’ve been with both providers - each have their advantages and disadvantages - so I’m intrigued.

  • Jeff Smith
  • Website
  • July 03, 2007 at 09:56 AM

That’s a good question Geof.

Initially, when this post was written, I was on ASO. I had a few needs for some upcoming projects that ASO couldn’t accommodate, so I decided to purchase a (dv) from MediaTemple.

The reason for the switch was basically that I needed a bit more control over my hosting environment, and ASO, being a shared host, couldn’t give me that. ASO is a great host and for anyone that needs a host for a static site or a PHP driven site, I’d definitely recommend them. However, if you’re going to be hosting a Rails or Django powered site, they may not be the best option. And only because, at least in the case of Rails, you have to run your app using FCGI, which I’ve not always found to be that reliable. I’m much happier running this site using a Mongrel cluster.

Leave a Comment