A Radiant Install Tutorial

Jul 02, 2006

The Radiant CMS has been getting a lot of attention lately, and rightfully so since I think it’s a worthy entry into the already crowded realm of content management.

If you’re curious on how to install Radiant this tutorial will get you a functioning install in a nice self-contained package.

Introduction

I’m going to take a slightly different approach to get going with Radiant and suggest doing most of the legwork on your local computer and then finally deploying to your hosting server. This gives you the ability to take your time to learn Radiant without worrying about what is showing to the world or mucking up your hosting environment.

I’m also going to use SQLite instead of MySQL or Postgres because of the portability of the database file.

Prerequisites

The Development Environment

First you’ll need to have a functioning Rails development environment on your computer. If you don’t have this a good place to start is Dan Benjamin’s article on Hivelogic if you have OS X or Linux. For Windows I’d suggest Instant Rails.

You’ll also need SQLite installed. I wrote a tutorial previously on how to install SQLite.

Also make sure you install the sqlite3-ruby gem.

Download Radiant

Once you have everything ready to go ahead and download Radiant. Direct Link

Uncompress the file you just downloaded and you’re ready to setup Radiant.

Setup

database.yml

Now you should have a folder called Radiant-0.5.0. Inside that folder rename db/database.sqlite.yml to database.yml and open it. Then modify the file to look like this:

development:
  adapter: sqlite3
  database: db/radiant_dev.sqlite.db

test:
  adapter: sqlite3
  database: db/radiant_test.sqlite.db

production:
  adapter: sqlite3
  database: db/radiant_live.sqlite.db

Database Population

Then run this command on the command line to populate the base data in the database:

ruby script/setup_database production

Type ‘Y’ when prompted, and I’d suggest option ‘2’ for the basic blog setup to get you started just to see how tags are used and how stylesheets are done.

Start Your Server

Now go ahead and run script/server in production mode. If you’re using lighttpd you’ll need to open up the lighttpd.conf that is copied into your config directory and change this line:

"bin-environment" => ( "RAILS_ENV" => "development" )

to this:

"bin-environment" => ( "RAILS_ENV" => "production" )

Then restart your server and you’ll be running in production mode. You’ll also notice that the file radiant_live.sqlite.db has been created in the db/ directory.

First Steps

Setup the Admin Account

You should now be able to login at http://0.0.0.0:3000/admin with the username ‘admin’ and the password ‘radiant’. The first thing you’ll want to do is go to the ‘users’ link at the top of the admin page and change the default username and password. This is important so people who see you’re using Radiant can’t muck around with your site.

Design Your Site

Now you can go ahead and design your site. Add layouts, pages, and snippets. Play with using page parts and behaviors and just take some time to get comfortable with Radius tags. If you have trouble the best place to go is either the Radiant mailing list or the Trac development site.

An important thing to note is that there is a “more” link under the Page Title. Clicking on it will reveal an input box for the Slug which is the relative link you will use to access each page.

A Note on Stylesheets

Since there isn’t a Stylesheets tab in Radiant like there are in other CMS applications here’s how you currently add stylesheets.

  1. Create a new layout and call it ‘Stylesheet’. Make sure to click on the ‘more’ link and make the content type ‘text/css’.
  2. Create a new child page and call it something like ‘My Homepage Styles’. Click on the ‘more’ link and change the Slug to something like ‘styles.css’. You can now create stylesheet link tags in your layouts section like such:
<link rel="stylesheet" type="text/css" href="/styles.css" />

Deployment

So you should have Radiant installed, setup, and running locally now. You should also have the basics of your site designed and looking the way you want it to. Now you’re ready to get Radiant deployed to your hosting server.

Zip Up Radiant

First thing to do is compress the Radiant folder into an archive. You can make it either an zip or tar archive, whatever your preference is.

Upload To Your Server

Now upload your file to your hosting server and uncompress it. Since we’re using SQLite it is literally is drag and drop and shouldn’t have to change anything. The db file is right where we left it in the db/ folder of our Radiant install.

Configure Web Server

Last thing to do is add an entry in your web server’s config for the new site and restart the server and you’re up and running.

Final Notes

The deployment section here is a bit sparse, but since Radiant is just a regular Rails app it deploys just like any other Rails application. Also, if you want to continue to test changes on your local machine and then deploy to your hosting server I’d suggest putting your Radiant install into a Subversion repository and using Capistrano for deployment. It will save you a lot of time in the long run.

If you find any parts of this tutorial don’t work please let me know.