Install-log » History » Version 1
Anthony Mallet, 2013-12-03 13:28
1 | 1 | Anthony Mallet | h1. Installation log |
---|---|---|---|
2 | |||
3 | {{collapse(gitolite) |
||
4 | |||
5 | * Create a @git@ user |
||
6 | <pre> |
||
7 | # useradd -d /opt/git ... git |
||
8 | </pre> |
||
9 | |||
10 | * Get current gitolite code |
||
11 | <pre> |
||
12 | # su - git |
||
13 | % mkdir $HOME/bin $HOME/src |
||
14 | % cd $HOME/src |
||
15 | % git clone git://github.com/sitaramc/gitolite |
||
16 | % $HOME/src/gitolite/install -to $HOME/bin |
||
17 | </pre> |
||
18 | |||
19 | * Configure an admin key, will be used later by redmine |
||
20 | <pre> |
||
21 | % gitolite setup -pk /some/where/id_dsa.pub |
||
22 | </pre> |
||
23 | }} |
||
24 | |||
25 | {{collapse(postgres) |
||
26 | * Create a redmine user and the database |
||
27 | <pre> |
||
28 | % psql -U ... |
||
29 | % create role redmine login encrypted password '...secret...' noinherit valid until 'infinity'; |
||
30 | % create database redmine with encoding='UTF8' owner=redmine; |
||
31 | % [this is the default, but to be sure: ALTER DATABASE "redmine" SET datestyle="ISO,MDY"; |
||
32 | </pre> |
||
33 | }} |
||
34 | |||
35 | {{collapse(redmine) |
||
36 | * Install dependencies |
||
37 | <pre> |
||
38 | % su - |
||
39 | # yum install curl-devel openssl-devel |
||
40 | # yum install httpd-devel apr-devel apr-util-devel |
||
41 | # yum install ruby-devel rubygems rubygem-rake ImageMagick-devel |
||
42 | # gem install bundler |
||
43 | </pre> |
||
44 | |||
45 | * Create a redmine user |
||
46 | <pre> |
||
47 | % useradd -d /opt/redmine ... redmine |
||
48 | % su - redmine |
||
49 | # mkdir src gems files logs |
||
50 | </pre> |
||
51 | |||
52 | * Get current redmine code - hosted in the @redmine-laas@ project, branch @laas@. |
||
53 | <pre> |
||
54 | # cd src |
||
55 | # git clone git://redmine.laas.fr/redmine-laas/redmine |
||
56 | # git checkout laas |
||
57 | </pre> |
||
58 | |||
59 | * Note that the @log@ and @plugin@ directories are symlinks to @$HOME@, for easier upgrades. |
||
60 | |||
61 | * Configure a few files, samples are provided in the @.example@ files at the same place. |
||
62 | <pre> |
||
63 | # emacs config/database.yml |
||
64 | # emacs config/configuration.yml |
||
65 | # emacs config/additional_environment.rb |
||
66 | </pre> |
||
67 | |||
68 | * Install some gems locally |
||
69 | <pre> |
||
70 | # bundle install --path /opt/redmine/gems --without development test |
||
71 | Your bundle is complete! |
||
72 | </pre> |
||
73 | |||
74 | * Setup PATHs etc. |
||
75 | <pre> |
||
76 | # emacs ~/.profile |
||
77 | + export PATH=opt/redmine/gems/ruby/1.8/bin:/bin:/sbin:/usr/bin:/usr/sbin |
||
78 | + export GEM_PATH=/opt/redmine/gems/ruby/1.8 |
||
79 | </pre> |
||
80 | |||
81 | rake generate_secret_token |
||
82 | RAILS_ENV=production rake db:migrate |
||
83 | RAILS_ENV=production rake redmine:load_default_data |
||
84 | + [en] |
||
85 | }} |
||
86 | |||
87 | # test on http://localhost:3000 with: |
||
88 | ruby script/rails server webrick -e production |
||
89 | |||
90 | |||
91 | passenger-install-apache2-module |
||
92 | |||
93 | |||
94 | # plugins |
||
95 | cd ~/plugins |
||
96 | git clone git://github.com/thorin/redmine_ldap_sync |
||
97 | git clone git://github.com/jbox-web/redmine_git_hosting |
||
98 | git clone git://github.com/jbox-web/redmine_plugin_views_revisions |
||
99 | cd ~/src/redmine |
||
100 | bundle install |
||
101 | RAILS_ENV=production rake redmine:plugins:migrate |
||
102 | RAILS_ENV=production rake redmine:plugins:process_version_change |
||
103 | |||
104 | |||
105 | # redmine + gitolite |
||
106 | su - redmine |
||
107 | mkdir .ssh |
||
108 | ssh-keygen -N '' -f ~/.ssh/gitolite_admin_rsa |
||
109 | emacs config |
||
110 | + Host localhost |
||
111 | + User git |
||
112 | + IdentityFile /opt/redmine/.ssh/gitolite_admin_rsa |
||
113 | + IdentitiesOnly yes |
||
114 | |||
115 | echo "setup RW+ access to gitolite-admin for redmine" | brain |
||
116 | |||
117 | sudo visudo |
||
118 | + redmine ALL=(git) NOPASSWD:ALL |
||
119 | + git ALL=(redmine) NOPASSWD:ALL |
||
120 | |||
121 | git config --global user.email "redmine@laas.fr" |
||
122 | git config --global user.name "Redmine" |
||
123 | |||
124 | # test with: |
||
125 | ssh localhost info |
||
126 | -> R W gitolite-admin |
||
127 | |||
128 | |||
129 | # apache |
||
130 | su - |
||
131 | emacs /etc/httpd/conf/httpd.conf |
||
132 | + NameVirtualHost *:80 |
||
133 | + NameVirtualHost [::]:80 |
||
134 | + NameVirtualHost *:443 |
||
135 | + NameVirtualHost [::]:443 |
||
136 | |||
137 | emacs /etc/httpd/conf.d/redmine.conf |
||
138 | + <VirtualHost *:443 [::]:443> |
||
139 | + SSLEngine on |
||
140 | + SSLCertificateFile /etc/pki/tls/certs/localhost.crt |
||
141 | + SSLCertificateKeyFile /etc/pki/tls/private/localhost.key |
||
142 | + |
||
143 | + ServerName redmine.laas.fr |
||
144 | + ServerAdmin sysadmin@laas.fr |
||
145 | + DocumentRoot /opt/redmine/src/redmine/public |
||
146 | + ErrorLog /opt/redmine/logs/httpd-errors |
||
147 | + CustomLog /opt/redmine/logs/httpd-access common |
||
148 | + |
||
149 | + LoadModule passenger_module /opt/redmine/gems/ruby/1.8/gems/passenger-4.0.2\ |
||
150 | + 4/buildout/apache2/mod_passenger.so |
||
151 | + PassengerRoot /opt/redmine/gems/ruby/1.8/gems/passenger-4.0.24 |
||
152 | + PassengerDefaultRuby /usr/bin/ruby |
||
153 | + PassengerDefaultUser redmine |
||
154 | + |
||
155 | + <Directory /opt/redmine/src/redmine/public> |
||
156 | + AllowOverride all |
||
157 | + Options -MultiViews |
||
158 | + Allow from all |
||
159 | + </Directory> |
||
160 | + </VirtualHost> |
||
161 | + |
||
162 | + <VirtualHost *:80 [::]:80> |
||
163 | + ServerName redmine.laas.fr |
||
164 | + Redirect permanent / https://redmine.laas.fr/ |
||
165 | + </VirtualHost> |
||
166 | |||
167 | /etc/init.d/httpd reload |
||
168 | |||
169 | # to restart redmine (works for any RoR software): |
||
170 | touch /opt/redmine/src/redmine/tmp/restart.txt |