Comparing version 14 and version 13
I have just installed radiant in my dreamhost setup, and I also saw that this page was empty. So this is the best moment to write all the steps down while my memory is still fresh! This document is mostly a compendium of several sources, I will try to cite them when possible. Having Radiant installed in Dreamhost requires to follow several steps, covering activation of FastCGI support, custom installation of gems, creating the MySQL databases, setting up the environment, and certain customizations. I now will describe them in detail. h2. Enabling FastCGI Go to your Dreamhost Control Panel, in Domains -> Manage Domains, select the domain that is going to host the Radiant installation and click on "Edit" in the WebHosting column. Choose it, and then make sure 'FastCGI Support' is enabled. If you want a step by step with screenshots, visit the entry made by William in RailsHosting, "Deploying a Rails App with DreamHost":http://www.railshosting.org/#dreamhost. h2. Custom Installation of gems Radiant is not included in the standard installation on Dreamhost, so we need to add the required gems. For this, you have to setup a custom gems repository in your local directory. The instructions are listed in the Dreamhost Wiki, in this "link":http://wiki.dreamhost.com/RubyGems. I will summarize them here to make it more comfortable for all. 1. Log in into a shell, for the user who is hosting the domain where you want to set Radiant. 2. Create the '.gems' directory, setup the environment variables, and load the new setup. To do this, add the following lines to '.bash_profile', and then update the enviroment running @source .bash_profile@3. Edit or create the '.gemrc' file, and add the following (replace username appropiately)export GEM_HOME="$HOME/.gems" export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8" export PATH="$HOME/.gems/bin:$PATH"h2. Creating the Database Radiant will need one database, and I will show here how to create a MySQL database to use with Radiant. Go to the Dreamhost Control Panel, under Goodies -> Manage MySQL. Follow the on-screen instructions to create a new database. Note that you need a separate hostname (you can create one in the same page). Take note of the hostname, database name, username and password, as they will be needed in the Radiant configuration. h2. Install and Setup Radiant So we are finally here! Go to the Shell window, and follow the standard Radiant installation instructions. Of course, always refer to the latest installation instructions in "Installation":http://dev.radiantcms.org/radiant/wiki/Installation. Note that path/to/project is not neccessarily the actual web path (actually, that is not recommended). I suggest you create something like 'radiantcms' in you home directory.gemhome: /home/yourname/.gems gempath: - /home/yourname/.gems - /usr/lib/ruby/gems/1.8Then, configure the database. Modify the config/database.yml to point to your MySQL database, using the parameters you copied earlier. Set it as the **production** database. Finally, initialize Radiant:% gem install --include-dependencies radiant % radiant --database mysql path/to/projecth2. Modifications needed for Dreamhost In order for everything to work properly, you need to change some directory permissions, modify some scripts, and finally make a link to make your Radiant installation available to the public. Go to% rake production db:bootstrapand ensure the public directory is public. Type: Check the @public/.htaccess@ file, if it is set up properly. Modify the appropiate @RewriteRule@ line to point to @dispatch.fcgi@ instead of @dispatch.cgi@. It should look like this:chmod -R 755 publicApparently, the environment variables we just setup get overwritten somewhere in the processing flow, so we have to force them. Modify the @public/dispatch.fcgi@ file, and add the following **before** theRewriteRule ^(.*)$ dispatch.fcgi [QSA,L]last'require'linelines( I placed it just after the initial comments - don't(don't forget to adjust the username):Ensure the selected environment is **production** in the @config/environment.rb@ file. Uncomment the line:ENV['RAILS_ENV'] = 'production' ENV["GEM_HOME"]="/home/username/.gems" ENV["GEM_PATH"]="/usr/lib/ruby/gems/1.8:/home/username/.gems"Finally, create a link in your host to point to your radiant installation (modify according to your setup):ENV['RAILS_ENV'] ||= 'production'or if you prefer to have it as a subdomain:% ln -s ~/radiantcms/public ~/hostname/radianth2. That's it, Enjoy! Check the References for more information and for special cases. h2. References "Deploying a Rails App with DreamHost":http://www.railshosting.org/#dreamhost "Dreamhost Wiki, RubyGems":http://wiki.dreamhost.com/RubyGems "Dreamhost Wiki, RubyOnRails":http://wiki.dreamhost.com/Ruby_on_Rails "Dreamhost Wiki, Talk on Ruby on Rails":http://wiki.dreamhost.com/Talk:Ruby_on_Rails% ln -s ~/radiantcms/public ~/subdomain.hostname
