# Velakor Software

## Installation Instructions

Posted by admin November 25, 2006

Installation instructions:

Feeds is not yet compatible with Rails 2.0. A version of Rails compatibe with Feeds is frozen in app’s vendor directory

Note: On DreamHost (and possibly other hosts) it is recommended that you replace the shebang line in public/dispatch.fcgi and public/dispatch.cgi with the real location of ruby (currently on DreamHost it is /usr/bin/ruby1.8) – so replace the first line of these files with the line #!/usr/bin/ruby1.8 if you install this app on DreamHost. Read DreamHost wiki at this address for more info.

DreamHost Note: You should use this application using their new mod_rails (Passenger) option instead of the unstable FastCGI. Check this option when you’r
e adding the domain that will host this application. The public directory you choose there should be the “public” directory in the root of the application
(i.e. notes/public).

Your server should support FastCGI (the .htaccess points to the FastCGI dispatcher). (See note above for DreamHost)

If your server doesn’t support FastCGI, you may use the slow CGI option:

Edit public/.htaccess

Replace “RewriteRule ^(.*)$dispatch.fcgi [QSA,L]” with “RewriteRule ^(.*)$ dispatch.cgi [QSA,L]” (dispatch.fcgi replaced with dispatch.cgi)

Also, the server must have a recent version of Python installed (and in the PATH). Python is used for parsing feeds.

Possible problems:

On DreamHost, I found it’s more reliable to set up the cronjob that updates the feeds under a different user from the one under which the app runs. (Prevents going above the limit for memory usage for the ruby process.)

1. Create another user in the web panel
2. Upload the app again in a directory under this new user’s home directory (It doesn’t – and it shouldn’t – have to be accessible from the web.)
3. Set up the cronjob for this user to update the feeds as described in Part 3

Part 1 – Setting up the application

1. Upload the archive to your hosting space.
2. It is recommended that you install the application in its own subdomain.
3. Extract the archive; the web root directory must be the “public” subdirectory of the application.
4. Create a database for the application.
5. Execute the file schema.sql (found in the root of the archive) in the database (you can do this from phpMySQL for example)
6. Edit the file config/database.yml and enter the database settings (the database you just created) for production mode.
8. Set the password for the admin account

Part 2 – Setting up the mail settings

Edit config/environments.rb and replace in the lines shown below, your real SMTP server information:

Found in config/environments.rb (replace with your own information):

ActionMailer::Base.server_settings = {
:port => 25,
:authentication => :plain,
:user_name => “mail_user”,
}

Part 3 – Setting up the cronjob that updates the feeds

A procedure in the application needs to be run constantly, in order to update the feeds:

* On Linux, set up a cron job that updates (e.g. every hour) the feeds

Example:

0 * * * * nice -n 19 /usr/bin/ruby /home/myuser/feeds/script/runner -e production ‘MonitorManager.check_all’ 2>/dev/null >/dev/null

Explanation:

nice -n 19: sets up the cronjob to be run at a low priority (prevents being killed by process monitors on some servers)
0 * * * *: sets up a cron job that is run every day at 0:00 server time
/usr/bin/ruby: is the path to ruby
/home/myuser/feeds: is the path where the application is installed
2>/dev/null and >/dev/null: discards the output of the command

* On Windows you can use Task Scheduler or similar tools to run the command (preferably every minute):

ruby c:\path\to\feeds\script\runner -e production ‘MonitorManager.check_all’

The application was tested on a DreamHost Hosting Account.
For more detailed information on how to setup a Ruby on Rails Application on DreamHost, visit:

http://wiki.dreamhost.com/index.php/Ruby_on_Rails

Alternatively, you may use the built-in Webrick server, to test (or use) the application locally on your own computer:

1.) Install Ruby

For Windows, you can download a one-click installer from this address:

2.) Install Rails

Run this command from your command line:
gem install rails –include-dependencies

3.) Install MySQL

4.) Extract the application to a directory on your disk
5.) Follow the steps 4 through 6 in the above instructions (the address of the app will be http://localhost:3000/)
6.) Using the command line, change the directory to the root of the application directory and run the command:

ruby script/server

7.) Follow the steps 7 through 10 (the address of the app will be http://localhost:3000/)

So http://my-feeds-address.com/account/setup will be http://localhost:3000/account/setup

If you would like to get a DreamHost hosting account, you may use the coupon BLUEMOON to get \$50 off on most plans:

DreamHost Webhosting