How To Deploy Radiant on A Small Orange
A small orange - http://asmallorange.com - has been a great web host so far. RadiantCMS is a content management system for publishing websites. I really recommend it for small teams, beacuse it’s simple to use and easy to set up. Here’s a guide on how to set up RadiantCMS in a few minutes. Things you should already know how to do
- Know how to use the shell
- Know how to use ssh
- Know how to use cpanel
Download the source code
The first thing you want to do is get the source code. First things first, ssh into your account. Once you’re in your account, check out the RadiantCMS source code from Subversion. It’s okay if you don’t know what Subversion is, just type the following at the prompt:
cd ~ svn checkout http://dev.radiantcms.org/svn/radiant/trunk/radiant/
Set up the configuration files
Now, you should have the new folder ‘radiant’ in your current directory. Copy the file ‘radiant/config/database.mysql.yml’ to ‘radiant/config/database.yml’, and open database.yml for editing:
cp ~/radiant/config/database.mysql.yml ~/radiant/config/database.yml vim ~/radiant/config/database.yml
This is the configuration file for Rails, it’s used to connect the application to the correct database. For A Small Orange, all databases are prepended with the username, so here’s what my database.yml looked like:
development: adapter: mysql database: username_radiantdev username: username password: your_password_goes_here socket: /tmp/mysql.sock test: adapter: mysql database: username_radianttest username: username password: your_password_goes_here socket: /tmp/mysql.sock production: adapter: mysql database: username_radiantlive username: username password: your_password_goes_here socket: /tmp/mysql.sock
Remember, username is your username. When you’re done editing that, exit your editor. Now edit the file ’~/radiant/config/environment.rb’. Just uncomment the following line (should be the 8th line down):
# ENV['RAILS_ENV'] ||= 'production'
... should be changed to …
ENV['RAILS_ENV'] ||= 'production'
Use cpanel to create your database
Okay! All of the config files are finished =P. Now, go to your cpanel to create your MySQL databases. Go to the url: http://your.website.com/cpanel. Login with your username/password combo.
Click on the icon that says ‘MySQL Databases’. To create a database, type in the database’s name in the field ‘New Database’ and click on ‘Create Database’. A Small Orange will automatically prepend that name with your username. So if you type in ‘radiantlive’ the database’s name will be ‘username_radiantlive’. Here’s a list of databases you’ll want to create:
- radiantdev
- radianttest
- radiantlive
Now just run the script, almost done!
Now, go back to the SSH prompt. From the radiant directory, use the setup_database script:
cd ~/radiant ruby script/setup_database production
This script will ask you if you want to have a full weblog, a simple weblog, or nothing. This is your choice – if you want to switch you’ll have to start the guide all over again though =[. I normally choose full weblog, as you can delete anything you want. But if you already have a site in mind, just to have nothing.
Create the symlink
Just create the symlink and you’re done! From your home directory, just do this:
ln -s ~/radiant/public ~/public_html/your_site_name
Now point your browser to http://your.website.com/your_site_name. It should be RadiantCMS! To edit pages, go to http://your.website.com/your_site_name/admin. The default login is ‘admin’ and the password is ‘radiant’.
Updating RadiantCMS
If a new version of RadiantCMS ever comes out, you can update it pretty easily. Just go to the ‘radiant’ directory, and use the command ‘svn update’:
cd ~/radiant svn update
And that’s it! Enjoy!
