<?xml version="1.0" encoding="UTF-8"?>
<page>
  <content>The "Radiant CMS":http://www.radiantcms.org/ 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.

h2. 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.

h2. 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":http://www.hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger on Hivelogic if you have OS X or Linux.  For Windows I'd suggest "Instant Rails":http://rubyforge.org/projects/instantrails/.

You'll also need SQLite installed.  I wrote a tutorial previously on "how to install SQLite":http://www.myersds.com/notebook/2006/05/02/building_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":http://rubyforge.org/frs/download.php/11319/radiant-0.5.0.tgz

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

h2. 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:

&lt;pre&gt;
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
&lt;/pre&gt;

*Database Population*

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

&lt;pre&gt;ruby script/setup_database production&lt;/pre&gt;

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:

&lt;pre&gt;"bin-environment" =&gt; ( "RAILS_ENV" =&gt; "development" )&lt;/pre&gt;

to this:

&lt;pre&gt;"bin-environment" =&gt; ( "RAILS_ENV" =&gt; "production" )&lt;/pre&gt;

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.

h2. 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.

# Create a new layout and call it 'Stylesheet'.  Make sure to click on the 'more' link and make the content type 'text/css'.
# 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 &lt;head&gt; section like such:

&lt;pre&gt;&lt;link rel="stylesheet" type="text/css" href="/styles.css" /&gt;&lt;/pre&gt;

h2. 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.

h2. 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":/contact.</content>
  <created-on type="datetime">2006-07-02T13:02:46+00:00</created-on>
  <has-changes type="integer">0</has-changes>
  <html>&lt;p&gt;The &lt;a href="http://www.radiantcms.org/"&gt;Radiant &lt;span class="caps"&gt;CMS&lt;/span&gt;&lt;/a&gt; has been getting a lot of attention lately, and rightfully so since I think it&amp;#8217;s a worthy entry into the already crowded realm of content management.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re curious on how to install Radiant this tutorial will get you a functioning install in a nice self-contained package.&lt;/p&gt;


	&lt;h2&gt;Introduction&lt;/h2&gt;


	&lt;p&gt;I&amp;#8217;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.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m also going to use SQLite instead of MySQL or Postgres because of the portability of the database file.&lt;/p&gt;


	&lt;h2&gt;Prerequisites&lt;/h2&gt;


	&lt;p&gt;&lt;strong&gt;The Development Environment&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;First you&amp;#8217;ll need to have a functioning Rails development environment on your computer.  If you don&amp;#8217;t have this a good place to start is Dan Benjamin&amp;#8217;s &lt;a href="http://www.hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger"&gt;article&lt;/a&gt; on Hivelogic if you have &lt;span class="caps"&gt;OS X&lt;/span&gt; or Linux.  For Windows I&amp;#8217;d suggest &lt;a href="http://rubyforge.org/projects/instantrails/"&gt;Instant Rails&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;You&amp;#8217;ll also need SQLite installed.  I wrote a tutorial previously on &lt;a href="http://www.myersds.com/notebook/2006/05/02/building_sqlite"&gt;how to install SQLite&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Also make sure you install the sqlite3-ruby gem.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Download Radiant&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Once you have everything ready to go ahead and download Radiant. &lt;a href="http://rubyforge.org/frs/download.php/11319/radiant-0.5.0.tgz"&gt;Direct Link&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Uncompress the file you just downloaded and you&amp;#8217;re ready to setup Radiant.&lt;/p&gt;


	&lt;h2&gt;Setup&lt;/h2&gt;


	&lt;p&gt;&lt;strong&gt;database.yml&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;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:&lt;/p&gt;


&lt;pre&gt;
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
&lt;/pre&gt;

	&lt;p&gt;&lt;strong&gt;Database Population&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Then run this command on the command line to populate the base data in the database:&lt;/p&gt;


&lt;pre&gt;ruby script/setup_database production&lt;/pre&gt;

	&lt;p&gt;Type &amp;#8216;Y&amp;#8217; when prompted, and I&amp;#8217;d suggest option &amp;#8216;2&amp;#8217; for the basic blog setup to get you started just to see how tags are used and how stylesheets are done.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Start Your Server&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Now go ahead and run script/server in production mode.  If you&amp;#8217;re using lighttpd you&amp;#8217;ll need to open up the lighttpd.conf that is copied into your config directory and change this line:&lt;/p&gt;


&lt;pre&gt;"bin-environment" =&amp;gt; ( "RAILS_ENV" =&amp;gt; "development" )&lt;/pre&gt;

	&lt;p&gt;to this:&lt;/p&gt;


&lt;pre&gt;"bin-environment" =&amp;gt; ( "RAILS_ENV" =&amp;gt; "production" )&lt;/pre&gt;

	&lt;p&gt;Then restart your server and you&amp;#8217;ll be running in production mode.  You&amp;#8217;ll also notice that the file radiant_live.sqlite.db has been created in the db/ directory.&lt;/p&gt;


	&lt;h2&gt;First Steps&lt;/h2&gt;


	&lt;p&gt;&lt;strong&gt;Setup the Admin Account&lt;/strong&gt;&lt;/p&gt;


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


	&lt;p&gt;&lt;strong&gt;Design Your Site&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;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.&lt;/p&gt;


	&lt;p&gt;An important thing to note is that there is a &amp;#8220;more&amp;#8221; 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.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;A Note on Stylesheets&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Since there isn&amp;#8217;t a Stylesheets tab in Radiant like there are in other &lt;span class="caps"&gt;CMS&lt;/span&gt; applications here&amp;#8217;s how you currently add stylesheets.&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Create a new layout and call it &amp;#8216;Stylesheet&amp;#8217;.  Make sure to click on the &amp;#8216;more&amp;#8217; link and make the content type &amp;#8216;text/css&amp;#8217;.&lt;/li&gt;
		&lt;li&gt;Create a new child page and call it something like &amp;#8216;My Homepage Styles&amp;#8217;.  Click on the &amp;#8216;more&amp;#8217; link and change the Slug to something like &amp;#8216;styles.css&amp;#8217;.  You can now create stylesheet link tags in your layouts &lt;head&gt; section like such:&lt;/li&gt;
	&lt;/ol&gt;


&lt;pre&gt;&amp;lt;link rel="stylesheet" type="text/css" href="/styles.css" /&amp;gt;&lt;/pre&gt;

	&lt;h2&gt;Deployment&lt;/h2&gt;


	&lt;p&gt;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&amp;#8217;re ready to get Radiant deployed to your hosting server.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Zip Up Radiant&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;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.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Upload To Your  Server&lt;/strong&gt;&lt;/p&gt;


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


	&lt;p&gt;&lt;strong&gt;Configure Web Server&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Last thing to do is add an entry in your web server&amp;#8217;s config for the new site and restart the server and you&amp;#8217;re up and running.&lt;/p&gt;


	&lt;h2&gt;Final Notes&lt;/h2&gt;


	&lt;p&gt;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&amp;#8217;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.&lt;/p&gt;


	&lt;p&gt;If you find any parts of this tutorial don&amp;#8217;t work please &lt;a href="/contact"&gt;let me know&lt;/a&gt;.&lt;/p&gt;</html>
  <id type="integer">37</id>
  <is-post type="integer">1</is-post>
  <is-published type="integer">1</is-published>
  <title>A Radiant Install Tutorial</title>
  <url>notebook/2006/07/02/a_radiant_install_tutorial</url>
</page>
