Tracks
From Smop.co.uk
- download tracks from http://getontracks.org/
- current release is broken - use GIT
- create database (mysql) and grant access
- edit config/database.yml:
production: adapter: mysql database: tracks host: ..... username: tracks password: .....
- copy config/site.yml.tmpl to config/site.yml and edit:
- salt: "....." (something random)
- time_zone: "London"
- subdir: "/tracks"
- edit config/environment.rb and uncomment:
- ENV['RAILS_ENV'] = 'production'
- rake db:migrate RAILS_ENV=production
- script/server -e production
- now point webbrowser at localhost:3000 and create the admin user
- edit preferences - set admin email address, your name
Running under apache
We can't just ProxyPass though as tracks passes lots of absolute "\foo" URLs back :-( Even editing config/environments/production.rb and setting this only fixes some:
- config.action_controller.asset_host = "https://smop.co.uk/tracks"
So let's run it under FastCGI instead:
- uncomment this line from config/environment.rb:
- ENV['RAILS_ENV'] = 'production'
Apache config I've done below for a relative install.
Relative URL
Apache section:
Alias /tracks /var/tracks/public
<Directory /var/tracks/public>
Options +ExecCGI +FollowSymlinks
Order Allow,Deny
Allow from all
AllowOverride None
#AllowOverride All
RewriteEngine on
RewriteBase /tracks
#RewriteRule ^/?$ dispatch.fcgi?controller=todo&action=list [QSA]
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</Directory>
- add to config/environments.rb:
config.action_controller.relative_url_root = '/tracks'
- patch bundle-fu.rb using the patch from here and here
- NB: ActionController::AbstractRequest.relative_url_root should be renamed ActionController::Base.relative_url_root
- rm ./public/stylesheets/cache/* ./public/javascripts/cache/*
- if you don't see this the cached CSS will be broken (you will see FILE READ ERROR in it)
