Skip to content
dunjh edited this page May 8, 2013 · 4 revisions

Dreamhost

Tested with 1.7RC2

The Dreamhost installation was very easy. I set it up as the only application in the domain (actually created a subdomain for this purpose):

  • Create a (sub)domain, Fully Hosted
  • Enable:
    • Extra Web Security
    • FastCGI Support
    • Ruby on Rails Passenger (mod_rails)
  • Set the field “Specify your web directory” to:
    • /home/username/ your.domain.name/tracks/public
      Note 06.17.09: When you install tracks, that is, when you unzip the files, you will be replacing the tracks (and thus public) directory you just created in the Dreamhost control panel. That is, go to your domain via SSH or FTP and rename the ‘track’ directory (for example: your.domain.name/xtracks/public). Unzip the file in your.domain.name, and you will see that you now have a ‘tracks’ directory (amongst others), and inside it a ‘public’ directory.
  • Set all the rest of the domain settings to your liking
  • Follow the instructions in http://www.getontracks.org/doc/chapter/2-installation.html with the exceptions below

Now I like to set shell access to my account and log in to Dreamhost via SSH, but I guess it can be done otherwise. The idea is to either unzip the tracks zip file inside the home directory for the site. If you’re like me, you’d need to do:

(log in to your dreamhost account that you associated with the domain using your favorite ssh client)

  • cd your.domain.name
  • wget url-to-tracks-zip-file
  • unzip zip-file.zip
  • You’ll get a folder named tracks-. Let’s create a symlink to it:

ln -s tracks--<version> tracks

Then continue with the installation.

If you don’t like to shell-access your account, you could also download and unzip on your local computer, rename the folder “tracks” and upload the whole thing to Dreamhost. Never tested it myself.

Also – you do not need to run the web server that comes with tracks. Just go to the url http://your.domain.name/signup and you should be fine.
Clarification 06.16.09: Skip this step: script/server -e production. You don’t need a Mongrel server. Dreamhost is providing your server.

— Arik

Solving 404 for stats page

There are just a couple of lines to add to the config/routes.rb file

map.statistics 'statistics', :controller => 'stats', :action => 'index'
map.connect 'statistics/:action', :controller => 'stats', :action =>':action' 

I added them just before

map.resources :recurring_todos, 

which was around line 70 originally.

(copied from the forum here)

also mentioned on the forum by deadman:

alternatively, you can edit your .htaccess file to include this code:



RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(stats|failed_auth\.html).*$ [NC]
RewriteRule . – [L]

taken from their wiki here: http://wiki.dreamhost.com/Making_stats_accessible_with_htaccess

Installing 1.8 (devel)

The devel version of Tracks depends on the ‘sanitize’ gem, which is not installed as of April 2010 on Dreamhost’s servers. Additionally, the normal mechanism of installing this gem in $HOME/.gem will fail, because nokogiri (which is required by sanitize) must compile native code which links against libxstl, and the libxstl-devel headers are not present on Dreamhost.

To get things working, it is necessary to 1) manually install libxstl in your user space, then 2) manually install the nokogiri gem (so that you can provide the customized include and library paths for your version of libxslt), 3) installing the sanitize gem will then work.

Installing libxslt is fairly trivial. On your Dreamhost shell, do the following:

1) Fetch the appropriate tarball from ftp://xmlsoft.org/libxslt/
2) Extract the tarball in a scratch workspace.
3) ./configure —prefix=$HOME && make && make install

As for installing the gem manually, [Editor’s note: I am not that familiar with the Ruby gems system, so there is probably a better way to do this, but the following worked for me.] The version numbers below may be slightly different for you.

1) Attempt to install the gem automatically, with ‘gem install sanitize’. It will fail, but do so anyway to bootstrap the process.
2) cd ~/.gem/ruby/1.8/gems/nokogiri-1.4.1/ext/nokogiri
3) vi extconf.rb; Find the HEADER_DIRS and LIB_DIRS arrays, and add /home/username/include and /home/username/lib to them respectively.
4) cd ../../
5) rake
6) gem spec ../../cache/nokogiri-1.4.1.gem —ruby > ../../specifications/nokogiri-1.4.1.gemspec

Note on #5: If running rake in nokogiri fails due to some missing dependencies, just gem install whatever it complains about, and try again. It should work eventually.

Note on #6: This is needed to let gem know that you’ve manually built nokogiri.

At this point, ‘gem install sanitize’ should work.

Installing 2.0

As of May 2011, these steps work for installing on DreamHost.

After going through the setup on DreamHost, I would say it’s a lot easier if you install tracks on a subdomain. First, by doing so, you can run it under a separate user account than what’s used for your root domain (See below why this is good). Second, if you want to use Passenger, you pretty much have to have the tracks application installed to the root directory of the website on DreamHost, otherwise, you’re limited to FastCGI only.

The steps I took to get it working at http://tracks.smajn.net were:

  • Added a subdomain with a new user account (SSH enabled) and Passenger enabled
  • Installed the RedCloth gem under the new account
    • gem install --no-ri --no-rdoc
  • Download and unpack the tracks application to the home directory
    • unzip bsag-tracks-v2.0-0-g22a0c94.zip
  • Edit site.yml and database.yml
  • Run your migration
    • rake db:migrate RAILS_ENV=production

Now, to get it working under Passenger, I did the following:

  • Rename /home/username/tracks.smajn.net to /home/username/tracks.smajn.net.bak
    • mv tracks.smajn.net tracks.smajn.net.bak
  • Linked bsag-tracks-22a0c94 to tracks.smajn.net
    • ln -s /home/username/bsag-tracks-22a0c94 /home/username/tracks.smajn.net

You can verify that Passenger is being used by accessing the app from the website and then look at the output of ps -AF from the shell, if you see Passenger ApplicationSpawner in the output, then it’s running under Passenger. On the other hand, if you see ruby dispatch.fcgi then it’s running under FastCGI.

should you run tracks under a separate user account?[/b] DreamHost runs a daemon that kills applications that use too much memory. From my testing, it appears that when you run multiple sites under the same user, for instance, a Rails application and a PHP application, then the Rails application will frequently get killed when the combined memory use exceeds somewhere in the neighborhood of 125MB. However, it appears that the daemon only monitors on a per user basis as I am able to run a Rails app under one user account, a Perl FastCGI app under another, and a PHP app under a third all simultaneously without issue.

http://wiki.dreamhost.com/Killed

Installing 2.2.1

As of May 2013, these steps work for installing on DreamHost.
I just tried for the whole afternoon on May-4, 2013 to install Tracks 2.2.1 on my Dreamhost account (tracks.dunjh.com). Basically I followed all above steps and they worked for me. So below I will write down what I’ve done and anything not clear please just send me mail.

Firstly, I installed 2.0 followed above step (mentioned in http://tracks.smajn.net), then following the upgrade guide in version 2.2.1/doc/upgrading.textile upgrade step by step from 2.0 → 2.1 → 2.1.4 → 2.2(not working because Dreamhost has only Ruby 1.8.7) → 2.2.1, and finally 2.2.1 is working well at the moment. But I believe if you want to install one on Dreamhost, you can safely start from 2.2.1 directly.

1. Added a subdomain with a new user account (SSH enabled) and Passenger enabled (Basically I didn’t use new user account, but according to above experience from smajn, it never hurts.)

2. Download and unpack the tracks application to the home directory (just use wget in putty, very simple, no need to download then ftp).
@wget https://github.com/TracksApp/tracks/archive/v2.2.1.zip

  • @unzip v2.2.1.zip

after setup the new subdomain, in my shell home folder, there’s a “tracks.dunjh.com” folder, basically you can delete it safely, and rename the unzipped tracks folder (might be named “tracks_2.2.1”) to tracks.dunjh.com, then you will have the “public” ready inside it.
3. Edit site.yml and database.yml, you need to create a mysql DB from the Dreamhost control panel, and set it in the database.yml “production” section. And make sure in database.yml you are using mysql2 as adapter.

4. Get all required gems (I don’t think Dreamhost likes this _, this step is quite slow), run @bundle install —without development test
5. Get your DB initialized, run @bundle exec rake db:migrate RAILS_ENV=production
6. Precompile your static assets (css, javascript, etc.) by running @bundle exec rake assets:precompile.
7. Now you are ready to rock&roll. Leave your putty alone. Go open your web browser, input the new subdomain you just created (e.g. in my case tracks.dunjh.com), if everything is fine, you’ll see the sign-up page of your new installed world available Tracks, create you account and you can start your GTD journey.
8. Basically upgrading is simple, but one thing you need to know is that if anything changed in your app folder, to make the passanger restart your application, you’ll need to “touch” the file tmp/restart.txt. This file does not exist in the folder in my case, so I just created one and then when you refresh the web page, the application is reloaded.
9. As I checked in Dreamhost it is using Ruby 1.8.7, and according to the release notes of Tracks 2.2.1, in next release it will not support 1.8.7 any more, so it is quite possible that I don’t need to upgrade any more, what a pity. Hopefully I could find some way to upgrade the ruby version in Dreamhost recently or I may block here for some time (or change to use VPS Orz…)

Updated for 2.2.2
Today (May-8, 2013) Tracks 2.2.2 is released as a hot security fix, I applied it to Dreamhost and it still works fine. So I believe the above paragraph should also work for 2.2.2, so if you deploy a new Tracks in Dreamhost, feel free to use 2.2.2 directly.

Clone this wiki locally