Project

General

Profile

HowTo Install Redmine 231 On Ubuntu 1204 with git and Redmine Git Hosting plugin » History » Version 18

mark edwards, 2014-04-22 08:37

1 1 Yovav Cohen Tene
h1. HowTo Install Redmine 231 On Ubuntu 1204 clean installation with git and Redmine Git Hosting plugin
2
3 17 Christopher Semmler
{{toc}}
4
5 1 Yovav Cohen Tene
h2. Installing LAMP
6 2 Yovav Cohen Tene
7 1 Yovav Cohen Tene
<pre>
8
apt-get update && apt-get upgrade -y
9
apt-get install tasksel
10 3 Yovav Cohen Tene
tasksel
11 1 Yovav Cohen Tene
</pre>
12
13 3 Yovav Cohen Tene
choose LAMP server and choose a password for MySQL root account
14
 
15
h2. Installing Packages
16
17
<pre>
18 8 Yovav Cohen Tene
apt-get install ruby rubygems libruby libapache2-mod-passenger ruby-dev libmysqlclient-dev libmagickcore-dev libmagickwand-dev git git-core -y
19 6 Yovav Cohen Tene
</pre>
20 1 Yovav Cohen Tene
21 17 Christopher Semmler
*Reboot your machine!*
22 3 Yovav Cohen Tene
23
h2. Installing Redmine
24
25
<pre>
26
cd /tmp
27 16 sugeng tigefa
wget http://www.redmine.org/releases/redmine-2.3.4.tar.gz
28
tar -xzvf redmine-2.3.4.tar.gz
29
mv redmine-2.3.4 /usr/local/share/redmine-2.3.4
30 3 Yovav Cohen Tene
ln -s /usr/local/share/redmine-2.3.1 /usr/local/share/redmine
31 4 Yovav Cohen Tene
chown -R root:root /usr/local/share/redmine-2.3.4
32 1 Yovav Cohen Tene
gem install bundler
33 13 mark edwards
34 17 Christopher Semmler
(Note: I found this extra step from shah helpful:  gem install rdp-mysql2 )
35 13 mark edwards
36 4 Yovav Cohen Tene
cd /usr/local/share/redmine/
37
 
38 1 Yovav Cohen Tene
bundle install --without development test postgresql sqlite
39 4 Yovav Cohen Tene
</pre>
40
41 17 Christopher Semmler
h2. Setting up Redmine user and database in MySQL
42 4 Yovav Cohen Tene
43
<pre>
44
mysql -u root -p
45
</pre>
46
<pre>
47
CREATE DATABASE redmine CHARACTER SET utf8;
48
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
49 5 Yovav Cohen Tene
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
50 1 Yovav Cohen Tene
</pre>
51 5 Yovav Cohen Tene
52
h2. Configuration
53 1 Yovav Cohen Tene
54 17 Christopher Semmler
h3. File permissions
55 8 Yovav Cohen Tene
56
<pre>
57
useradd redmine
58
mkdir -p tmp tmp/pdf public/plugin_assets
59
sudo chown -R redmine:redmine files log tmp public/plugin_assets
60
sudo chmod -R 755 files log tmp public/plugin_assets
61
</pre>
62 5 Yovav Cohen Tene
Copy /usr/local/share/redmine/config/database.yml.example to /usr/local/share/redmine/config/database.yml and edit this file in order to configure your database settings for "production" environment.
63
Example for a MySQL database using ruby1.8 or jruby:
64
<pre>
65
production:
66
  adapter: mysql2      (note: For Rails < 3.1 use mysql instead of mysql2)
67
  database: redmine
68
  host: localhost
69
  username: redmine
70
  password: my_password
71
</pre>
72
73
Generate a session store secret:
74 1 Yovav Cohen Tene
<pre>
75 5 Yovav Cohen Tene
rake generate_secret_token
76
</pre>
77
78 1 Yovav Cohen Tene
<pre>
79 17 Christopher Semmler
(Note - do this upon error message about mysql2:    bundle install   )
80 1 Yovav Cohen Tene
</pre>
81
82 15 mark edwards
83
Generate the database structure:
84 1 Yovav Cohen Tene
<pre>
85 16 sugeng tigefa
bundle exec rake db:migrate RAILS_ENV=production
86 14 mark edwards
</pre>
87 15 mark edwards
88 5 Yovav Cohen Tene
Generate default configuration data:
89
<pre>
90 16 sugeng tigefa
bundle exec rake redmine:load_default_data RAILS_ENV=production
91 5 Yovav Cohen Tene
</pre>
92
(using “es” for Spanish language in terminal prompt)
93
94
h4. Database encryption
95
96 18 mark edwards
If you want to encrypt your redmine database user passwords do as follows:
97 5 Yovav Cohen Tene
98
# Copy the default config file @/usr/local/share/redmine/config/configuration.yml.example@ to @/usr/local/share/redmine/config/configuration.yml@
99
# Edit configuration.yml and create a cipher key there for the environment you've used so thus far - production. Be sure to read the comment in this file. They are very detailed and there for you.
100
# Run: <pre>
101 16 sugeng tigefa
bundle exec rake db:encrypt RAILS_ENV=production
102 7 Yovav Cohen Tene
</pre>
103
104
h2. Apache
105 1 Yovav Cohen Tene
106
Setup Apache’s VirtualHost config
107 8 Yovav Cohen Tene
<pre>
108
vim /etc/apache2/sites-available/redmine.example.com
109 11 Yovav Cohen Tene
</pre>
110
111 7 Yovav Cohen Tene
<pre>
112 17 Christopher Semmler
# 8080 just in this case; it is because we use a reverse proxy before Apache. Otherwise simply use the standard "*:80"
113 7 Yovav Cohen Tene
114
<VirtualHost *:8080>
115
 ServerName redmine.example.com
116 1 Yovav Cohen Tene
 DocumentRoot /usr/local/share/redmine/public
117
 <Directory /usr/local/share/redmine/public>
118
   AllowOverride all
119
   Options -MultiViews
120
 </Directory>
121 7 Yovav Cohen Tene
</VirtualHost>
122
</pre>
123 10 Yovav Cohen Tene
124 17 Christopher Semmler
(Note: That didnt work out for me, so I played it fast and loose by killing the 'default' file and using the 'modified 
125
  default' from  http://imsunnyshah.wordpress.com/2013/04/29/how-to-setup-redmine-2-3-0-on-ubuntu-12-10/  )
126 10 Yovav Cohen Tene
127 17 Christopher Semmler
*TODO:: The redmine installation works, but user editing return an error when using Passenger and adding Git Plugin*
128 10 Yovav Cohen Tene
129 17 Christopher Semmler
Once you enable this Virtual Host (a2ensite redmine.example.com) and reload Apache (apache2ctl graceful), you should see your site running on http://redmine.example.com.
130 7 Yovav Cohen Tene
131 17 Christopher Semmler
The default login/password is admin/admin (*don't forget to change this*).
132 7 Yovav Cohen Tene
133
h2. Sources of inspiration
134
135
We used the following resources as a starting point. Thanks to their respective authors.
136
137
* http://madpropellerhead.com/random/20100820-installing-redmine-on-debian-with-apache (outdated, for Lenny)
138
* http://www.redmine.org/projects/redmine/wiki/RedmineInstall
139
* http://hodza.net/2012/03/15/howto-install-redmine-on-debian-6-squeeze-ruby-on-rails-apache2-passenger/
140
* http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger