Installation Instructions

Version 18 (Admin Administrator, 05/15/2011 10:21 pm)

1 1 J. Simmons
h1. Installation Instructions
2 1 J. Simmons
3 2 J. Simmons
Open Design Engine (ODE) is based on "Redmine":http://redmine.org.  The official installation method is to install the "Bitnami Redmine Stack":http://bitnami.org/stack/redmine, apply some custom configuration to the stack, and then upgrade the installed Redmine instance to the ODE source code.  Support for other stacks (or bootstrapped installations) will come with future releases.  With luck, one or more of the stack providers will add ODE to their list of supported stacks.  
4 2 J. Simmons
5 7 J. Simmons
Note, these instructions assume you are running the Ubuntu VM image of the Bitnami Redmine Stack and are *running all commands under* @sudo@.  They were tested with "version 1.1.3":http://bitnami.org/files/stacks/redmine/1.1.3-0/bitnami-redmine-1.1.3-0-ubuntu-10.10.zip in "VMWare Player":http://www.vmware.com/products/player/. 
6 3 J. Simmons
7 3 J. Simmons
Useful Paths
8 4 J. Simmons
* @(bitnami_base) = /opt/bitnami@ in VM images
9 3 J. Simmons
10 3 J. Simmons
Steps to install ODE
11 3 J. Simmons
* Import the Bitnami Redmine Stack into VMWare (the free VMWare Player is supported)
12 3 J. Simmons
* Configure Redmine to run at http://hostname/ instead of http://hostname/redmine
13 4 J. Simmons
** Edit @(bitnami_base)/apache2/conf/httpd.conf@ and comment out the line:
14 3 J. Simmons
<pre>
15 5 J. Simmons
DocumentRoot "/opt/bitnami/apache2/htdocs"
16 1 J. Simmons
</pre>
17 5 J. Simmons
** Edit @(bitnami_base)/apps/redmine/conf/redmine.conf@ to match the following (the key areas are the addition of the virtual host section and changing all references of @/redmine@ to @/@):
18 5 J. Simmons
<pre>
19 5 J. Simmons
<VirtualHost *:80>
20 5 J. Simmons
  ServerAdmin haha.huhu.com
21 5 J. Simmons
  ServerName server.our.lan
22 5 J. Simmons
  ServerAlias server
23 5 J. Simmons
  ErrorLog "logs/error.log" 
24 5 J. Simmons
  CustomLog "logs/access.log" combined
25 5 J. Simmons
 # this not only blocks access to .svn directories, but makes it                
26 5 J. Simmons
 # appear as though they aren't even there, not just that they are              
27 5 J. Simmons
 # forbidden                                                                    
28 5 J. Simmons
 <DirectoryMatch "^/.*/\.svn/">
29 5 J. Simmons
    ErrorDocument 403 /404.html
30 5 J. Simmons
    Order allow,deny
31 5 J. Simmons
    Deny from all
32 5 J. Simmons
    Satisfy All
33 5 J. Simmons
  </DirectoryMatch>
34 5 J. Simmons
  # This passes through remote_user to mongrel                                  
35 5 J. Simmons
  RewriteEngine On
36 5 J. Simmons
  # Redirect non-static requests to cluster                                     
37 5 J. Simmons
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
38 5 J. Simmons
  RewriteRule ^/(.*)$ balancer://redminecluster%{REQUEST_URI} [P,QSA,L]
39 5 J. Simmons
</VirtualHost>
40 5 J. Simmons
41 5 J. Simmons
#ProxyPass / balancer://redminecluster
42 5 J. Simmons
#ProxyPassReverse / balancer://redminecluster
43 5 J. Simmons
44 5 J. Simmons
<Proxy balancer://redminecluster>
45 5 J. Simmons
  BalancerMember http://127.0.0.1:3001
46 5 J. Simmons
  BalancerMember http://127.0.0.1:3002
47 5 J. Simmons
  # The number of balancer members depends on the number of mongrels running
48 5 J. Simmons
  # We use only one mongrel on port 3001 by default for the BitNami Cloud Hosting
49 5 J. Simmons
  # Please remove the others like 3002 above in such a case.
