Project

General

Profile

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

Jan Niggemann (redmine.org team member), 2014-06-01 20:44
some random minor corrections

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 19 Jan Niggemann (redmine.org team member)
It is not necessary to 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 19 Jan Niggemann (redmine.org team member)
People may find the following 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 1 Yovav Cohen Tene
bundle exec rake redmine:load_default_data RAILS_ENV=production
91
</pre>
92 5 Yovav Cohen Tene
93 19 Jan Niggemann (redmine.org team member)
h4. Encrypt SCM and LDAP passwords
94 5 Yovav Cohen Tene
95 19 Jan Niggemann (redmine.org team member)
If you want to encrypt SCM and LDAP passwords do as follows:
96 5 Yovav Cohen Tene
97
# Copy the default config file @/usr/local/share/redmine/config/configuration.yml.example@ to @/usr/local/share/redmine/config/configuration.yml@
98
# 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.
99
# Run: <pre>
100 16 sugeng tigefa
bundle exec rake db:encrypt RAILS_ENV=production
101 7 Yovav Cohen Tene
</pre>
102
103
h2. Apache
104 1 Yovav Cohen Tene
105
Setup Apache’s VirtualHost config
106 8 Yovav Cohen Tene
<pre>
107
vim /etc/apache2/sites-available/redmine.example.com
108 11 Yovav Cohen Tene
</pre>
109
110 7 Yovav Cohen Tene
<pre>
111 17 Christopher Semmler
# 8080 just in this case; it is because we use a reverse proxy before Apache. Otherwise simply use the standard "*:80"
112 7 Yovav Cohen Tene
113
<VirtualHost *:8080>
114
 ServerName redmine.example.com
115 1 Yovav Cohen Tene
 DocumentRoot /usr/local/share/redmine/public
116
 <Directory /usr/local/share/redmine/public>
117
   AllowOverride all
118
   Options -MultiViews
119
 </Directory>
120 7 Yovav Cohen Tene
</VirtualHost>
121
</pre>
122 10 Yovav Cohen Tene
123 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 
124
  default' from  http://imsunnyshah.wordpress.com/2013/04/29/how-to-setup-redmine-2-3-0-on-ubuntu-12-10/  )
125 10 Yovav Cohen Tene
126 17 Christopher Semmler
*TODO:: The redmine installation works, but user editing return an error when using Passenger and adding Git Plugin*
127 10 Yovav Cohen Tene
128 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.
129 7 Yovav Cohen Tene
130 17 Christopher Semmler
The default login/password is admin/admin (*don't forget to change this*).
131 7 Yovav Cohen Tene
132
h2. Sources of inspiration
133
134
We used the following resources as a starting point. Thanks to their respective authors.
135
136
* http://madpropellerhead.com/random/20100820-installing-redmine-on-debian-with-apache (outdated, for Lenny)
137
* http://www.redmine.org/projects/redmine/wiki/RedmineInstall
138
* http://hodza.net/2012/03/15/howto-install-redmine-on-debian-6-squeeze-ruby-on-rails-apache2-passenger/
139
* http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger