One thing I love about Debian is the apt-get package management system; today made me realize just how much I admire it. There is no Debian package for Tracks, and no package for RubyGems, one of the programs essential for running Tracks. This meant that the installation took quite a bit of fiddling (even with the Debian Tracks walkthrough).
Tracks needs a number of different components to work properly:
- Ruby - available as a package in Debian
- RubyGems - a package management system for Ruby (not available as a Debian package)
- Rails - installed via RubyGems (not via the Debian Rails package, at least according to here)
- A web server (e.g. Apache 1.3) - available as a package in Debian
- A database (e.g. MySql 4.1) - available as a package in Debian
- The Tracks program - available here (not available as a Debian package)
1) Downloaded Tracks and uncompressed it to a directory in my home directory ("unzip tracks-1.03.zip").
2) Installed MySql 4.1 via the mysql-server-4.1 package ("apt-get install mysql-server-4.1"). To configure MySql I first added root passwords
shell> mysql -u rootand then created a new user and a database for Tracks to use (the user was created for security reasons; see here for a full post on the topic).
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd');
mysql> SET PASSWORD FOR 'root'@'%' = PASSWORD('newpwd');
mysql> grant CREATE,INSERT,DELETE,UPDATE,SELECT on tracks.* to tracksuser@localhost identified by 'password';After the user and database were created, I populated the database with pre-existing data provided by the Tracks install (running the following commands from the tracks/db folder):
mysql -u tracksuser -p tracks < tracks_1.0.3_mysql.sql[note: I first tried to install the mysql-server package (which installs MySql 4.0), but ran into bug 321578, and after that kept getting a "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)" error that prevented the server from starting, which I couldn't work around. Installing MySql 4.1 overcame this problem. The MySql reference manual was very helpful for all of the MySql configuration.]
mysql -u tracksuser -p tracks < tracks_1.0.3_content.sql
3) I installed the Ruby package ("apt-get install ruby"), and then downloaded RubyGems 0.8.11 from here. After uncompressing the file ("tar -xvvfz rubygems-0.8.11.tgz") I installed it using the command "ruby setup.rb" from inside the RubyGems directory.
4) Once RubyGems was installed, I used that to install bluecloth, rails, and Ruby's mysql ("gems install bluecloth", "gems install rails --include-dependencies", and "gems install mysql"). The rails and mysql installs failed initially, but I found this post which provided a good walkthrough for the installation of rails. In short, I had to install many Debian packages, including libopenssl-ruby, liberb-ruby, libdbd-mysql-ruby, libmysqlclient14-dev, libzlib-ruby, rdoc, irb, ri1.8, and ruby1.8-dev. I also installed the Debian package for rails, but then uninstalled it ("apt-get remove rails"). After all these other packages were installed I was finally able to install bluecloth, rails, and Ruby's mysql. I also updated RubyGems by running the command "gem update --system".
5) I then configured Apache by adding the following to my httpd.conf file:
Options ExecCGI FollowSymLinks
Allow from all
6) To start Tracks I ran "ruby script/server --environment=production" from the tracks directory (no need to be root for this). This puts a lot of output directly into the terminal window (good for debugging, bad for everyday use) and doesn't background the process. So far my solution to this is to run it in the background while outputting to a log file ("ruby script/server --environment=production &> tracksdirectorypath/log/output.log &"). I'm still trying to find a way to start the program automatically whenever the computer starts; I should probably write an init.d script (as mentioned here).
7) I then went to http://0.0.0.0:3000/signup, created my login, and was able to use the program. Unfortunately, I spent a while thinking I had something misconfigured because I was trying to create my root login account via the http://0.0.0.0:3000/ page, which kept reporting a "Login unsuccessful" message. The manual nicely corrected me (once I bothered to re-read that portion of it).
Considering that I probably spent more than four hours trying to get the install working, I haven't had much time to play with the program. One very nice feature is that I can access my Tracks install from over the network, meaning that I'll be able to host it on my Debian box here at home but still use it from my Windows box at work (or any computer that I'm on).
I'm already impressed with the elegance and clean design of the program; it's very easy to use, and I think it might really help me keep track of things.
[Final note: Keep in mind that I'm a novice at Debian, so take all this advice with a grain of salt.]