50 5 J. Simmons
</Proxy>
51 5 J. Simmons
</pre>
52 6 J. Simmons
** Edit @(bitnami_base)/apps/redmine/config/mongrel_cluster.yml@ and change references to @prefix: /redmine@ to @prefix: @
53 5 J. Simmons
** Restart Redmine by running:
54 5 J. Simmons
<pre>
55 5 J. Simmons
(bitnami_base)/ctlscript stop
56 1 J. Simmons
(bitnami_base)/ctlscript start
57 7 J. Simmons
</pre>
58 13 J. Simmons
* Configure apache to host svn repositories using Redmine for user authentication
59 7 J. Simmons
** Install dependencies
60 7 J. Simmons
<pre>
61 7 J. Simmons
apt-get update
62 7 J. Simmons
apt-get install build-essential
63 7 J. Simmons
apt-get install zlib1g-dev
64 7 J. Simmons
(bitnami_base)/perl/bin/cpan  # accept defaults and choose CPAN servers
65 7 J. Simmons
cpan> install Test::Simple
66 7 J. Simmons
cpan> install DBI
67 7 J. Simmons
cpan> install DBD::mysql
68 7 J. Simmons
cpan> quit
69 8 J. Simmons
apt-get install libapache2-svn libapache-dbi-perl libapache2-mod-perl2 libdbd-mysql-perl libdigest-sha1-perl libauthen-simple-ldap-perl
70 8 J. Simmons
</pre>
71 8 J. Simmons
** Enable newly installed apache modules by editing @(bitnami_base)/apache/conf/httpd.conf@
72 8 J. Simmons
*** Uncomment approximately line 108:
73 8 J. Simmons
<pre>
74 8 J. Simmons
LoadModule dav_svn_module modules/mod_dav_svn.so
75 8 J. Simmons
</pre>
76 8 J. Simmons
*** Add a line at the end of the load modules list for mod_perl:
77 8 J. Simmons
<pre>
78 8 J. Simmons
LoadModule perl_module modules/mod_perl.so
79 5 J. Simmons
</pre>
80 9 J. Simmons
** Copy Redmine.pm into the perl library
81 9 J. Simmons
<pre>
82 9 J. Simmons
cp (bitnami_base)/apps/redmine/extra/svn/Redmine.pm (bitnami_base)/perl/lib/site_perl/5.8.8/i686-linux/Apache/
83 9 J. Simmons
</pre> 
84 9 J. Simmons
** Create the directory structure for the svn repositories (_Note, ODE is setup to store all project related content in the @(bitnami_base)@ directory, so it uses a non-traditional location to store the svn repositories._)
85 9 J. Simmons
<pre>
86 9 J. Simmons
cd (bitnami_base)
87 9 J. Simmons
mkdir repos
88 9 J. Simmons
chown root:daemon repos
89 9 J. Simmons
chmod 0755 repos
90 9 J. Simmons
cd repos
91 9 J. Simmons
mkdir svn
92 9 J. Simmons
chown root:daemon svn
93 9 J. Simmons
chmod 0750 svn
94 9 J. Simmons
</pre>
95 10 J. Simmons
** Document the following production values in @(bitnami_base)/apps/redmine/config/database.yml@:
96 9 J. Simmons
*** username
97 9 J. Simmons
*** password
98 9 J. Simmons
*** socket
99 9 J. Simmons
*** database
100 9 J. Simmons
*** host
101 1 J. Simmons
** Edit @(bitnami_base)/apps/redmine/conf/redmine.conf@ to configure apache to host the svn repositories
102 10 J. Simmons
*** Add the following line between @RewriteEngine On@ and the first @RewriteCond@ to prevent calls to svn from being forwarded to Redmine:
103 10 J. Simmons
<pre>
104 10 J. Simmons
RewriteCond %{REQUEST_URI} !/svn(/|$)
105 10 J. Simmons
</pre>
106 15 J. Simmons
*** Add the following line above the first @ProxyPass@ directive:
107 15 J. Simmons
<pre>
108 15 J. Simmons
ProxyPass /svn !
109 15 J. Simmons
</pre>
110 11 J. Simmons
*** Add the following directives to the end of @redmine.conf@ to enable svn over http (note the various fields that need to be updated with values for your installation, including the values you noted earlier from @database.yml@):
111 11 J. Simmons
<pre>
112 11 J. Simmons
# /svn location for users
113 11 J. Simmons
PerlLoadModule Apache::Redmine
114 11 J. Simmons
<Location /svn>
115 11 J. Simmons
  DAV svn
116 11 J. Simmons
  SVNParentPath "(bitnami_base)/repos/svn"
117 11 J. Simmons
  Order deny,allow
118 11 J. Simmons
  Deny from all
119 11 J. Simmons
  Satisfy any
120 11 J. Simmons
121 11 J. Simmons
  PerlAccessHandler Apache::Authn::Redmine::access_handler
122 11 J. Simmons
  PerlAuthenHandler Apache::Authn::Redmine::authen_handler
123 11 J. Simmons
  AuthType Basic
124 11 J. Simmons
  AuthName "Redmine SVN Repository"
