Projekt

Allgemein

Profil

Redmine bitnami 3 0 3 0 » Historie » Version 5

Jeremias Keihsler, 08.02.2018 08:55

1 1 Jeremias Keihsler
h1. Bitnami 3.0.3-0
2
3
h2. MySQL Redmine-Scripts
4
5
h3. Create MySQL-Reader-User
6
7
<pre><code class="sql">
8
mysql -u root -p
9
grant select on bitnami_redmine.* to 'redmine_reader'@'localhost';
10
</code></pre>
11
12 5 Jeremias Keihsler
h2. setup receiving email
13
14
add following shell-script to @/usr/local/bin/redmine_recv_mail.sh@
15
16
<pre><code class="bash">
17
18
#to make this work I also had to do following things:
19
#
20
#  cd /opt/redmine-2.5.2-2
21
#  ./use_redmine
22
#  gem install rake -v 10.1.1
23
#
24
#add following file to 
25
26
PATH="/opt/redmine-3.0.3-0/perl/bin:/opt/redmine-3.0.3-0/git/bin:/opt/redmine-3.0.3-0/sqlite/bin:/opt/redmine-3.0.3-0/ruby/bin:/opt/redmine-3.0.3-0/subversion/bin:/opt/redmine-3.0.3-0/postgresql/bin:/opt/redmine-3.0.3-0/php/bin:/opt/redmine-3.0.3-0/mysql/bin:/opt/redmine-3.0.3-0/apache2/bin:/opt/redmine-3.0.3-0/common/bin:$PATH"
27
BITNAMI_ROOT="/opt/redmine-3.0.3-0"
28
export BITNAMI_ROOT
29
30
cd /opt/redmine-3.0.3-0/apps/redmine/htdocs
31
bundle exec rake redmine:email:receive_imap RAILS_ENV="production" ssl=true host=mail.example.com port=993 username=redmine@example.com password=mySecret4711 unknown_user=create no_permission_check=1
32
</code></pre>
33
34
 this setup will accept mails from everyone and automagically register unknown users.
35
36
add following cron-file @/etc/cron.d/redmine_mail_recv@
37
38
<pre><code class="bash">
39
 */15 * * * * root /usr/local/bin/redmine_recv_mail.sh
40
</code></pre>
41
42
if you get an error about bundle you may want to try 
43
44
if you get an error about SSL-certificate (self signed) you may bypass SSL-verify by adding this file to @/opt/redmine-2.5.2-2/apps/redmine/htdocs/config/initializers/avoid_ssl_verification.rb@
45
46
<pre><code class="ruby">
47
    require 'openssl'
48
    OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
49
</code></pre>
50
51 1 Jeremias Keihsler
h2. Troubleshoot imap
52
53
change @/opt/redmine-3.0.3-0/ruby/lib/ruby/2.0.0/net/imap.rb@ line ~1429
54
55
<pre><code class="ruby">
56
    def create_ssl_params(certs = nil, verify = true)
57
      params = {}
58
      if certs
59
        if File.file?(certs)
60
          params[:ca_file] = certs
61
        elsif File.directory?(certs)
62
          params[:ca_path] = certs
63
        end
64
      end
65
      if verify
66
      #  params[:verify_mode] = VERIFY_PEER
67
      #  taken out by JKE 2015-07-06
68
        params[:verify_mode] = VERIFY_NONE
69
      else
70
        params[:verify_mode] = VERIFY_NONE
71
      end
72
      return params
73
    end
74
</code></pre>
75 2 Jeremias Keihsler
76
h2. setup log-rotating
77
78
h3. Redmine
79
80
The Bitnami-Stack does not preconfigure log-rotating for the @production.log@ located in @/opt/redmine-3.0.3-0/apps/redmine/htdocs/log@. Although you could use the standard Logrotate it's recommended (http://www.redmine.org/boards/2/topics/11836) to use the Ruby-functionality. Add following parameter to @/opt/redmine-3.0.3-0/apps/redmine/htdocs/config/environments/production.rb@ and restart the Bitnami-Stack.
81
82
According to http://www.redmine.org/issues/11603 you have to provide a file directly to @Logger.new@ instead of the sample in the @production.rb@.
83
84
<pre><code class="ruby">
85
# 7 log-files, 20MB each
86
config.logger = Logger.new('/opt/redmine-3.0.3-0/apps/redmine/htdocs/log/production.log', 7, 20971520)
87
config.logger.level = Logger::INFO
88
</code></pre>
89
90
<pre>
91
[root@redmine ~]# cd /opt/redmine-3.0.3-0/apps/redmine/htdocs/log/
92
[root@redmine log]# ll
93
total 1120
94
-rwxrwxr-x. 1 root   daemon      36 Jun 18  2012 delete.me
95
-rw-r--r--. 1 daemon daemon   12158 Jul  9 09:36 production.log
96
-rw-rw-r--. 1 root   daemon   30053 Jul  9 09:28 production.log.0
97
-rwxrwxr-x. 1 root   daemon 1093571 Jul  9 08:59 production.log.1
98
</pre>
99 3 Jeremias Keihsler
100
h3. apache / mysql
101
102
let's use @logrotate@ for this task. There is @.conf@-files already shipped with the bitnami-stack.
103 4 Jeremias Keihsler
https://docs.bitnami.com/installer/components/logrotate/
104 3 Jeremias Keihsler
105
<pre><code class="bash">
106
ln -s /opt/redmine-3.0.3-0/config/logrotate/logrotate.d/apache.conf /etc/logrotate.d/bitnami_3.0.3-0_apache.conf
107
ln -s /opt/redmine-3.0.3-0/config/logrotate/logrotate.d/mysql.conf /etc/logrotate.d/bitnami_3.0.3-0_mysql.conf
108
</code></pre>