Installation Instructions

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