forgot password?


   
 
HOWTO: Install tracks 1.7 on Ubuntu 10.04 with Apache and MySQL
Posted: 10 September 2010 01:18 AM   [ Ignore ]  
Newbie
Rank
Total Posts:  16
Joined  2010-07-27

I finally done it. I’m reporting here all the steps necessary in case someone wants to do it. It does not however install it on subdir (if someone knows how to, please add it here. I tried for hours and couldn’t do it)

These instructions work fine for a fresh install of Ubuntu 10.04 Desktop edition. they include installing Apache and MySQL too.


I’ve rewrote these instructions with tighten permissions and using subdir on the Tracks wiki and Ubuntu forums.



1 - Install all the dependencies

sudo tasksel install lamp-server
sudo aptitude install ruby libdbd-mysql-ruby rake libopenssl-ruby libapache2-mod-passenger libapache2-mod-fcgid 


2 - Download and set permissions for tracks

wget http://download.github.com/bsag-tracks-1.7.1-0-g13db454.zip
unzip ./bsag-tracks-1.7.1-0-g13db454.zip
sudo mv bsag-tracks-6aff172 /var/www/tracks
sudo chown -R www-data:root /var/www/tracks
sudo chmod -R 664 /var/www/tracks/
sudo chmod 755 /var/www/tracks
cd /var/www/tracks/
sudo find -type d -exec chmod a+'{}' \;
sudo chmod -R a+x script/* 


3 - Create MySQL database

sudo mysql -u root -p
mysql
CREATE DATABASE tracks;
Query OK1 row affected (0.03 sec)

mysqlGRANT ALL PRIVILEGES ON tracks.* TO 'trackuser'@'localhost' IDENTIFIED BY 'tracks' WITH GRANT OPTION;
Query OK0 rows affected (0.08 sec)

mysqlquit;
Bye 


4 - Configure tracks

sudo cp config/database.yml.tmpl config/database.yml
sudo cp config/site.yml.tmpl config/site.yml 

edit only the production section on the “database.yml” file (of course, use the password and username that you decided when creating the database on the previous step)

production:
  
adaptermysql
  database
tracks
  host
localhost
  username
tracksuser
  password
tracks 

on the file “site.yml” edit the following lines:

Choose a new salt word

salt"change-me" 

get the right time.

time_zone"UTC" 

You can see a list of right ones with the command

rake time:zones:local 


5 - Populate database

sudo rake db:migrate RAILS_ENV=production 


6 - Configure and restart apache

Edit “/etc/apache2/sites-available/default” to change the DocumentRoot

DocumenRoot /var/www/tracks/public/ 

Finally restart apache

sudo /etc/init.d/apache2 restart 

Open the URL http://localhost/ to start tracks.

This will make it wok. The permission could probably be a bit more tight. It also makes apache serving only Tracks which is definitely not-optimal.

Profile
 
 
Posted: 13 September 2010 07:31 AM   [ Ignore ]   [ # 1 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

nice howto. Perhaps you can repost to the wiki?

Profile
 
 
Posted: 13 September 2010 10:03 PM   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  16
Joined  2010-07-27
Reinier Balt - 13 September 2010 07:31 AM

nice howto. Perhaps you can repost to the wiki?

I will once I get everything working exactly as I want (but I’ll open a different thread for it). I just wanted to place it here as well or it might happen as previous howto where the links are dead now.


I added to the HOWTO installation of libapache2-mod-fcgid. It speeds up page loading incredibly. Each page takes 2 sec to load instead of 10-15 from before. It’s not required but makes a huge difference. No need to configure anything, simply install the module and restart apache.

Profile
 
 
Posted: 14 September 2010 08:25 AM   [ Ignore ]   [ # 3 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

I think in the howto above you install passenger, but you do not configure it. I guess using passenger you will get the same performance boost (i.e. removing the app startup time)

Profile
 
 
Posted: 23 September 2010 08:54 PM   [ Ignore ]   [ # 4 ]  
Newbie
Rank
Total Posts:  16
Joined  2010-07-27

I’ve tighten up the permissions and wrote an howto on the Tracks wiki and another on the Ubuntu forums.

I had some problems with the wiki syntax though. Specially on getting the code from the MySQL shell appear with monospace font in code block. Also, the content of database.yml doesn’t show up correctly inside code block because some lines start with spaces. If someone could fix those small style problems, it could be very useful for other people.

A major problem is that I can’t have ‘{}’ \; show up correctly on the wiki. If someone can fix that…

Profile