125 11 J. Simmons
126 11 J. Simmons
  #read-only access   
127 11 J. Simmons
  <Limit GET PROPFIND OPTIONS REPORT>
128 11 J. Simmons
     Require valid-user
129 11 J. Simmons
     Allow from localhost
130 11 J. Simmons
     # Allow from another-ip
131 11 J. Simmons
     Satisfy any
132 11 J. Simmons
  </Limit>
133 11 J. Simmons
  # write access
134 11 J. Simmons
  <LimitExcept GET PROPFIND OPTIONS REPORT>
135 11 J. Simmons
    Require valid-user
136 11 J. Simmons
  </LimitExcept>
137 11 J. Simmons
138 11 J. Simmons
  ## for mysql
139 11 J. Simmons
  RedmineDSN "DBI:mysql:database=(database);host=(host);mysql_socket=(socket)"
140 11 J. Simmons
141 11 J. Simmons
  RedmineDbUser "(username)"
142 11 J. Simmons
  RedmineDbPass "(password)"
143 11 J. Simmons
</Location>
144 11 J. Simmons
</pre>
145 12 J. Simmons
** Restart Redmine by running:
146 12 J. Simmons
<pre>
147 12 J. Simmons
(bitnami_base)/ctlscript stop
148 12 J. Simmons
(bitnami_base)/ctlscript start
149 12 J. Simmons
</pre>
150 1 J. Simmons
* Configure Redmine to automatically create svn repositories
151 13 J. Simmons
** Activate SVN in Redmine
152 13 J. Simmons
*** Login to Redmine with an administrator account
153 13 J. Simmons
*** Goto Admin/Settings and select the Repositories tab
154 13 J. Simmons
*** Check "*Enable WS for repository management*"
155 13 J. Simmons
*** Click the "Generate a key" link and note the new API key for use below
156 13 J. Simmons
*** Make sure SVN is the only enabled SCM
157 13 J. Simmons
** Add the following to cron by calling @crontab -e@
158 13 J. Simmons
<pre>
159 18 Admin Administrator
*/2 * * * * (bitnami_base)/ruby/bin/ruby (bitnami_base)/apps/redmine/extra/svn/reposman.rb --redmine localhost --svn-dir (bitnami_base)/repos/svn --owner root --group daemon --command="(bitnami_base)/subversion/bin/svnadmin create --pre-1.6-compatible --fs-type fsfs" --url http://(server_public_fqdn)/svn --key=(API_Key) --verbose >> /var/log/reposman.log 2>&1 
160 1 J. Simmons
</pre>
161 16 J. Simmons
* Test SVN Functionality
162 16 J. Simmons
** Create a new Redmine project, making sure to select the *Repository* module, then wait for 2 minutes to give the cron job a chance to create the svn repository
163 16 J. Simmons
** Refresh the project page, and then browse to the new project's *Repository* tab.  You should see an empty repository display without any error messages
164 16 J. Simmons
** Confirm you can browse the new repository using svn by running the following command.  It should return without errors.
165 16 J. Simmons
<pre>
166 16 J. Simmons
svn ls http://(server_public_fqdn)/svn/(project_name)
167 16 J. Simmons
</pre>
168 16 J. Simmons
** Confirm you can add content to the svn repository through svn. 
169 16 J. Simmons
*** Add a user to the newly created project in Redmine (go to the *Settings* tab and then the *Members* sub-tab to add a user)
170 16 J. Simmons
*** Run the following command (note, you will be prompted for the Redmine user's password during this step):
171 16 J. Simmons
<pre>
172 16 J. Simmons
svn --username (user) -m "testing mkdir" mkdir http://(server_public_fqdn)/svn/(project_name)/testdir
173 16 J. Simmons
</pre>
174 16 J. Simmons
***  Refresh the project's *Repository* tab in Redmine and confirm the @testdir@ is present in the repository
175 17 J. Simmons
176 17 J. Simmons
Sources
177 17 J. Simmons
These installation instructions are based on a number of existing how-to's and postings on the internet.  The sources include:
178 17 J. Simmons
* http://wiki.bitnami.org/Applications/BitNami_Redmine_Stack#How_to_change_the_default_URL.3f
179 17 J. Simmons
* http://www.redmine.org/projects/redmine/wiki/HowTo_Automate_repository_creation
180 17 J. Simmons
* http://www.redmine.org/projects/redmine/wiki/Repositories_access_control_with_apache_mod_dav_svn_and_mod_perl
181 17 J. Simmons
* http://bitnami.org/forums/forums/redmine/topics/integrated-repository-control#post_9593
182 17 J. Simmons
* http://www.azazia.com/kb/entry/62/