Project

General

Profile

Installing the Tapestry application » History » Version 23

Tom Clegg, 09/22/2011 12:13 AM

1 20 Tom Clegg
h1. Installing the Tapestry application
2 1 Tom Clegg
3 2 Tom Clegg
Install ruby .deb from http://www.rubyenterpriseedition.com/download.html
4 1 Tom Clegg
5 22 Tom Clegg
Install rails.
6 1 Tom Clegg
7 22 Tom Clegg
 sudo gem install rails
8 1 Tom Clegg
sudo gem install passenger
9
sudo /usr/local/bin/passenger-install-apache2-module
10
11
Add stuff (as provided by passenger-install) to your conf.d/passenger.conf
12
13
<pre>
14 23 Tom Clegg
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
15
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.9
16 1 Tom Clegg
PassengerRuby /usr/local/bin/ruby
17
RackEnv "development"
18
</pre>
19 22 Tom Clegg
20
Install some prerequisites for gems.
21
22
 sudo apt-get install libxslt-dev libxml2-dev
23 1 Tom Clegg
24 21 Tom Clegg
Check out git repo from git@git.clinicalfuture.com:tapestry.git to somewhere -- say, /var/www/tapestry.example.org
25 1 Tom Clegg
26 12 Ward Vandewege
Then execute:
27 1 Tom Clegg
28 12 Ward Vandewege
 sudo bundle install
29
30 2 Tom Clegg
If that fails, you might need to fix some dependencies like these ones, then repeat bundle install:
31 1 Tom Clegg
32 2 Tom Clegg
 sudo apt-get install libxml2-dev libxslt-dev
33 1 Tom Clegg
34 3 Tom Clegg
Point a virtualhost to the @public@ dir in your git repo
35 2 Tom Clegg
36 1 Tom Clegg
<pre>
37
<VirtualHost *:80>
38 21 Tom Clegg
   ServerName tapestry.example.org
39
   DocumentRoot /var/www/tapestry.example.org/public
40
   <Directory /var/www/tapestry.example.org/public>
41 1 Tom Clegg
         AllowOverride all
42
         Options -MultiViews
43
   </Directory>
44
</VirtualHost>
45
</pre>
46 4 Tom Clegg
47 14 Tom Clegg
Copy @config/database.example@ to @config/database.yml@ and edit to suit. Make sure to select mysql as the database server.  Generate a password using @pwgen 12 1@ or @head -c12345 /dev/urandom|md5sum|head -c12;echo@.  For example:
48 1 Tom Clegg
49 14 Tom Clegg
 development:
50
  adapter: mysql
51
  server: localhost
52 15 Tom Clegg
  database: mypg
53
  username: mypg
54 14 Tom Clegg
  password: c16fbe415d29
55
  timeout: 5000
56
57 18 Madeleine Ball
Copy @config/environments/development.rb.sample@ to @config/environments/development.rb@ and edit to suit.  In particular the ROOT_URL (you may skip the "http://" prefix):
58 16 Tom Clegg
59 18 Madeleine Ball
 ROOT_URL = 'your.vhost.name'
60 14 Tom Clegg
61
Set up the database:
62 1 Tom Clegg
63
 rake db:setup
64 19 Madeleine Ball
rake db:schema:load
65 18 Madeleine Ball
66 1 Tom Clegg
Set up data directory (replace USERNAME with the user who owns the GIT directory this code is in, and ROOT_URL matching the one above):
67 19 Madeleine Ball
68 18 Madeleine Ball
 sudo mkdir -p /data/ROOT_URL
69 19 Madeleine Ball
sudo chown -R USERNAME:USERNAME /data/ROOT_URL
70 1 Tom Clegg
71
After you do a git pull, you'll probably want to do
72 8 Tom Clegg
73 10 Ward Vandewege
  rake db:migrate
74
75
to bring your database up to the latest release.
76 12 Ward Vandewege
77
If the Gemfile has changed, you will also have to run
78
79
  sudo bundle install