HowTo Install Redmine 25x on Ubuntu 1404 with Apache2 Phusion Passenger MySQL and Subversion » History » Version 3
Redmine Geist, 2014-07-25 14:46
1 | 1 | Redmine Geist | h1. HowTo Install Redmine 25x on Ubuntu 1404 with Apache2 Phusion Passenger MySQL and Subversion |
---|---|---|---|
2 | |||
3 | {{toc}} |
||
4 | |||
5 | h2. Installing Dependencys |
||
6 | |||
7 | <pre> |
||
8 | apt-get update && apt-get upgrade -y |
||
9 | |||
10 | 2 | Redmine Geist | sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server php5-mysql phpmyadmin libapache2-mod-perl2 libcurl4-openssl-dev libssl-dev apache2-prefork-dev libapr1-dev libaprutil1-dev libmysqlclient-dev libmagickcore-dev libmagickwand-dev curl git-core patch build-essential bison zlib1g-dev libssl-dev libxml2-dev libxml2-dev sqlite3 libsqlite3-dev autotools-dev libxslt1-dev libyaml-0-2 autoconf automake libreadline6-dev libyaml-dev libtool imagemagick apache2-utils |
11 | 1 | Redmine Geist | </pre> |
12 | |||
13 | I don't know if every package needed, but it works. |
||
14 | 2 | Redmine Geist | |
15 | h2. Installing Subversion |
||
16 | |||
17 | <pre> |
||
18 | sudo apt-get install subversion libapache2-svn |
||
19 | </pre> |
||
20 | 3 | Redmine Geist | |
21 | <pre> |
||
22 | sudo mkdir -p /var/lib/svn |
||
23 | sudo chown -R www-data:www-data /var/lib/svn |
||
24 | sudo a2enmod dav_svn |
||
25 | </pre> |
||
26 | |||
27 | Open config file |
||
28 | <pre> |
||
29 | sudo nano /etc/apache2/mods-enabled/dav_svn.conf |
||
30 | </pre> |
||
31 | |||
32 | Uncomment following lines |
||
33 | |||
34 | <pre> |
||
35 | <Location /svn> |
||
36 | DAV svn |
||
37 | SVNParentPath /var/lib/svn |
||
38 | AuthType Basic |
||
39 | AuthName "My repository" |
||
40 | AuthUserFile /etc/apache2/dav_svn.passwd |
||
41 | AuthzSVNAccessFile /etc/apache2/dav_svn.authz |
||
42 | <LimitExcept GET PROFIND OPTIONS REPORT> |
||
43 | Require valid-user |
||
44 | </LimitExcept> |
||
45 | </Location> |
||
46 | </pre> |
||
47 | |||
48 | <pre> |
||
49 | sudo a2enmod authz_svn |
||
50 | </pre> |
||
51 | |||
52 | Add the redmine user for reading from repository |
||
53 | <pre> |
||
54 | sudo htpasswd -c /etc/apache2/dav_svn.passwd redmine |
||
55 | |||
56 | sudo service apache2 restart |
||
57 | </pre> |
||
58 | |||
59 | Create the repository |
||
60 | sudo svnadmin create --fs-type fsfs /var/lib/svn/my_repository |
||
61 | sudo chown -R www-data:www-data /var/lib/svn |
||
62 | |||
63 | Open file for configuration of repository access |
||
64 | <pre> |
||
65 | sudo nano /etc/apache2/dav_svn.authz |
||
66 | </pre> |
||
67 | |||
68 | Add access rights for redmine to the repository in the config file |
||
69 | <pre> |
||
70 | [my_repository:/] |
||
71 | redmine = r |
||
72 | </pre> |
||
73 | |||
74 | h2. Installing Ruby and Ruby on Rails |
||
75 | |||
76 | h3. Redmine |
||
77 | |||
78 | <pre> |
||
79 | sudo apt-get install ruby1.9.3 ruby1.9.1-dev ri1.9.1 libruby1.9.1 libssl-dev zlib1g-dev |
||
80 | sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 \ |
||
81 | --slave /usr/share/man/man1/ruby.1.gz ruby.1.gz \ |
||
82 | /usr/share/man/man1/ruby1.9.1.1.gz \ |
||
83 | --slave /usr/bin/ri ri /usr/bin/ri1.9.1 \ |
||
84 | --slave /usr/bin/irb irb /usr/bin/irb1.9.1 \ |
||
85 | --slave /usr/bin/rdoc rdoc /usr/bin/rdoc1.9.1 |
||
86 | |||
87 | sudo gem update |
||
88 | sudo gem install bundler |
||
89 | </pre> |
||
90 | |||
91 | h2. Installing of Redmine |
||
92 | |||
93 | Exampe for version 2.5.2, change the version number for other releases |
||
94 | |||
95 | <pre> |
||
96 | cd /usr/share |
||
97 | sudo wget http://www.redmine.org/releases/redmine-2.5.2.tar.gz |
||
98 | sudo tar xvfz redmine-2.5.2.tar.gz |
||
99 | sudo rm redmine-2.5.2.tar.gz |
||
100 | sudo mv redmine-2.5.2 redmine |
||
101 | sudo chown -R root:root /usr/share/redmine |
||
102 | sudo chown www-data /usr/share/redmine/config/environment.rb |
||
103 | sudo ln -s /usr/share/redmine/public /var/www/html/redmine |
||
104 | </pre> |
||
105 | |||
106 | h3. MySQL |
||
107 | |||
108 | <pre> |
||
109 | mysql -u root -p |
||
110 | </pre> |
||
111 | |||
112 | Execute following lines to MySQL |
||
113 | |||
114 | <pre> |
||
115 | CREATE DATABASE redmine character SET utf8; |
||
116 | CREATE user 'redmine'@'localhost' IDENTIFIED BY 'my_password'; |
||
117 | GRANT ALL privileges ON redmine.* TO 'redmine'@'localhost'; |
||
118 | exit |
||
119 | </pre> |
||
120 | |||
121 | Configure Redmine database connection |
||
122 | |||
123 | <pre> |
||
124 | sudo cp redmine/config/database.yml.example redmine/config/database.yml |
||
125 | </pre> |
||
126 | |||
127 | Open database config file |
||
128 | |||
129 | <pre> |
||
130 | sudo nano redmine/config/database.yml |
||
131 | </pre> |
||
132 | |||
133 | Change the username and the password in the config file |
||
134 | |||
135 | <pre> |
||
136 | database.yml: |
||
137 | production: |
||
138 | adapter: mysql2 |
||
139 | database: redmine |
||
140 | host: localhost |
||
141 | username: redmine |
||
142 | password: my_password |
||
143 | encoding: utf8 |
||
144 | </pre> |
||
145 | |||
146 | h3. Configuration |
||
147 | |||
148 | <pre> |
||
149 | cd /usr/share/redmine/ |
||
150 | sudo bundle install --without development test postgresql sqlite |
||
151 | sudo rake generate_secret_token |
||
152 | sudo RAILS_ENV=production rake db:migrate |
||
153 | sudo RAILS_ENV=production rake redmine:load_default_data |
||
154 | sudo mkdir public/plugin_assets |
||
155 | sudo chown -R www-data:www-data files log tmp public/plugin_assets |
||
156 | sudo chmod -R 755 files log tmp public/plugin_assets |
||
157 | </pre> |
||
158 | |||
159 | h2. Installing Phusion Passenger |
||
160 | |||
161 | h3. Add repository |
||
162 | |||
163 | Add repository for Phusion Passenger |
||
164 | |||
165 | <pre> |
||
166 | sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 561F9B9CAC40B2F7 |
||
167 | sudo apt-get install apt-transport-https ca-certificates |
||
168 | </pre> |
||
169 | |||
170 | Open repository config file |
||
171 | |||
172 | <pre> |
||
173 | sudo nano /etc/apt/sources.list.d/passenger.list |
||
174 | </pre> |
||
175 | |||
176 | Add following repository source |
||
177 | |||
178 | <pre> |
||
179 | deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main |
||
180 | </pre> |
||
181 | |||
182 | <pre> |
||
183 | sudo chown root: /etc/apt/sources.list.d/passenger.list |
||
184 | sudo chmod 600 /etc/apt/sources.list.d/passenger.list |
||
185 | </pre> |
||
186 | |||
187 | h3. Installing |
||
188 | |||
189 | <pre> |
||
190 | sudo apt-get update |
||
191 | sudo apt-get install libapache2-mod-passenger |
||
192 | </pre> |
||
193 | |||
194 | h3. Configuration |
||
195 | |||
196 | Open passenger config file |
||
197 | |||
198 | <pre> |
||
199 | sudo nano /etc/apache2/mods-available/passenger.conf |
||
200 | </pre> |
||
201 | |||
202 | Add following line to passenger config file |
||
203 | |||
204 | <pre> |
||
205 | PassengerDefaultUser www-data |
||
206 | </pre> |
||
207 | |||
208 | Open apache2 config file |
||
209 | |||
210 | <pre> |
||
211 | sudo nano /etc/apache2/sites-available/000-default.conf |
||
212 | </pre> |
||
213 | |||
214 | Add following part to apache2 config file |
||
215 | <pre> |
||
216 | <Directory /var/www/html/redmine> |
||
217 | RailsBaseURI /redmine |
||
218 | PassengerResolveSymlinksInDocumentRoot on |
||
219 | </Directory> |
||
220 | </pre> |
||
221 | |||
222 | <pre> |
||
223 | sudo a2enmod passenger |
||
224 | sudo service apache2 restart |
||
225 | </pre> |
||
226 | |||
227 | h2. Start Redmine |
||
228 | |||
229 | Remine should now available at your host |
||
230 | |||
231 | <pre> |
||
232 | http://yourhost/redmine |
||
233 | </pre> |
||
234 | |||
235 | Login data: |
||
236 | Username: admin |
||
237 | Password: admin |
||
238 | |||
239 | h2. e-Mail configuration |
||
240 | |||
241 | Example for smtp and encryption |
||
242 | |||
243 | Open redmine config file |
||
244 | |||
245 | <pre> |
||
246 | sudo nano /usr/share/redmine/config/configuration.yml |
||
247 | </pre> |
||
248 | |||
249 | Add following to redmine config file |
||
250 | |||
251 | <pre> |
||
252 | # Outgoing email settings |
||
253 | |||
254 | production: |
||
255 | email_delivery: |
||
256 | delivery_method: :smtp |
||
257 | smtp_settings: |
||
258 | enable_starttls_auto: true |
||
259 | address: smtp.host.com |
||
260 | port: 587 |
||
261 | domain: host.com |
||
262 | authentication: :login |
||
263 | user_name: myname |
||
264 | password: mypassword |
||
265 | </pre> |
||
266 | |||
267 | You can check the e-Mail config in web interface with testmail function |
||
268 | |||
269 | h2. Autoupdate Subversion repository view |
||
270 | |||
271 | In the project archive settings over web interface its needed to enable the web service for project archives and generate a api key |
||
272 | |||
273 | The following cronjob updates redmine to current subversion changesets every 15 minutes |
||
274 | |||
275 | <pre> |
||
276 | sudo crontab -e |
||
277 | </pre> |
||
278 | |||
279 | Add the cronjob |
||
280 | |||
281 | <pre> |
||
282 | */15 * * * * curl "http://yourhost/redmine/sys/fetch_changesets?key=APIKEY" > /dev/null |
||
283 | </pre> |