Project

General

Profile

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

mark edwards, 2013-09-06 05:38

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